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(); ?>
diff --git a/modules/mod_breadcrumbs/mod_breadcrumbs.php b/modules/mod_breadcrumbs/mod_breadcrumbs.php index 25af07ea76269..83fabbdb6d842 100644 --- a/modules/mod_breadcrumbs/mod_breadcrumbs.php +++ b/modules/mod_breadcrumbs/mod_breadcrumbs.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the breadcrumbs functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModBreadCrumbsHelper', __DIR__ . '/helper.php'); // Get the breadcrumbs $list = ModBreadCrumbsHelper::getList($params); diff --git a/modules/mod_feed/mod_feed.php b/modules/mod_feed/mod_feed.php index 0e611f1cd01b8..c61d72e945a24 100644 --- a/modules/mod_feed/mod_feed.php +++ b/modules/mod_feed/mod_feed.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the feed functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModFeedHelper', __DIR__ . '/helper.php'); $rssurl = $params->get('rssurl', ''); $rssrtl = $params->get('rssrtl', 0); diff --git a/modules/mod_finder/mod_finder.php b/modules/mod_finder/mod_finder.php index c1568eabe5da3..60e14780a3a67 100644 --- a/modules/mod_finder/mod_finder.php +++ b/modules/mod_finder/mod_finder.php @@ -13,7 +13,7 @@ JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php'); // Include the helper. -require_once __DIR__ . '/helper.php'; +JLoader::register('ModFinderHelper', __DIR__ . '/helper.php'); if (!defined('FINDER_PATH_INDEXER')) { @@ -51,6 +51,6 @@ FinderHelperLanguage::loadPluginLanguage(); // Get Smart Search query object. -$query = modFinderHelper::getQuery($params); +$query = ModFinderHelper::getQuery($params); require JModuleHelper::getLayoutPath('mod_finder', $params->get('layout', 'default')); diff --git a/modules/mod_languages/mod_languages.php b/modules/mod_languages/mod_languages.php index 8dcc503ef201d..2870aa02dfd08 100644 --- a/modules/mod_languages/mod_languages.php +++ b/modules/mod_languages/mod_languages.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the languages functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModLanguagesHelper', __DIR__ . '/helper.php'); $headerText = $params->get('header_text'); $footerText = $params->get('footer_text'); diff --git a/modules/mod_login/mod_login.php b/modules/mod_login/mod_login.php index 607185eea0a1f..894680d3292ed 100644 --- a/modules/mod_login/mod_login.php +++ b/modules/mod_login/mod_login.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the login functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModLoginHelper', __DIR__ . '/helper.php'); $params->def('greeting', 1); diff --git a/modules/mod_login/tmpl/default.php b/modules/mod_login/tmpl/default.php index 4f56a3d02a011..1db9cbed78c62 100644 --- a/modules/mod_login/tmpl/default.php +++ b/modules/mod_login/tmpl/default.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_users/helpers/route.php'; +JLoader::register('UsersHelperRoute', JPATH_SITE . '/components/com_users/helpers/route.php'); JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); diff --git a/modules/mod_menu/mod_menu.php b/modules/mod_menu/mod_menu.php index 2a8733220695f..f70044a25116c 100644 --- a/modules/mod_menu/mod_menu.php +++ b/modules/mod_menu/mod_menu.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the menu functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModMenuHelper', __DIR__ . '/helper.php'); $list = ModMenuHelper::getList($params); $base = ModMenuHelper::getBase($params); diff --git a/modules/mod_random_image/mod_random_image.php b/modules/mod_random_image/mod_random_image.php index d88e8f71d3a5f..bc83f2eddec51 100644 --- a/modules/mod_random_image/mod_random_image.php +++ b/modules/mod_random_image/mod_random_image.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the random image functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModRandomImageHelper', __DIR__ . '/helper.php'); $link = $params->get('link'); $folder = ModRandomImageHelper::getFolder($params); diff --git a/modules/mod_related_items/mod_related_items.php b/modules/mod_related_items/mod_related_items.php index ca4d2d667d827..02e75448cb194 100644 --- a/modules/mod_related_items/mod_related_items.php +++ b/modules/mod_related_items/mod_related_items.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the related items functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModRelatedItemsHelper', __DIR__ . '/helper.php'); $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; diff --git a/modules/mod_search/mod_search.php b/modules/mod_search/mod_search.php index 3db5f9dfb50c0..694a7120f11e4 100644 --- a/modules/mod_search/mod_search.php +++ b/modules/mod_search/mod_search.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the search functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModSearchHelper', __DIR__ . '/helper.php'); $lang = JFactory::getLanguage(); $app = JFactory::getApplication(); diff --git a/modules/mod_stats/mod_stats.php b/modules/mod_stats/mod_stats.php index 593106e36fc2e..2b18cdf0d07a1 100644 --- a/modules/mod_stats/mod_stats.php +++ b/modules/mod_stats/mod_stats.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the statistics functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModStatsHelper', __DIR__ . '/helper.php'); $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); diff --git a/modules/mod_syndicate/mod_syndicate.php b/modules/mod_syndicate/mod_syndicate.php index b0c0cdb318aee..79fd77de21807 100644 --- a/modules/mod_syndicate/mod_syndicate.php +++ b/modules/mod_syndicate/mod_syndicate.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the syndicate functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModSyndicateHelper', __DIR__ . '/helper.php'); $params->def('format', 'rss'); diff --git a/modules/mod_tags_popular/mod_tags_popular.php b/modules/mod_tags_popular/mod_tags_popular.php index 74bfb05da6fde..8d75f0295a788 100644 --- a/modules/mod_tags_popular/mod_tags_popular.php +++ b/modules/mod_tags_popular/mod_tags_popular.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the tags_popular functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModTagsPopularHelper', __DIR__ . '/helper.php'); $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; diff --git a/modules/mod_tags_similar/mod_tags_similar.php b/modules/mod_tags_similar/mod_tags_similar.php index a53fcc72f76c2..1c2914a9cd30d 100644 --- a/modules/mod_tags_similar/mod_tags_similar.php +++ b/modules/mod_tags_similar/mod_tags_similar.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the tags_similar functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModTagssimilarHelper', __DIR__ . '/helper.php'); $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; diff --git a/modules/mod_users_latest/mod_users_latest.php b/modules/mod_users_latest/mod_users_latest.php index bc8c6ab3f5859..1efac2b180f0d 100644 --- a/modules/mod_users_latest/mod_users_latest.php +++ b/modules/mod_users_latest/mod_users_latest.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the latest functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModUsersLatestHelper', __DIR__ . '/helper.php'); $shownumber = $params->get('shownumber', 5); $names = ModUsersLatestHelper::getUsers($params); diff --git a/modules/mod_whosonline/mod_whosonline.php b/modules/mod_whosonline/mod_whosonline.php index 95e7b1a8e623b..dbb0a388a3860 100644 --- a/modules/mod_whosonline/mod_whosonline.php +++ b/modules/mod_whosonline/mod_whosonline.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the whosonline functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModWhosonlineHelper', __DIR__ . '/helper.php'); $showmode = $params->get('showmode', 0); diff --git a/modules/mod_wrapper/mod_wrapper.php b/modules/mod_wrapper/mod_wrapper.php index 62e0dc43bf0be..c357757a0e001 100644 --- a/modules/mod_wrapper/mod_wrapper.php +++ b/modules/mod_wrapper/mod_wrapper.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the wrapper functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModWrapperHelper', __DIR__ . '/helper.php'); $params = ModWrapperHelper::getParams($params); diff --git a/plugins/authentication/joomla/joomla.php b/plugins/authentication/joomla/joomla.php index f3e9b2529f594..e0b219b18191f 100644 --- a/plugins/authentication/joomla/joomla.php +++ b/plugins/authentication/joomla/joomla.php @@ -90,7 +90,7 @@ public function onUserAuthenticate($credentials, $options, &$response) // Check the two factor authentication if ($response->status == JAuthentication::STATUS_SUCCESS) { - require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; + JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'); $methods = UsersHelper::getTwoFactorMethods(); @@ -100,9 +100,10 @@ public function onUserAuthenticate($credentials, $options, &$response) return; } - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); - $model = new UsersModelUser; + /** @var UsersModelUser $model */ + $model = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); // Load the user's OTP (one time password, a.k.a. two factor auth) configuration if (!array_key_exists('otp_config', $options)) @@ -141,12 +142,6 @@ public function onUserAuthenticate($credentials, $options, &$response) return; } - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - // Try to validate the OTP FOFPlatform::getInstance()->importPlugin('twofactorauth'); diff --git a/plugins/finder/categories/categories.php b/plugins/finder/categories/categories.php index 37725f82224da..e974fb2ebf332 100644 --- a/plugins/finder/categories/categories.php +++ b/plugins/finder/categories/categories.php @@ -11,7 +11,7 @@ use Joomla\Registry\Registry; -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Smart Search adapter for Joomla Categories. @@ -341,7 +341,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') protected function setup() { // Load com_content route helper as it is the fallback for routing in the indexer in this instance. - include_once JPATH_SITE . '/components/com_content/helpers/route.php'; + JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); return true; } diff --git a/plugins/finder/contacts/contacts.php b/plugins/finder/contacts/contacts.php index 4b6c4a51214ea..4aa78414bfd86 100644 --- a/plugins/finder/contacts/contacts.php +++ b/plugins/finder/contacts/contacts.php @@ -11,7 +11,7 @@ use Joomla\Registry\Registry; -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Finder adapter for Joomla Contacts. @@ -388,7 +388,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') protected function setup() { // Load dependent classes. - require_once JPATH_SITE . '/components/com_contact/helpers/route.php'; + JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php'); // This is a hack to get around the lack of a route helper. FinderIndexerHelper::getContentPath('index.php?option=com_contact'); diff --git a/plugins/finder/content/content.php b/plugins/finder/content/content.php index 3d83299059d9a..adb36ec372af2 100644 --- a/plugins/finder/content/content.php +++ b/plugins/finder/content/content.php @@ -11,7 +11,7 @@ use Joomla\Registry\Registry; -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Smart Search adapter for com_content. @@ -324,7 +324,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') protected function setup() { // Load dependent classes. - include_once JPATH_SITE . '/components/com_content/helpers/route.php'; + JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); return true; } diff --git a/plugins/finder/newsfeeds/newsfeeds.php b/plugins/finder/newsfeeds/newsfeeds.php index 5bf44856d78b0..615c4ba043044 100644 --- a/plugins/finder/newsfeeds/newsfeeds.php +++ b/plugins/finder/newsfeeds/newsfeeds.php @@ -11,7 +11,7 @@ use Joomla\Registry\Registry; -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Smart Search adapter for Joomla Newsfeeds. @@ -315,7 +315,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') protected function setup() { // Load dependent classes. - require_once JPATH_SITE . '/components/com_newsfeeds/helpers/route.php'; + JLoader::register('NewsfeedsHelperRoute', JPATH_SITE . '/components/com_newsfeeds/helpers/route.php'); return true; } diff --git a/plugins/finder/tags/tags.php b/plugins/finder/tags/tags.php index d6879cdb47314..cbcb2be9fbef2 100644 --- a/plugins/finder/tags/tags.php +++ b/plugins/finder/tags/tags.php @@ -11,8 +11,7 @@ use Joomla\Registry\Registry; -// Load the base adapter. -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Finder adapter for Joomla Tag. @@ -275,7 +274,7 @@ protected function index(FinderIndexerResult $item, $format = 'html') protected function setup() { // Load dependent classes. - require_once JPATH_SITE . '/components/com_tags/helpers/route.php'; + JLoader::register('TagsHelperRoute', JPATH_SITE . '/components/com_tags/helpers/route.php'); return true; } diff --git a/plugins/search/categories/categories.php b/plugins/search/categories/categories.php index 7e26588ae18e5..89593ce0e64cc 100644 --- a/plugins/search/categories/categories.php +++ b/plugins/search/categories/categories.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'); /** * Categories search plugin. diff --git a/plugins/search/contacts/contacts.php b/plugins/search/contacts/contacts.php index b908c8c7b2de0..80017f72e35c0 100644 --- a/plugins/search/contacts/contacts.php +++ b/plugins/search/contacts/contacts.php @@ -57,7 +57,7 @@ public function onContentSearchAreas() */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { - require_once JPATH_SITE . '/components/com_contact/helpers/route.php'; + JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php'); $db = JFactory::getDbo(); $app = JFactory::getApplication(); diff --git a/plugins/search/content/content.php b/plugins/search/content/content.php index a4b39fe579ea5..1595d7b1d905a 100644 --- a/plugins/search/content/content.php +++ b/plugins/search/content/content.php @@ -54,8 +54,8 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = JFactory::getLanguage()->getTag(); - require_once JPATH_SITE . '/components/com_content/helpers/route.php'; - require_once JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'; + JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); + JLoader::register('SearchHelper', JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'); $searchText = $text; diff --git a/plugins/search/tags/tags.php b/plugins/search/tags/tags.php index 4dda72c55d897..c01b15e768405 100644 --- a/plugins/search/tags/tags.php +++ b/plugins/search/tags/tags.php @@ -151,7 +151,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu if ($rows) { - require_once JPATH_ROOT . '/components/com_tags/helpers/route.php'; + JLoader::register('TagsHelperRoute', JPATH_SITE . '/components/com_tags/helpers/route.php'); foreach ($rows as $key => $row) { diff --git a/plugins/system/stats/field/data.php b/plugins/system/stats/field/data.php index 4ce0a89982f94..fee11f687b3ea 100644 --- a/plugins/system/stats/field/data.php +++ b/plugins/system/stats/field/data.php @@ -9,7 +9,7 @@ defined('JPATH_BASE') or die; -require_once __DIR__ . '/base.php'; +JLoader::register('PlgSystemStatsFormFieldBase', __DIR__ . '/base.php'); /** * Unique ID Field class for the Stats Plugin. diff --git a/plugins/system/stats/field/uniqueid.php b/plugins/system/stats/field/uniqueid.php index cffb4fdfb04ed..a60f6c543f8b2 100644 --- a/plugins/system/stats/field/uniqueid.php +++ b/plugins/system/stats/field/uniqueid.php @@ -9,7 +9,7 @@ defined('JPATH_BASE') or die; -require_once __DIR__ . '/base.php'; +JLoader::register('PlgSystemStatsFormFieldBase', __DIR__ . '/base.php'); /** * Unique ID Field class for the Stats Plugin. diff --git a/plugins/system/updatenotification/updatenotification.php b/plugins/system/updatenotification/updatenotification.php index 48604a8245534..fe6e9bae60d75 100644 --- a/plugins/system/updatenotification/updatenotification.php +++ b/plugins/system/updatenotification/updatenotification.php @@ -120,8 +120,8 @@ public function onAfterRender() return; } - // Unfortunately Joomla! MVC doesn't allow us to autoload classes, hence the need for an ugly require_once - require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/update.php'; + // Unfortunately Joomla! MVC doesn't allow us to autoload classes + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_installer/models', 'InstallerModel'); // Get the update model and retrieve the Joomla! core updates $model = JModelLegacy::getInstance('Update', 'InstallerModel'); diff --git a/plugins/twofactorauth/totp/totp.php b/plugins/twofactorauth/totp/totp.php index 16ff5216f8005..a0daa2f19d5e2 100644 --- a/plugins/twofactorauth/totp/totp.php +++ b/plugins/twofactorauth/totp/totp.php @@ -32,27 +32,6 @@ class PlgTwofactorauthTotp extends JPlugin */ protected $methodName = 'totp'; - /** - * Constructor - * - * @param object &$subject The object to observe - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'group', 'params', 'language' - * (this list is not meant to be comprehensive). - * - * @since 3.2 - */ - public function __construct(&$subject, $config = array()) - { - parent::__construct($subject, $config); - - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - } - /** * This method returns the identification object for this two factor * authentication plugin. diff --git a/plugins/twofactorauth/yubikey/yubikey.php b/plugins/twofactorauth/yubikey/yubikey.php index fc4f218b7da2b..3f23b016d8d3e 100644 --- a/plugins/twofactorauth/yubikey/yubikey.php +++ b/plugins/twofactorauth/yubikey/yubikey.php @@ -32,27 +32,6 @@ class PlgTwofactorauthYubikey extends JPlugin */ protected $methodName = 'yubikey'; - /** - * Constructor - * - * @param object &$subject The object to observe - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'group', 'params', 'language' - * (this list is not meant to be comprehensive). - * - * @since 3.2 - */ - public function __construct(&$subject, $config = array()) - { - parent::__construct($subject, $config); - - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - } - /** * This method returns the identification object for this two factor * authentication plugin. diff --git a/templates/beez3/html/com_contact/contact/default_articles.php b/templates/beez3/html/com_contact/contact/default_articles.php index 2a1bbc69bbe6b..8e853f6d86729 100644 --- a/templates/beez3/html/com_contact/contact/default_articles.php +++ b/templates/beez3/html/com_contact/contact/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/templates/protostar/offline.php b/templates/protostar/offline.php index 3ce832825802c..8811a6ae94df5 100644 --- a/templates/protostar/offline.php +++ b/templates/protostar/offline.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; +JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'); $twofactormethods = UsersHelper::getTwoFactorMethods(); $app = JFactory::getApplication();