diff --git a/components/com_contact/contact.php b/components/com_contact/contact.php index 5458f082450d9..a119f16139c3e 100644 --- a/components/com_contact/contact.php +++ b/components/com_contact/contact.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('ContactHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Contact'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_contact/models/contact.php b/components/com_contact/models/contact.php index b594ddaff51f1..32f5e535183ed 100644 --- a/components/com_contact/models/contact.php +++ b/components/com_contact/models/contact.php @@ -359,7 +359,7 @@ protected function buildContactExtendedData($contact) } // Get the profile information for the linked user - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); $userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); $data = $userModel->getItem((int) $contact->user_id); @@ -542,7 +542,7 @@ protected function getContactQuery($pk = null) } // Get the profile information for the linked user - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); $userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); $data = $userModel->getItem((int) $result->user_id); diff --git a/components/com_contact/views/contact/tmpl/default_articles.php b/components/com_contact/views/contact/tmpl/default_articles.php index c8206cbd4a3f2..561214ae18d0e 100644 --- a/components/com_contact/views/contact/tmpl/default_articles.php +++ b/components/com_contact/views/contact/tmpl/default_articles.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); ?> params->get('show_articles')) : ?> diff --git a/components/com_contact/views/contact/view.html.php b/components/com_contact/views/contact/view.html.php index 32603028be3d8..701e0e43e2fc3 100644 --- a/components/com_contact/views/contact/view.html.php +++ b/components/com_contact/views/contact/view.html.php @@ -9,8 +9,6 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/models/category.php'; - /** * HTML Contact View class for the Contact component * diff --git a/components/com_content/content.php b/components/com_content/content.php index ddf20c2528d6d..cfa7acd73005f 100644 --- a/components/com_content/content.php +++ b/components/com_content/content.php @@ -9,8 +9,8 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; -require_once JPATH_COMPONENT . '/helpers/query.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); +JLoader::register('ContentHelperQuery', JPATH_SITE . '/components/com_content/helpers/query.php'); $input = JFactory::getApplication()->input; $user = JFactory::getUser(); diff --git a/components/com_content/helpers/icon.php b/components/com_content/helpers/icon.php index e54dfc43f74e2..a0a034fca05f6 100644 --- a/components/com_content/helpers/icon.php +++ b/components/com_content/helpers/icon.php @@ -81,13 +81,13 @@ public static function create($category, $params, $attribs = array(), $legacy = */ public static function email($article, $params, $attribs = array(), $legacy = false) { - require_once JPATH_SITE . '/components/com_mailto/helpers/mailto.php'; + JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php'); $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'host', 'port')); $template = JFactory::getApplication()->getTemplate(); $link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false); - $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailToHelper::addLink($link); + $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; diff --git a/components/com_content/models/archive.php b/components/com_content/models/archive.php index 09bbcbb762c93..fca4c8254b5f7 100644 --- a/components/com_content/models/archive.php +++ b/components/com_content/models/archive.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); /** * Content Component Archive Model diff --git a/components/com_content/models/featured.php b/components/com_content/models/featured.php index b72824598bc68..7ef3f2de2070c 100644 --- a/components/com_content/models/featured.php +++ b/components/com_content/models/featured.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); /** * Frontpage Component Model diff --git a/components/com_content/models/form.php b/components/com_content/models/form.php index 72dcca654b3f2..c39be47a16b08 100644 --- a/components/com_content/models/form.php +++ b/components/com_content/models/form.php @@ -13,7 +13,7 @@ use Joomla\Utilities\ArrayHelper; // Base this model on the backend version. -require_once JPATH_ADMINISTRATOR . '/components/com_content/models/article.php'; +JLoader::register('ContentModelArticle', JPATH_ADMINISTRATOR . '/components/com_content/models/article.php'); /** * Content Component Article Model diff --git a/components/com_finder/finder.php b/components/com_finder/finder.php index 264fdcea9e5b1..eea5a49bcefa3 100644 --- a/components/com_finder/finder.php +++ b/components/com_finder/finder.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('FinderHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Finder'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_mailto/mailto.php b/components/com_mailto/mailto.php index a9341da1dc05e..2b889057b30a8 100644 --- a/components/com_mailto/mailto.php +++ b/components/com_mailto/mailto.php @@ -9,8 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/mailto.php'; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('MailtoHelper', JPATH_COMPONENT . '/helpers/mailto.php'); $controller = JControllerLegacy::getInstance('Mailto'); $controller->registerDefaultTask('mailto'); diff --git a/components/com_newsfeeds/newsfeeds.php b/components/com_newsfeeds/newsfeeds.php index bcd559c0e093e..890e60efa8067 100644 --- a/components/com_newsfeeds/newsfeeds.php +++ b/components/com_newsfeeds/newsfeeds.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('NewsfeedsHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); $controller = JControllerLegacy::getInstance('Newsfeeds'); diff --git a/components/com_search/views/search/view.html.php b/components/com_search/views/search/view.html.php index 1556490a688d7..4b0d4823cd074 100644 --- a/components/com_search/views/search/view.html.php +++ b/components/com_search/views/search/view.html.php @@ -27,7 +27,7 @@ class SearchViewSearch extends JViewLegacy */ public function display($tpl = null) { - require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/search.php'; + JLoader::register('SearchHelper', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/search.php'); $app = JFactory::getApplication(); $uri = JUri::getInstance(); @@ -140,7 +140,7 @@ public function display($tpl = null) $total = $this->get('total'); $pagination = $this->get('pagination'); - require_once JPATH_SITE . '/components/com_content/helpers/route.php'; + JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); for ($i = 0, $count = count($results); $i < $count; $i++) { diff --git a/components/com_tags/tags.php b/components/com_tags/tags.php index 6ebe271eb8c61..55d66b036a738 100644 --- a/components/com_tags/tags.php +++ b/components/com_tags/tags.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('TagsHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Tags'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_users/controllers/profile.json.php b/components/com_users/controllers/profile.json.php index 6426a222b064e..380fe3287f1b8 100644 --- a/components/com_users/controllers/profile.json.php +++ b/components/com_users/controllers/profile.json.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_users/controllers/profile_base_json.php'; +JLoader::register('UsersControllerProfile_Base_Json', __DIR__ . '/profile_base_json.php'); /** * Profile controller class for Users. diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index b6f8080c539c8..a2fbdc594def3 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Profile controller class for Users. diff --git a/components/com_users/controllers/registration.php b/components/com_users/controllers/registration.php index b2c17c6616616..9ff05d27723b4 100644 --- a/components/com_users/controllers/registration.php +++ b/components/com_users/controllers/registration.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Registration controller class for Users. diff --git a/components/com_users/controllers/remind.php b/components/com_users/controllers/remind.php index 7c297d022291a..bfd4cd0364156 100644 --- a/components/com_users/controllers/remind.php +++ b/components/com_users/controllers/remind.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Reset controller class for Users. diff --git a/components/com_users/controllers/reset.php b/components/com_users/controllers/reset.php index cca19ef6cfe8e..bb9d164cc3027 100644 --- a/components/com_users/controllers/reset.php +++ b/components/com_users/controllers/reset.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Reset controller class for Users. diff --git a/components/com_users/controllers/user.php b/components/com_users/controllers/user.php index 56efe6c0e1a5b..035866860c4f8 100644 --- a/components/com_users/controllers/user.php +++ b/components/com_users/controllers/user.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Registration controller class for Users. diff --git a/components/com_users/models/profile.php b/components/com_users/models/profile.php index 41eb6240d6efb..5e45ccae75284 100644 --- a/components/com_users/models/profile.php +++ b/components/com_users/models/profile.php @@ -43,15 +43,9 @@ public function __construct($config = array()) parent::__construct($config); - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - // Load the helper and model used for two factor authentication - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; - require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; + JLoader::register('UsersModelUser', JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'); + JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'); } /** diff --git a/components/com_users/users.php b/components/com_users/users.php index 99cbdc522d16c..2138d06f84b0c 100644 --- a/components/com_users/users.php +++ b/components/com_users/users.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('UsersHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Users'); $controller->execute(JFactory::getApplication()->input->get('task', 'display')); diff --git a/components/com_users/views/profile/tmpl/default_custom.php b/components/com_users/views/profile/tmpl/default_custom.php index edd13c0c93bd5..5a93f6fbaf5df 100644 --- a/components/com_users/views/profile/tmpl/default_custom.php +++ b/components/com_users/views/profile/tmpl/default_custom.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php'); +JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::register('users.spacer', array('JHtmlUsers', 'spacer')); $fieldsets = $this->form->getFieldsets(); diff --git a/components/com_users/views/profile/tmpl/default_params.php b/components/com_users/views/profile/tmpl/default_params.php index 53bd37efefa11..2b254503e0f31 100644 --- a/components/com_users/views/profile/tmpl/default_params.php +++ b/components/com_users/views/profile/tmpl/default_params.php @@ -9,13 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php'); -JHtml::register('users.spacer', array('JHtmlUsers', 'spacer')); -JHtml::register('users.helpsite', array('JHtmlUsers', 'helpsite')); -JHtml::register('users.templatestyle', array('JHtmlUsers', 'templatestyle')); -JHtml::register('users.admin_language', array('JHtmlUsers', 'admin_language')); -JHtml::register('users.language', array('JHtmlUsers', 'language')); -JHtml::register('users.editor', array('JHtmlUsers', 'editor')); +JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); ?> form->getFieldset('params'); ?> diff --git a/modules/mod_articles_archive/mod_articles_archive.php b/modules/mod_articles_archive/mod_articles_archive.php index 035fb9d57c658..643b3c335e1da 100644 --- a/modules/mod_articles_archive/mod_articles_archive.php +++ b/modules/mod_articles_archive/mod_articles_archive.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the archive functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php'); $params->def('count', 10); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); diff --git a/modules/mod_articles_categories/helper.php b/modules/mod_articles_categories/helper.php index bae588015acae..ed4422a26bd18 100644 --- a/modules/mod_articles_categories/helper.php +++ b/modules/mod_articles_categories/helper.php @@ -9,15 +9,12 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); /** * Helper for mod_articles_categories * - * @package Joomla.Site - * @subpackage mod_articles_categories - * - * @since 1.5 + * @since 1.5 */ abstract class ModArticlesCategoriesHelper { diff --git a/modules/mod_articles_categories/mod_articles_categories.php b/modules/mod_articles_categories/mod_articles_categories.php index 0e50c4bd9b502..630ee9b588a19 100644 --- a/modules/mod_articles_categories/mod_articles_categories.php +++ b/modules/mod_articles_categories/mod_articles_categories.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the helper functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArticlesCategoriesHelper', __DIR__ . '/helper.php'); JLoader::register('JCategoryNode', JPATH_BASE . '/libraries/legacy/categories/categories.php'); diff --git a/modules/mod_articles_category/mod_articles_category.php b/modules/mod_articles_category/mod_articles_category.php index 4f7c291b3d403..232b5aa7ef97c 100644 --- a/modules/mod_articles_category/mod_articles_category.php +++ b/modules/mod_articles_category/mod_articles_category.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the helper functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArticlesCategoryHelper', __DIR__ . '/helper.php'); $input = JFactory::getApplication()->input; diff --git a/modules/mod_articles_latest/helper.php b/modules/mod_articles_latest/helper.php index 606161580ac34..387cec9015795 100644 --- a/modules/mod_articles_latest/helper.php +++ b/modules/mod_articles_latest/helper.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); @@ -18,9 +18,7 @@ /** * Helper for mod_articles_latest * - * @package Joomla.Site - * @subpackage mod_articles_latest - * @since 1.6 + * @since 1.6 */ abstract class ModArticlesLatestHelper { diff --git a/modules/mod_articles_latest/mod_articles_latest.php b/modules/mod_articles_latest/mod_articles_latest.php index b31dfa7a9206b..4df8db738a9e8 100644 --- a/modules/mod_articles_latest/mod_articles_latest.php +++ b/modules/mod_articles_latest/mod_articles_latest.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the latest functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArticlesLatestHelper', __DIR__ . '/helper.php'); $list = ModArticlesLatestHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); diff --git a/modules/mod_articles_news/helper.php b/modules/mod_articles_news/helper.php index d41ceebf2620a..30f88457f2913 100644 --- a/modules/mod_articles_news/helper.php +++ b/modules/mod_articles_news/helper.php @@ -9,17 +9,14 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_news * - * @package Joomla.Site - * @subpackage mod_articles_news - * - * @since 1.6 + * @since 1.6 */ abstract class ModArticlesNewsHelper { diff --git a/modules/mod_articles_news/mod_articles_news.php b/modules/mod_articles_news/mod_articles_news.php index 65080a18a43f7..adea2c7596a47 100644 --- a/modules/mod_articles_news/mod_articles_news.php +++ b/modules/mod_articles_news/mod_articles_news.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the news functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArticlesNewsHelper', __DIR__ . '/helper.php'); $list = ModArticlesNewsHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); diff --git a/modules/mod_articles_popular/helper.php b/modules/mod_articles_popular/helper.php index 1f13617f9a788..ce21b6eb40e02 100644 --- a/modules/mod_articles_popular/helper.php +++ b/modules/mod_articles_popular/helper.php @@ -9,17 +9,14 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_popular * - * @package Joomla.Site - * @subpackage mod_articles_popular - * - * @since 1.6.0 + * @since 1.6.0 */ abstract class ModArticlesPopularHelper { diff --git a/modules/mod_articles_popular/mod_articles_popular.php b/modules/mod_articles_popular/mod_articles_popular.php index cd58035c5cfdd..16e2d4334a6c4 100644 --- a/modules/mod_articles_popular/mod_articles_popular.php +++ b/modules/mod_articles_popular/mod_articles_popular.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the popular functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModArticlesPopularHelper', __DIR__ . '/helper.php'); $list = ModArticlesPopularHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); diff --git a/modules/mod_banners/mod_banners.php b/modules/mod_banners/mod_banners.php index fb8c81c7702c5..6499db6b05378 100644 --- a/modules/mod_banners/mod_banners.php +++ b/modules/mod_banners/mod_banners.php @@ -10,12 +10,12 @@ defined('_JEXEC') or die; // Include the banners functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModBannersHelper', __DIR__ . '/helper.php'); $headerText = trim($params->get('header_text')); $footerText = trim($params->get('footer_text')); -require_once JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'; +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); BannersHelper::updateReset(); $list = &ModBannersHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); diff --git a/modules/mod_banners/tmpl/default.php b/modules/mod_banners/tmpl/default.php index 53faf0845572a..c0092cc008f4a 100644 --- a/modules/mod_banners/tmpl/default.php +++ b/modules/mod_banners/tmpl/default.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_ROOT . '/components/com_banners/helpers/banner.php'; +JLoader::register('BannerHelper', JPATH_ROOT . '/components/com_banners/helpers/banner.php'); $baseurl = JUri::base(); ?>