diff --git a/administrator/components/com_actionlogs/models/fields/plugininfo.php b/administrator/components/com_actionlogs/models/fields/plugininfo.php index a9ebb6550ca05..d3b3008132856 100644 --- a/administrator/components/com_actionlogs/models/fields/plugininfo.php +++ b/administrator/components/com_actionlogs/models/fields/plugininfo.php @@ -9,6 +9,11 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + /** * Information field. * @@ -33,7 +38,7 @@ class JFormFieldPluginInfo extends JFormField */ protected function getInput() { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $result = null; $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) @@ -51,15 +56,15 @@ protected function getInput() JError::raiseWarning(500, $e->getMessage()); } - $link = JHtml::_( + $link = HTMLHelper::_( 'link', - JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $result), - JText::_('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED'), + Route::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $result), + Text::_('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED'), array('class' => 'alert-link') ); return '
' - . JText::sprintf('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED_REDIRECT', $link) + . Text::sprintf('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED_REDIRECT', $link) . '
'; } } diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index aa768e509e263..fa1de4d02ed5a 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -16,6 +16,7 @@ use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; +use Joomla\CMS\Table\Table; use Joomla\Database\UTF8MB4SupportInterface; /** @@ -3985,7 +3986,7 @@ public function updateAssets($installer) foreach ($newComponents as $component) { /** @var JTableAsset $asset */ - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); if ($asset->loadByName($component)) { diff --git a/administrator/components/com_banners/tmpl/clients/default.php b/administrator/components/com_banners/tmpl/clients/default.php index ba134cdc2571c..bbe84b649e95e 100644 --- a/administrator/components/com_banners/tmpl/clients/default.php +++ b/administrator/components/com_banners/tmpl/clients/default.php @@ -13,6 +13,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Router\Route; HTMLHelper::_('behavior.multiselect'); @@ -29,7 +30,7 @@ $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -$params = $this->state->params ?? new JObject; +$params = $this->state->params ?? new CMSObject; ?>
diff --git a/administrator/components/com_categories/Model/CategoryModel.php b/administrator/components/com_categories/Model/CategoryModel.php index 68770ca10e529..399a539495e72 100644 --- a/administrator/components/com_categories/Model/CategoryModel.php +++ b/administrator/components/com_categories/Model/CategoryModel.php @@ -18,6 +18,7 @@ use Joomla\CMS\Date\Date; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; @@ -387,7 +388,7 @@ protected function loadFormData() * @since 1.6 * @throws \Exception if there is an error in the form event. */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { $lang = Factory::getLanguage(); $component = $this->getState('category.component'); diff --git a/administrator/components/com_config/Model/ComponentModel.php b/administrator/components/com_config/Model/ComponentModel.php index 5850aa905755a..159f657b771cf 100644 --- a/administrator/components/com_config/Model/ComponentModel.php +++ b/administrator/components/com_config/Model/ComponentModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\FormModel; use Joomla\CMS\Plugin\PluginHelper; @@ -73,12 +74,12 @@ public function getForm($data = array(), $loadData = true) if ($path = $state->get('component.path')) { // Add the search path for the admin component config.xml file. - \JForm::addFormPath($path); + Form::addFormPath($path); } else { // Add the search path for the admin component config.xml file. - \JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/' . $option); + Form::addFormPath(JPATH_ADMINISTRATOR . '/components/' . $option); } // Get the form. diff --git a/administrator/components/com_contact/Model/ContactModel.php b/administrator/components/com_contact/Model/ContactModel.php index 1d4dce086156e..5edb1cbd13209 100644 --- a/administrator/components/com_contact/Model/ContactModel.php +++ b/administrator/components/com_contact/Model/ContactModel.php @@ -12,6 +12,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; @@ -162,7 +163,7 @@ protected function canEditState($record) */ public function getForm($data = array(), $loadData = true) { - \JForm::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_users/models/fields'); + Form::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_users/models/fields'); // Get the form. $form = $this->loadForm('com_contact.contact', 'contact', array('control' => 'jform', 'load_data' => $loadData)); diff --git a/administrator/components/com_content/Field/VoteradioField.php b/administrator/components/com_content/Field/VoteradioField.php index afd844d3254ee..4032b9a2027b2 100644 --- a/administrator/components/com_content/Field/VoteradioField.php +++ b/administrator/components/com_content/Field/VoteradioField.php @@ -11,9 +11,10 @@ defined('_JEXEC') or die; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Plugin\PluginHelper; -\JFormHelper::loadFieldClass('radio'); +FormHelper::loadFieldClass('radio'); /** * Voteradio Field class. diff --git a/administrator/components/com_content/Model/ArticleModel.php b/administrator/components/com_content/Model/ArticleModel.php index a2924bde7f13e..1c10bed2d4f2d 100644 --- a/administrator/components/com_content/Model/ArticleModel.php +++ b/administrator/components/com_content/Model/ArticleModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; +use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; @@ -21,6 +22,7 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\String\PunycodeHelper; use Joomla\CMS\Table\Category; +use Joomla\CMS\Table\Table; use Joomla\CMS\Table\TableInterface; use Joomla\CMS\UCM\UCMType; use Joomla\CMS\Workflow\Workflow; @@ -488,7 +490,7 @@ public function getItem($pk = null) if (!empty($item->id)) { - $item->tags = new \JHelperTags; + $item->tags = new TagsHelper; $item->tags->getTagIds($item->id, 'com_content.article'); } } @@ -903,7 +905,7 @@ public function save($data) $data['alias'] = \JFilterOutput::stringURLSafe($data['title']); } - $table = \JTable::getInstance('Content', 'JTable'); + $table = Table::getInstance('Content', 'JTable'); if ($table->load(array('alias' => $data['alias'], 'catid' => $data['catid']))) { @@ -1343,7 +1345,7 @@ public function runTransition($pk, $transition_id) $context = $this->option . '.' . $this->name; // Include the plugins for the change of stage event. - \JPluginHelper::importPlugin($this->events_map['change_state']); + PluginHelper::importPlugin($this->events_map['change_state']); // Trigger the change stage event. Factory::getApplication()->triggerEvent($this->event_change_state, [$context, [$pk], $transition_id]); diff --git a/administrator/components/com_content/Model/ArticlesModel.php b/administrator/components/com_content/Model/ArticlesModel.php index 90bd4b2a64941..4a3f5816dac1e 100644 --- a/administrator/components/com_content/Model/ArticlesModel.php +++ b/administrator/components/com_content/Model/ArticlesModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Table\Table; use Joomla\CMS\Workflow\Workflow; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Utilities\ArrayHelper; @@ -386,7 +387,7 @@ protected function getListQuery() if (count($categoryId)) { $categoryId = ArrayHelper::toInteger($categoryId); - $categoryTable = \JTable::getInstance('Category', 'JTable'); + $categoryTable = Table::getInstance('Category', 'JTable'); $subCatItemsWhere = array(); foreach ($categoryId as $filter_catid) diff --git a/administrator/components/com_content/Model/FeaturedModel.php b/administrator/components/com_content/Model/FeaturedModel.php index eebe44f70bf46..5e07ca69bd286 100644 --- a/administrator/components/com_content/Model/FeaturedModel.php +++ b/administrator/components/com_content/Model/FeaturedModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Table\Table; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Utilities\ArrayHelper; @@ -206,7 +207,7 @@ protected function getListQuery() if (is_array($categoryId) && count($categoryId) === 1) { - $cat_tbl = \JTable::getInstance('Category', 'JTable'); + $cat_tbl = Table::getInstance('Category', 'JTable'); $cat_tbl->load($categoryId[0]); $rgt = $cat_tbl->rgt; $lft = $cat_tbl->lft; diff --git a/administrator/components/com_fields/Model/FieldModel.php b/administrator/components/com_fields/Model/FieldModel.php index 060a260c1ae3a..bef2670a81e38 100644 --- a/administrator/components/com_fields/Model/FieldModel.php +++ b/administrator/components/com_fields/Model/FieldModel.php @@ -17,6 +17,8 @@ use Joomla\CMS\Date\Date; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; @@ -251,7 +253,7 @@ private function checkDefaultValue($data) if ($path) { // Add the lookup path for the rule - \JFormHelper::addRulePath($path); + FormHelper::addRulePath($path); } // Create the fields object @@ -264,7 +266,7 @@ private function checkDefaultValue($data) $node = $dom->appendChild(new \DOMElement('form')); // Trigger the event to create the field dom node - Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($obj, $node, new \JForm($data['context']))); + Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($obj, $node, new Form($data['context']))); // Check if a node is created if (!$node->firstChild) @@ -276,7 +278,7 @@ private function checkDefaultValue($data) $type = $node->firstChild->getAttribute('validate') ? : $data['type']; // Load the rule - $rule = \JFormHelper::loadRuleType($type); + $rule = FormHelper::loadRuleType($type); // When no rule exists, we allow the default value if (!$rule) @@ -933,7 +935,7 @@ protected function loadFormData() * @since 3.7.0 * @throws \Exception if there is an error in the form event. */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { $component = $this->state->get('field.component'); $section = $this->state->get('field.section'); diff --git a/administrator/components/com_finder/Model/StatisticsModel.php b/administrator/components/com_finder/Model/StatisticsModel.php index f7c1e0279d7ca..9c0c21ed59ea8 100644 --- a/administrator/components/com_finder/Model/StatisticsModel.php +++ b/administrator/components/com_finder/Model/StatisticsModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; /** @@ -34,7 +35,7 @@ public function getData() // Initialise $db = $this->getDbo(); $query = $db->getQuery(true); - $data = new \JObject; + $data = new CMSObject; $query->select('COUNT(term_id)') ->from($db->quoteName('#__finder_terms')); diff --git a/administrator/components/com_installer/tmpl/languages/default.php b/administrator/components/com_installer/tmpl/languages/default.php index ac3ae2ff108ac..836c436397df9 100644 --- a/administrator/components/com_installer/tmpl/languages/default.php +++ b/administrator/components/com_installer/tmpl/languages/default.php @@ -13,6 +13,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; +use Joomla\CMS\Version; HTMLHelper::_('behavior.multiselect'); @@ -53,7 +54,7 @@ getShortVersion()); $i = 0; foreach ($this->items as $language) : diff --git a/administrator/components/com_languages/Model/LanguageModel.php b/administrator/components/com_languages/Model/LanguageModel.php index 341eb09081089..40e0eec56bb7d 100644 --- a/administrator/components/com_languages/Model/LanguageModel.php +++ b/administrator/components/com_languages/Model/LanguageModel.php @@ -17,6 +17,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Table; use Joomla\Utilities\ArrayHelper; @@ -124,7 +125,7 @@ public function getItem($langId = null) } $properties = $table->getProperties(1); - $value = ArrayHelper::toObject($properties, 'JObject'); + $value = ArrayHelper::toObject($properties, CMSObject::class); return $value; } diff --git a/administrator/components/com_languages/tmpl/installed/default.php b/administrator/components/com_languages/tmpl/installed/default.php index 93c536f4a40b7..ce18a9180d474 100644 --- a/administrator/components/com_languages/tmpl/installed/default.php +++ b/administrator/components/com_languages/tmpl/installed/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\String\PunycodeHelper; +use Joomla\CMS\Version; $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); @@ -70,7 +71,7 @@ getShortVersion()); foreach ($this->rows as $i => $row) : $canCreate = $user->authorise('core.create', 'com_languages'); diff --git a/administrator/components/com_languages/tmpl/overrides/default.php b/administrator/components/com_languages/tmpl/overrides/default.php index 9eda2ac72f731..60b7e7b0c18b7 100644 --- a/administrator/components/com_languages/tmpl/overrides/default.php +++ b/administrator/components/com_languages/tmpl/overrides/default.php @@ -13,6 +13,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; $client = $this->state->get('filter.client') == 'site' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); @@ -30,7 +31,7 @@
- $this)); ?> + $this)); ?>
items)) : ?>
diff --git a/administrator/components/com_menus/Model/MenuModel.php b/administrator/components/com_menus/Model/MenuModel.php index 6a26a56a08086..7266c2ff4b19f 100644 --- a/administrator/components/com_menus/Model/MenuModel.php +++ b/administrator/components/com_menus/Model/MenuModel.php @@ -14,7 +14,9 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\FormModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Table\Table; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -81,7 +83,7 @@ protected function canEditState($record) */ public function getTable($type = 'MenuType', $prefix = '\JTable', $config = array()) { - return \JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); } /** @@ -138,7 +140,7 @@ public function &getItem($itemId = null) } $properties = $table->getProperties(1); - $value = ArrayHelper::toObject($properties, 'JObject'); + $value = ArrayHelper::toObject($properties, CMSObject::class); return $value; } diff --git a/administrator/components/com_menus/Model/MenutypesModel.php b/administrator/components/com_menus/Model/MenutypesModel.php index 5148e853d16ed..464b756ddadf8 100644 --- a/administrator/components/com_menus/Model/MenutypesModel.php +++ b/administrator/components/com_menus/Model/MenutypesModel.php @@ -15,6 +15,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Object\CMSObject; use Joomla\Component\Menus\Administrator\Helper\MenusHelper; /** @@ -206,7 +207,7 @@ protected function getTypeOptionsFromXml($file, $component) if (!empty($menu['options']) && $menu['options'] == 'none') { // Create the menu option for the component. - $o = new \JObject; + $o = new CMSObject; $o->title = (string) $menu['name']; $o->description = (string) $menu['msg']; $o->request = array('option' => $component); @@ -238,7 +239,7 @@ protected function getTypeOptionsFromXml($file, $component) if ($child->getName() == 'option') { // Create the menu option for the component. - $o = new \JObject; + $o = new CMSObject; $o->title = (string) $child['name']; $o->description = (string) $child['msg']; $o->request = array('option' => $component, (string) $optionsNode['var'] => (string) $child['value']); @@ -248,7 +249,7 @@ protected function getTypeOptionsFromXml($file, $component) elseif ($child->getName() == 'default') { // Create the menu option for the component. - $o = new \JObject; + $o = new CMSObject; $o->title = (string) $child['name']; $o->description = (string) $child['msg']; $o->request = array('option' => $component); @@ -326,7 +327,7 @@ protected function getTypeOptionsFromMvc($component) if ($child->getName() == 'option') { // Create the menu option for the component. - $o = new \JObject; + $o = new CMSObject; $o->title = (string) $child['name']; $o->description = (string) $child['msg']; $o->request = array('option' => $component, 'view' => $view, (string) $optionsNode['var'] => (string) $child['value']); @@ -336,7 +337,7 @@ protected function getTypeOptionsFromMvc($component) elseif ($child->getName() == 'default') { // Create the menu option for the component. - $o = new \JObject; + $o = new CMSObject; $o->title = (string) $child['name']; $o->description = (string) $child['msg']; $o->request = array('option' => $component, 'view' => $view); @@ -446,7 +447,7 @@ protected function getTypeOptionsFromManifest($component) } $o->request = array_filter($request, 'strlen'); - $options[] = new \JObject($o); + $options[] = new CMSObject($o); // Do not repeat the default view link (index.php?option=com_abc). if (count($o->request) == 1) @@ -457,7 +458,7 @@ protected function getTypeOptionsFromManifest($component) if ($ro) { - $options[] = new \JObject($ro); + $options[] = new CMSObject($ro); } return $options; @@ -556,7 +557,7 @@ protected function getTypeOptionsFromLayouts($component, $view) $layout = basename($layout, '.xml'); // Create the menu option for the layout. - $o = new \JObject; + $o = new CMSObject; $o->title = ucfirst($layout); $o->description = ''; $o->request = array('option' => $component, 'view' => $view); diff --git a/administrator/components/com_menus/View/Menutypes/HtmlView.php b/administrator/components/com_menus/View/Menutypes/HtmlView.php index 4277e4d8b25a7..1c88a803f0982 100644 --- a/administrator/components/com_menus/View/Menutypes/HtmlView.php +++ b/administrator/components/com_menus/View/Menutypes/HtmlView.php @@ -14,6 +14,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; @@ -123,28 +124,28 @@ protected function addCustomTypes(&$types) // Adding System Links $list = array(); - $o = new \JObject; + $o = new CMSObject; $o->title = 'COM_MENUS_TYPE_EXTERNAL_URL'; $o->type = 'url'; $o->description = 'COM_MENUS_TYPE_EXTERNAL_URL_DESC'; $o->request = null; $list[] = $o; - $o = new \JObject; + $o = new CMSObject; $o->title = 'COM_MENUS_TYPE_ALIAS'; $o->type = 'alias'; $o->description = 'COM_MENUS_TYPE_ALIAS_DESC'; $o->request = null; $list[] = $o; - $o = new \JObject; + $o = new CMSObject; $o->title = 'COM_MENUS_TYPE_SEPARATOR'; $o->type = 'separator'; $o->description = 'COM_MENUS_TYPE_SEPARATOR_DESC'; $o->request = null; $list[] = $o; - $o = new \JObject; + $o = new CMSObject; $o->title = 'COM_MENUS_TYPE_HEADING'; $o->type = 'heading'; $o->description = 'COM_MENUS_TYPE_HEADING_DESC'; @@ -153,7 +154,7 @@ protected function addCustomTypes(&$types) if ($this->get('state')->get('client_id') == 1) { - $o = new \JObject; + $o = new CMSObject; $o->title = 'COM_MENUS_TYPE_CONTAINER'; $o->type = 'container'; $o->description = 'COM_MENUS_TYPE_CONTAINER_DESC'; diff --git a/administrator/components/com_messages/Model/ConfigModel.php b/administrator/components/com_messages/Model/ConfigModel.php index a3ee60b80034e..ddaeffb86588f 100644 --- a/administrator/components/com_messages/Model/ConfigModel.php +++ b/administrator/components/com_messages/Model/ConfigModel.php @@ -14,6 +14,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\FormModel; +use Joomla\CMS\Object\CMSObject; /** * Message configuration model. @@ -55,7 +56,7 @@ protected function populateState() */ public function &getItem() { - $item = new \JObject; + $item = new CMSObject; $db = $this->getDbo(); $query = $db->getQuery(true) diff --git a/administrator/components/com_modules/Controller/ModuleController.php b/administrator/components/com_modules/Controller/ModuleController.php index 47d51f1e8db71..c777cf57196b9 100644 --- a/administrator/components/com_modules/Controller/ModuleController.php +++ b/administrator/components/com_modules/Controller/ModuleController.php @@ -12,6 +12,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Model\BaseDatabaseModel; @@ -234,7 +235,7 @@ public function save($key = null, $urlVar = null) $this->input->post->set('jform', $data); // Add path of forms directory - \JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms'); + Form::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms'); } return parent::save($key, $urlVar); diff --git a/administrator/components/com_modules/Model/ModuleModel.php b/administrator/components/com_modules/Model/ModuleModel.php index 2d9a3533f382e..af673a4eb583a 100644 --- a/administrator/components/com_modules/Model/ModuleModel.php +++ b/administrator/components/com_modules/Model/ModuleModel.php @@ -15,9 +15,11 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\Table\Table; @@ -545,7 +547,7 @@ public function getForm($data = array(), $loadData = true) // Add the default fields directory $baseFolder = $clientId ? JPATH_ADMINISTRATOR : JPATH_SITE; - \JForm::addFieldPath($baseFolder . '/modules' . '/' . $module . '/field'); + Form::addFieldPath($baseFolder . '/modules' . '/' . $module . '/field'); // These variables are used to add data from the plugin XML files. $this->setState('item.client_id', $clientId); @@ -718,7 +720,7 @@ public function getItem($pk = null) // Convert to the \JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, CMSObject::class); // Convert the params field to an array. $registry = new Registry($table->params); @@ -833,7 +835,7 @@ protected function prepareTable($table) * @since 1.6 * @throws \Exception if there is an error loading the form. */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { $lang = Factory::getLanguage(); $clientId = $this->getState('item.client_id'); @@ -874,7 +876,7 @@ protected function preprocessForm(\JForm $form, $data, $group = 'content') } // Load the default advanced params - \JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms'); + Form::addFormPath(JPATH_ADMINISTRATOR . '/components/com_modules/models/forms'); $form->loadFile('advanced', false); // Trigger the default form events. diff --git a/administrator/components/com_newsfeeds/Model/NewsfeedModel.php b/administrator/components/com_newsfeeds/Model/NewsfeedModel.php index 7feb29271b83d..3f1e9c7aad896 100644 --- a/administrator/components/com_newsfeeds/Model/NewsfeedModel.php +++ b/administrator/components/com_newsfeeds/Model/NewsfeedModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; @@ -394,7 +395,7 @@ protected function getReorderConditions($table) * * @since 1.6 */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { if ($this->canCreateCategory()) { diff --git a/administrator/components/com_plugins/Model/PluginModel.php b/administrator/components/com_plugins/Model/PluginModel.php index 91b256ecedae6..1ba500651ab72 100644 --- a/administrator/components/com_plugins/Model/PluginModel.php +++ b/administrator/components/com_plugins/Model/PluginModel.php @@ -13,9 +13,11 @@ use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Router\Route; use Joomla\CMS\Table\Table; use Joomla\Registry\Registry; @@ -96,7 +98,7 @@ public function getForm($data = array(), $loadData = true) } // Add the default fields directory - \JForm::addFieldPath(JPATH_PLUGINS . '/' . $folder . '/' . $element . '/field'); + Form::addFieldPath(JPATH_PLUGINS . '/' . $folder . '/' . $element . '/field'); // These variables are used to add data from the plugin XML files. $this->setState('item.folder', $folder); @@ -177,7 +179,7 @@ public function getItem($pk = null) // Convert to the \JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, CMSObject::class); // Convert the params field to an array. $registry = new Registry($table->params); @@ -246,7 +248,7 @@ protected function populateState() * @throws \Exception if there is an error in the form event. * @since 1.6 */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { $folder = $this->getState('item.folder'); $element = $this->getState('item.element'); diff --git a/administrator/components/com_privacy/tmpl/capabilities/default.php b/administrator/components/com_privacy/tmpl/capabilities/default.php index 4eaadf703dbac..d99b1379315c1 100644 --- a/administrator/components/com_privacy/tmpl/capabilities/default.php +++ b/administrator/components/com_privacy/tmpl/capabilities/default.php @@ -9,27 +9,30 @@ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; + /** @var PrivacyViewCapabilities $this */ ?>
-

- +

+
capabilities)) : ?>
- +
- 'slide-0')); ?> + 'slide-0')); ?> capabilities as $extension => $capabilities) : ?> - +
- +
    @@ -38,10 +41,10 @@
- + - +
diff --git a/administrator/components/com_privacy/tmpl/consents/default.php b/administrator/components/com_privacy/tmpl/consents/default.php index 9ce8d93ecd3d5..ad534c7fcab78 100644 --- a/administrator/components/com_privacy/tmpl/consents/default.php +++ b/administrator/components/com_privacy/tmpl/consents/default.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Date\Date; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; @@ -21,10 +22,10 @@ HTMLHelper::_('bootstrap.tooltip'); HTMLHelper::_('behavior.multiselect'); -$user = JFactory::getUser(); +$user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -$now = JFactory::getDate(); +$now = Factory::getDate(); $stateIcons = array(-1 => 'trash', 0 => 'archive', 1 => 'publish'); $stateMsgs = array( -1 => Text::_('COM_PRIVACY_CONSENTS_STATE_INVALIDATED'), diff --git a/administrator/components/com_templates/Controller/StyleController.php b/administrator/components/com_templates/Controller/StyleController.php index 3cce8bf6052c6..fd17d79087572 100644 --- a/administrator/components/com_templates/Controller/StyleController.php +++ b/administrator/components/com_templates/Controller/StyleController.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; @@ -72,7 +73,7 @@ public function save($key = null, $urlVar = null) return false; } - \JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_templates/forms'); + Form::addFormPath(JPATH_ADMINISTRATOR . '/components/com_templates/forms'); // Validate the posted data. // Sometimes the form needs some posted data, such as for plugins and modules. diff --git a/administrator/components/com_templates/Helper/TemplatesHelper.php b/administrator/components/com_templates/Helper/TemplatesHelper.php index cbd022b9e55d9..f9d3d43513f42 100644 --- a/administrator/components/com_templates/Helper/TemplatesHelper.php +++ b/administrator/components/com_templates/Helper/TemplatesHelper.php @@ -16,6 +16,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\Text; +use Joomla\CMS\Object\CMSObject; /** * Templates component helper. @@ -103,7 +104,7 @@ public static function getTemplateOptions($clientId = '*') */ public static function parseXMLTemplateFile($templateBaseDir, $templateDir) { - $data = new \JObject; + $data = new CMSObject; // Check of the xml file exists $filePath = Path::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml'); diff --git a/administrator/components/com_templates/Model/StyleModel.php b/administrator/components/com_templates/Model/StyleModel.php index bda0477881cf7..11784a7b7276e 100644 --- a/administrator/components/com_templates/Model/StyleModel.php +++ b/administrator/components/com_templates/Model/StyleModel.php @@ -19,6 +19,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Table; use Joomla\Registry\Registry; @@ -365,7 +366,7 @@ public function getItem($pk = null) // Convert to the \JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, CMSObject::class); // Convert the params field to an array. $registry = new Registry($table->params); diff --git a/administrator/components/com_users/Model/GroupModel.php b/administrator/components/com_users/Model/GroupModel.php index fbf760efa653c..0dec6b39c3efe 100644 --- a/administrator/components/com_users/Model/GroupModel.php +++ b/administrator/components/com_users/Model/GroupModel.php @@ -13,9 +13,11 @@ use Joomla\CMS\Access\Access; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Table; use Joomla\String\StringHelper; @@ -128,9 +130,9 @@ protected function loadFormData() * @since 1.6 * @throws \Exception if there is an error loading the form. */ - protected function preprocessForm(\JForm $form, $data, $group = '') + protected function preprocessForm(Form $form, $data, $group = '') { - $obj = is_array($data) ? ArrayHelper::toObject($data, 'JObject') : $data; + $obj = is_array($data) ? ArrayHelper::toObject($data, CMSObject::class) : $data; if (isset($obj->parent_id) && $obj->parent_id == 0 && $obj->id > 0) { diff --git a/administrator/components/com_users/Model/MailModel.php b/administrator/components/com_users/Model/MailModel.php index bfb3b8301b174..930ddf79ae885 100644 --- a/administrator/components/com_users/Model/MailModel.php +++ b/administrator/components/com_users/Model/MailModel.php @@ -15,6 +15,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filter\InputFilter; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; use Joomla\CMS\MVC\Model\AdminModel; @@ -79,7 +80,7 @@ protected function loadFormData() * @since 1.6 * @throws \Exception if there is an error loading the form. */ - protected function preprocessForm(\JForm $form, $data, $group = 'user') + protected function preprocessForm(Form $form, $data, $group = 'user') { parent::preprocessForm($form, $data, $group); } diff --git a/administrator/components/com_users/Model/UserModel.php b/administrator/components/com_users/Model/UserModel.php index 1535c17a51ee8..3803941a0c964 100644 --- a/administrator/components/com_users/Model/UserModel.php +++ b/administrator/components/com_users/Model/UserModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\Crypt\Crypt; use Joomla\CMS\Encrypt\Aes; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; @@ -204,7 +205,7 @@ protected function loadFormData() * @since 1.6 * @throws \Exception if there is an error in the form event. */ - protected function preprocessForm(\JForm $form, $data, $group = 'user') + protected function preprocessForm(Form $form, $data, $group = 'user') { parent::preprocessForm($form, $data, $group); } diff --git a/administrator/components/com_users/tmpl/group/edit.php b/administrator/components/com_users/tmpl/group/edit.php index dd42bfa68d893..65c969ecd3798 100644 --- a/administrator/components/com_users/tmpl/group/edit.php +++ b/administrator/components/com_users/tmpl/group/edit.php @@ -11,6 +11,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; HTMLHelper::_('behavior.formvalidator'); @@ -23,7 +24,7 @@ form->renderField('parent_id'); ?> ignore_fieldsets = array('group_details'); ?> - + diff --git a/administrator/components/com_workflow/Controller/WorkflowController.php b/administrator/components/com_workflow/Controller/WorkflowController.php index 71727219a0fab..b63a79a6341d8 100644 --- a/administrator/components/com_workflow/Controller/WorkflowController.php +++ b/administrator/components/com_workflow/Controller/WorkflowController.php @@ -15,6 +15,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; /** * Workflow controller @@ -155,7 +156,7 @@ protected function getRedirectToListAppend() * * @since 4.0.0 */ - public function postSaveHook(\JModelLegacy $model, $validData = array()) + public function postSaveHook(BaseDatabaseModel $model, $validData = array()) { $task = $this->getTask(); diff --git a/administrator/components/com_workflow/Helper/WorkflowHelper.php b/administrator/components/com_workflow/Helper/WorkflowHelper.php index 6dc7ec5554bb4..f446dc49ccdb5 100644 --- a/administrator/components/com_workflow/Helper/WorkflowHelper.php +++ b/administrator/components/com_workflow/Helper/WorkflowHelper.php @@ -12,6 +12,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Helper\ContentHelper; /** @@ -52,7 +53,7 @@ public static function addSubmenu($vName) // Loading language file from the administrator/language directory then // loading language file from the administrator/components/*extension*/language directory $lang->load($component, JPATH_BASE, null, false, true) - || $lang->load($component, \JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true); + || $lang->load($component, Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true); call_user_func([$class, 'addSubmenu'], $vName); } diff --git a/administrator/includes/framework.php b/administrator/includes/framework.php index dc0f1f826ae44..100000ee9dd58 100644 --- a/administrator/includes/framework.php +++ b/administrator/includes/framework.php @@ -8,13 +8,15 @@ defined('_JEXEC') or die; +use Joomla\CMS\Version; + // System includes require_once JPATH_LIBRARIES . '/bootstrap.php'; // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) - || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new JVersion)->isInDevelopmentState()))) + || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new Version)->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/administrator/modules/mod_privacy_dashboard/mod_privacy_dashboard.php b/administrator/modules/mod_privacy_dashboard/mod_privacy_dashboard.php index 7320064d409d4..e702ad3fc6cf4 100644 --- a/administrator/modules/mod_privacy_dashboard/mod_privacy_dashboard.php +++ b/administrator/modules/mod_privacy_dashboard/mod_privacy_dashboard.php @@ -9,25 +9,29 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\Helper\ModuleHelper; +use Joomla\CMS\HTML\HTMLHelper; + // Only super user can view this data -if (!JFactory::getUser()->authorise('core.admin')) +if (!Factory::getUser()->authorise('core.admin')) { return; } // Boot component to ensure HTML helpers are loaded -JFactory::getApplication()->bootComponent('com_privacy'); +Factory::getApplication()->bootComponent('com_privacy'); // Load the privacy component language file. -$lang = JFactory::getLanguage(); +$lang = Factory::getLanguage(); $lang->load('com_privacy', JPATH_ADMINISTRATOR, null, false, true) || $lang->load('com_privacy', JPATH_ADMINISTRATOR . '/components/com_privacy', null, false, true); -JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/html'); +HTMLHelper::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_privacy/helpers/html'); JLoader::register('ModPrivacyDashboardHelper', __DIR__ . '/helper.php'); $list = ModPrivacyDashboardHelper::getData(); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); -require JModuleHelper::getLayoutPath('mod_privacy_dashboard', $params->get('layout', 'default')); +require ModuleHelper::getLayoutPath('mod_privacy_dashboard', $params->get('layout', 'default')); diff --git a/administrator/modules/mod_stats_admin/tmpl/default.php b/administrator/modules/mod_stats_admin/tmpl/default.php index b89022aaf77bc..df64d31bfba2f 100644 --- a/administrator/modules/mod_stats_admin/tmpl/default.php +++ b/administrator/modules/mod_stats_admin/tmpl/default.php @@ -9,10 +9,11 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; HTMLHelper::_('jquery.framework'); -JFactory::getDocument()->addScriptDeclaration(' +Factory::getDocument()->addScriptDeclaration(' jQuery(document).ready(function($) { $("a.js-revert").on("click", function(e) { e.preventDefault(); diff --git a/administrator/templates/atum/login.php b/administrator/templates/atum/login.php index 8c5e6bb6d8e93..d3998ea38da88 100644 --- a/administrator/templates/atum/login.php +++ b/administrator/templates/atum/login.php @@ -86,7 +86,7 @@

- +
diff --git a/api/includes/framework.php b/api/includes/framework.php index d55daeb367b41..22dd7274c4040 100644 --- a/api/includes/framework.php +++ b/api/includes/framework.php @@ -8,13 +8,15 @@ defined('_JEXEC') or die; +use Joomla\CMS\Version; + // System includes require_once JPATH_LIBRARIES . '/bootstrap.php'; // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) - || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new JVersion)->isInDevelopmentState()))) + || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new Version)->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/cli/finder_indexer.php b/cli/finder_indexer.php index 4170efcd7ab10..8c38f3cad8788 100644 --- a/cli/finder_indexer.php +++ b/cli/finder_indexer.php @@ -22,6 +22,9 @@ const _JEXEC = 1; use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Plugin\PluginHelper; // Load system defines if (file_exists(dirname(__DIR__) . '/defines.php')) @@ -89,7 +92,7 @@ class FinderCli extends \Joomla\CMS\Application\CliApplication protected function doExecute() { // Print a blank line. - $this->out(JText::_('FINDER_CLI')); + $this->out(Text::_('FINDER_CLI')); $this->out('============================'); // Initialize the time value. @@ -123,8 +126,8 @@ protected function doExecute() } // Total reporting. - $this->out(JText::sprintf('FINDER_CLI_PROCESS_COMPLETE', round(microtime(true) - $this->time, 3)), true); - $this->out(JText::sprintf('FINDER_CLI_PEAK_MEMORY_USAGE', number_format(memory_get_peak_usage(true)))); + $this->out(Text::sprintf('FINDER_CLI_PROCESS_COMPLETE', round(microtime(true) - $this->time, 3)), true); + $this->out(Text::sprintf('FINDER_CLI_PEAK_MEMORY_USAGE', number_format(memory_get_peak_usage(true)))); // Print a blank line at the end. $this->out(); @@ -150,11 +153,11 @@ private function index() FinderIndexer::resetState(); // Import the plugins. - JPluginHelper::importPlugin('system'); - JPluginHelper::importPlugin('finder'); + PluginHelper::importPlugin('system'); + PluginHelper::importPlugin('finder'); // Starting Indexer. - $this->out(JText::_('FINDER_CLI_STARTING_INDEXER'), true); + $this->out(Text::_('FINDER_CLI_STARTING_INDEXER'), true); // Trigger the onStartIndex event. Factory::getApplication()->triggerEvent('onStartIndex'); @@ -166,13 +169,13 @@ private function index() $state = FinderIndexer::getState(); // Setting up plugins. - $this->out(JText::_('FINDER_CLI_SETTING_UP_PLUGINS'), true); + $this->out(Text::_('FINDER_CLI_SETTING_UP_PLUGINS'), true); // Trigger the onBeforeIndex event. Factory::getApplication()->triggerEvent('onBeforeIndex'); // Startup reporting. - $this->out(JText::sprintf('FINDER_CLI_SETUP_ITEMS', $state->totalItems, round(microtime(true) - $this->time, 3)), true); + $this->out(Text::sprintf('FINDER_CLI_SETUP_ITEMS', $state->totalItems, round(microtime(true) - $this->time, 3)), true); // Get the number of batches. $t = (int) $state->totalItems; @@ -194,7 +197,7 @@ private function index() Factory::getApplication()->triggerEvent('onBuildIndex'); // Batch reporting. - $this->out(JText::sprintf('FINDER_CLI_BATCH_COMPLETE', $i + 1, round(microtime(true) - $this->qtime, 3)), true); + $this->out(Text::sprintf('FINDER_CLI_BATCH_COMPLETE', $i + 1, round(microtime(true) - $this->qtime, 3)), true); } } catch (Exception $e) @@ -222,11 +225,11 @@ private function index() */ private function purge() { - $this->out(JText::_('FINDER_CLI_INDEX_PURGE')); + $this->out(Text::_('FINDER_CLI_INDEX_PURGE')); // Load the model. - JModelLegacy::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/models', 'FinderModel'); - $model = JModelLegacy::getInstance('Index', 'FinderModel'); + BaseDatabaseModel::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/models', 'FinderModel'); + $model = BaseDatabaseModel::getInstance('Index', 'FinderModel'); // Attempt to purge the index. $return = $model->purge(); @@ -234,12 +237,12 @@ private function purge() // If unsuccessful then abort. if (!$return) { - $message = JText::_('FINDER_CLI_INDEX_PURGE_FAILED', $model->getError()); + $message = Text::_('FINDER_CLI_INDEX_PURGE_FAILED', $model->getError()); $this->out($message); exit(); } - $this->out(JText::_('FINDER_CLI_INDEX_PURGE_SUCCESS')); + $this->out(Text::_('FINDER_CLI_INDEX_PURGE_SUCCESS')); } /** @@ -254,7 +257,7 @@ private function purge() */ private function putFilters() { - $this->out(JText::_('FINDER_CLI_RESTORE_FILTERS')); + $this->out(Text::_('FINDER_CLI_RESTORE_FILTERS')); $db = Factory::getDbo(); @@ -282,7 +285,7 @@ private function putFilters() } else { - $this->out(JText::sprintf('FINDER_CLI_FILTER_RESTORE_WARNING', $element['parent'], $element['title'], $element['filter'])); + $this->out(Text::sprintf('FINDER_CLI_FILTER_RESTORE_WARNING', $element['parent'], $element['title'], $element['filter'])); } } @@ -298,7 +301,7 @@ private function putFilters() $db->setQuery($query)->execute(); } - $this->out(JText::sprintf('FINDER_CLI_RESTORE_FILTER_COMPLETED', count($this->filters))); + $this->out(Text::sprintf('FINDER_CLI_RESTORE_FILTER_COMPLETED', count($this->filters))); } /** @@ -315,7 +318,7 @@ private function putFilters() */ private function getFilters() { - $this->out(JText::_('FINDER_CLI_SAVE_FILTERS')); + $this->out(Text::_('FINDER_CLI_SAVE_FILTERS')); // Get the taxonomy ids used by the filters. $db = Factory::getDbo(); @@ -354,7 +357,7 @@ private function getFilters() } } - $this->out(JText::sprintf('FINDER_CLI_SAVE_FILTER_COMPLETED', count($filters))); + $this->out(Text::sprintf('FINDER_CLI_SAVE_FILTER_COMPLETED', count($filters))); } } diff --git a/components/com_content/tmpl/category/default_articles.php b/components/com_content/tmpl/category/default_articles.php index 79b75d9ae009e..1ef15d5a5bcfd 100644 --- a/components/com_content/tmpl/category/default_articles.php +++ b/components/com_content/tmpl/category/default_articles.php @@ -35,7 +35,7 @@ switch ($tagfilter) { case 'current_language' : - $langFilter = JFactory::getApplication()->getLanguage()->getTag(); + $langFilter = Factory::getApplication()->getLanguage()->getTag(); break; case 'all' : diff --git a/components/com_finder/Controller/DisplayController.php b/components/com_finder/Controller/DisplayController.php index c315e667dbe3e..70d8d3355d3c9 100644 --- a/components/com_finder/Controller/DisplayController.php +++ b/components/com_finder/Controller/DisplayController.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\Component\Finder\Administrator\Helper\FinderHelperLanguage; @@ -34,7 +35,7 @@ class DisplayController extends BaseController */ public function display($cachable = false, $urlparams = array()) { - $input = \JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $cachable = true; // Load plugin language files. diff --git a/components/com_finder/Helper/FinderHelper.php b/components/com_finder/Helper/FinderHelper.php index 95d058534e080..511e4665d164e 100644 --- a/components/com_finder/Helper/FinderHelper.php +++ b/components/com_finder/Helper/FinderHelper.php @@ -12,6 +12,7 @@ defined('JPATH_PLATFORM') or die; use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Factory; /** * Helper class for Joomla! Finder components @@ -45,7 +46,7 @@ public static function logSearch(\FinderIndexerQuery $searchquery, $resultCount } // Initialise our variables - $db = \JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); // Sanitise the term for the database diff --git a/components/com_finder/Model/SearchModel.php b/components/com_finder/Model/SearchModel.php index 70842fb018c49..e41b5fe798e4b 100644 --- a/components/com_finder/Model/SearchModel.php +++ b/components/com_finder/Model/SearchModel.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\MVC\Model\ListModel; use Joomla\String\StringHelper; @@ -129,7 +130,7 @@ public function getQuery() protected function getListQuery() { // Get the current user for authorisation checks - $user = \JFactory::getUser(); + $user = Factory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Create a new query object. @@ -152,7 +153,7 @@ protected function getListQuery() // Get the null date and the current date, minus seconds. $nullDate = $db->quote($db->getNullDate()); - $nowDate = $db->quote(substr_replace(\JFactory::getDate()->toSql(), '00', -2)); + $nowDate = $db->quote(substr_replace(Factory::getDate()->toSql(), '00', -2)); // Add the publish up and publish down filters. $query->where('(l.publish_start_date = ' . $nullDate . ' OR l.publish_start_date <= ' . $nowDate . ')') @@ -228,7 +229,7 @@ protected function getListQuery() // Filter by language if ($this->getState('filter.language')) { - $query->where('l.language IN (' . $db->quote(\JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); + $query->where('l.language IN (' . $db->quote(Factory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } // Get the result ordering and direction. @@ -382,11 +383,11 @@ protected function getStoreId($id = '', $page = true) protected function populateState($ordering = null, $direction = null) { // Get the configuration options. - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; $params = $app->getParams(); - $user = \JFactory::getUser(); - $language = \JFactory::getLanguage(); + $user = Factory::getUser(); + $language = Factory::getLanguage(); $this->setState('filter.language', Multilanguage::isEnabled()); @@ -513,7 +514,7 @@ protected function retrieve($id, $persistent = true) // Use the external cache if data is persistent. if ($persistent) { - $data = \JFactory::getCache($this->context, 'output')->get($id); + $data = Factory::getCache($this->context, 'output')->get($id); $data = $data ? unserialize($data) : null; } @@ -545,7 +546,7 @@ protected function store($id, $data, $persistent = true) // Store the data in external cache if data is persistent. if ($persistent) { - return \JFactory::getCache($this->context, 'output')->store(serialize($data), $id); + return Factory::getCache($this->context, 'output')->store(serialize($data), $id); } return true; diff --git a/components/com_finder/Model/SuggestionsModel.php b/components/com_finder/Model/SuggestionsModel.php index 9f6ad04e17a6d..41aa780c98f01 100644 --- a/components/com_finder/Model/SuggestionsModel.php +++ b/components/com_finder/Model/SuggestionsModel.php @@ -12,6 +12,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Factory; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\MVC\Model\ListModel; @@ -119,10 +120,10 @@ protected function getStoreId($id = '') protected function populateState($ordering = null, $direction = null) { // Get the configuration options. - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; $params = ComponentHelper::getParams('com_finder'); - $user = \JFactory::getUser(); + $user = Factory::getUser(); // Get the query input. $this->setState('input', $input->request->get('q', '', 'string')); @@ -130,7 +131,7 @@ protected function populateState($ordering = null, $direction = null) // Set the query language if (Multilanguage::isEnabled()) { - $lang = \JFactory::getLanguage()->getTag(); + $lang = Factory::getLanguage()->getTag(); } else { diff --git a/components/com_finder/View/Search/FeedView.php b/components/com_finder/View/Search/FeedView.php index 401f4cd499a09..64ae9407fb8ec 100644 --- a/components/com_finder/View/Search/FeedView.php +++ b/components/com_finder/View/Search/FeedView.php @@ -11,7 +11,9 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Router\Route; @@ -34,7 +36,7 @@ class FeedView extends BaseHtmlView public function display($tpl = null) { // Get the application - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); // Adjust the list limit to the feed limit. $app->input->set('limit', $app->get('feed_limit')); @@ -59,11 +61,11 @@ public function display($tpl = null) } elseif ($app->get('sitename_pagetitles', 0) == 1) { - $title = \JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); + $title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { - $title = \JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); + $title = Text::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); diff --git a/components/com_finder/View/Search/HtmlView.php b/components/com_finder/View/Search/HtmlView.php index ce41d7019df35..cc8b64558a51b 100644 --- a/components/com_finder/View/Search/HtmlView.php +++ b/components/com_finder/View/Search/HtmlView.php @@ -219,7 +219,7 @@ protected function getFields() $fields = null; // Get the URI. - $uri = \JUri::getInstance(Route::_($this->query->toUri())); + $uri = Uri::getInstance(Route::_($this->query->toUri())); $uri->delVar('q'); $uri->delVar('o'); $uri->delVar('t'); @@ -286,7 +286,7 @@ protected function prepareDocument($query) } else { - $this->params->def('page_heading', \JText::_('COM_FINDER_DEFAULT_PAGE_TITLE')); + $this->params->def('page_heading', Text::_('COM_FINDER_DEFAULT_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); @@ -297,11 +297,11 @@ protected function prepareDocument($query) } elseif ($app->get('sitename_pagetitles', 0) == 1) { - $title = \JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); + $title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { - $title = \JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); + $title = Text::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); diff --git a/components/com_finder/View/Search/OpensearchView.php b/components/com_finder/View/Search/OpensearchView.php index 5e74916660bce..57ee00ac3a9d5 100644 --- a/components/com_finder/View/Search/OpensearchView.php +++ b/components/com_finder/View/Search/OpensearchView.php @@ -16,6 +16,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\MVC\View\AbstractView; use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; /** * OpenSearch View class for Finder @@ -51,7 +52,7 @@ public function display($tpl = null) // Add the URL for the search $searchUri = 'index.php?option=com_finder&view=search&q={searchTerms}'; $suggestionsUri = 'index.php?option=com_finder&task=suggestions.opensearchsuggest&format=json&q={searchTerms}'; - $baseUrl = \JUri::getInstance()->toString(array('host', 'port', 'scheme')); + $baseUrl = Uri::getInstance()->toString(array('host', 'port', 'scheme')); $active = $app->getMenu()->getActive(); if ($active->component == 'com_finder') diff --git a/components/com_finder/helpers/route.php b/components/com_finder/helpers/route.php index ab30d004b44ec..f9315cd5496cd 100644 --- a/components/com_finder/helpers/route.php +++ b/components/com_finder/helpers/route.php @@ -9,6 +9,10 @@ defined('_JEXEC') or die; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Uri\Uri; + /** * Finder route helper class. * @@ -33,7 +37,7 @@ public static function getSearchRoute($f = null, $q = null) $item = self::getItemid($query); // Get the base route. - $uri = clone JUri::getInstance('index.php?option=com_finder&view=search'); + $uri = clone Uri::getInstance('index.php?option=com_finder&view=search'); // Add the pre-defined search filter if present. if ($f !== null) @@ -73,7 +77,7 @@ public static function getAdvancedRoute($f = null, $q = null) $item = self::getItemid($query); // Get the base route. - $uri = clone JUri::getInstance('index.php?option=com_finder&view=advanced'); + $uri = clone Uri::getInstance('index.php?option=com_finder&view=advanced'); // Add the pre-defined search filter if present. if ($q !== null) @@ -113,8 +117,8 @@ public static function getItemid($query) // Get the menu items for com_finder. if (!$items || !$active) { - $app = JFactory::getApplication(); - $com = JComponentHelper::getComponent('com_finder'); + $app = Factory::getApplication(); + $com = ComponentHelper::getComponent('com_finder'); $menu = $app->getMenu(); $active = $menu->getActive(); $items = $menu->getItems('component_id', $com->id); diff --git a/components/com_finder/tmpl/search/default.php b/components/com_finder/tmpl/search/default.php index 486e68a28a051..8559a77c41ecd 100644 --- a/components/com_finder/tmpl/search/default.php +++ b/components/com_finder/tmpl/search/default.php @@ -10,11 +10,12 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; HTMLHelper::_('behavior.core'); HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html'); -JText::script('MOD_FINDER_SEARCH_VALUE', true); +Text::script('MOD_FINDER_SEARCH_VALUE', true); HTMLHelper::_('stylesheet', 'com_finder/finder.css', array('version' => 'auto', 'relative' => true)); HTMLHelper::_('script', 'com_finder/finder.js', array('version' => 'auto', 'relative' => true)); diff --git a/components/com_finder/tmpl/search/default_result.php b/components/com_finder/tmpl/search/default_result.php index 7166902e500eb..d20043af3366f 100644 --- a/components/com_finder/tmpl/search/default_result.php +++ b/components/com_finder/tmpl/search/default_result.php @@ -9,11 +9,13 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\String\StringHelper; -$user = JFactory::getUser(); +$user = Factory::getUser(); // Get the mime type class. $mime = !empty($this->result->mime) ? 'mime-' . $this->result->mime : null; @@ -91,7 +93,7 @@ result->start_date && $this->params->get('show_date', 1)) : ?>
- result->start_date, \JText::_('DATE_FORMAT_LC3')); ?> + result->start_date, Text::_('DATE_FORMAT_LC3')); ?>
params->get('show_url', 1)) : ?> diff --git a/components/com_finder/tmpl/search/default_results.php b/components/com_finder/tmpl/search/default_results.php index 857438d7462c7..56d4a850f7770 100644 --- a/components/com_finder/tmpl/search/default_results.php +++ b/components/com_finder/tmpl/search/default_results.php @@ -9,9 +9,11 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; ?> @@ -20,7 +22,7 @@ suggested && $this->params->get('show_suggested_query', 1)) : ?> - query->toUri()); ?> + query->toUri()); ?> setVar('q', $this->suggested); ?> toString(array('path', 'query'))); ?> @@ -35,9 +37,9 @@ total === 0) || ($this->total === null)) : ?>
-

- getLanguageFilter() ? '_MULTILANG' : ''; ?> -

escape($this->query->input)); ?>

+

+ getLanguageFilter() ? '_MULTILANG' : ''; ?> +

escape($this->query->input)); ?>

@@ -49,7 +51,7 @@
- baseUrl = JUri::getInstance()->toString(array('scheme', 'host', 'port')); ?> + baseUrl = Uri::getInstance()->toString(array('scheme', 'host', 'port')); ?> results as $i => $result) : ?> result = &$result; ?> result->counter = $i + 1; ?> @@ -69,6 +71,6 @@ pagination->total; ?> pagination->limit * $this->pagination->pagesCurrent; ?> $total ? $total : $limit); ?> - +
diff --git a/components/com_privacy/View/Confirm/HtmlView.php b/components/com_privacy/View/Confirm/HtmlView.php index 14f5596967782..2a1e6d575fc43 100644 --- a/components/com_privacy/View/Confirm/HtmlView.php +++ b/components/com_privacy/View/Confirm/HtmlView.php @@ -112,7 +112,7 @@ protected function prepareDocument() } else { - $this->params->def('page_heading', JText::_('COM_PRIVACY_VIEW_CONFIRM_PAGE_TITLE')); + $this->params->def('page_heading', Text::_('COM_PRIVACY_VIEW_CONFIRM_PAGE_TITLE')); } $title = $this->params->get('page_title', ''); diff --git a/components/com_privacy/tmpl/confirm/default.php b/components/com_privacy/tmpl/confirm/default.php index 182e9915300a5..b48226c0eaded 100644 --- a/components/com_privacy/tmpl/confirm/default.php +++ b/components/com_privacy/tmpl/confirm/default.php @@ -9,10 +9,14 @@ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + /** @var PrivacyViewConfirm $this */ -JHtml::_('behavior.keepalive'); -JHtml::_('behavior.formvalidator'); +HTMLHelper::_('behavior.keepalive'); +HTMLHelper::_('behavior.formvalidator'); ?>
@@ -23,11 +27,11 @@
- + form->getFieldsets() as $fieldset) : ?>
label)) : ?> - label); ?> + label); ?> form->renderFieldset($fieldset->name); ?>
@@ -35,10 +39,10 @@
- +
diff --git a/components/com_privacy/tmpl/remind/default.php b/components/com_privacy/tmpl/remind/default.php index e7e6189f13014..75a8e28cd1b55 100644 --- a/components/com_privacy/tmpl/remind/default.php +++ b/components/com_privacy/tmpl/remind/default.php @@ -9,10 +9,14 @@ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + /** @var PrivacyViewConfirm $this */ -JHtml::_('behavior.keepalive'); -JHtml::_('behavior.formvalidator'); +HTMLHelper::_('behavior.keepalive'); +HTMLHelper::_('behavior.formvalidator'); ?>
@@ -23,11 +27,11 @@
-
+ form->getFieldsets() as $fieldset) : ?>
label)) : ?> - label); ?> + label); ?> form->renderFieldset($fieldset->name); ?>
@@ -35,10 +39,10 @@
- +
diff --git a/components/com_privacy/tmpl/request/default.php b/components/com_privacy/tmpl/request/default.php index a89d2ed3c0bed..cd9e1ce54c80a 100644 --- a/components/com_privacy/tmpl/request/default.php +++ b/components/com_privacy/tmpl/request/default.php @@ -9,11 +9,15 @@ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + /** @var PrivacyViewRequest $this */ -JHtml::_('behavior.keepalive'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); +HTMLHelper::_('behavior.keepalive'); +HTMLHelper::_('behavior.formvalidator'); +HTMLHelper::_('formbehavior.chosen', 'select'); ?>
@@ -25,11 +29,11 @@
sendMailEnabled) : ?> -
+ form->getFieldsets() as $fieldset) : ?>
label)) : ?> - label); ?> + label); ?> form->renderFieldset($fieldset->name); ?>
@@ -37,15 +41,15 @@
- +
-

+

diff --git a/includes/framework.php b/includes/framework.php index 7ff7f61043e56..92102a70c3f05 100644 --- a/includes/framework.php +++ b/includes/framework.php @@ -8,13 +8,15 @@ defined('_JEXEC') or die; +use Joomla\CMS\Version; + // System includes require_once JPATH_LIBRARIES . '/bootstrap.php'; // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) - || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new JVersion)->isInDevelopmentState()))) + || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new Version)->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/installation/src/Model/ChecksModel.php b/installation/src/Model/ChecksModel.php index fdb33468a1dc7..a4a0dd75f9742 100644 --- a/installation/src/Model/ChecksModel.php +++ b/installation/src/Model/ChecksModel.php @@ -14,6 +14,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; +use Joomla\Database\DatabaseDriver; /** * Checks model for the Joomla Core Installer. @@ -82,7 +83,7 @@ public function getPhpOptions() // Check for database support. // We are satisfied if there is at least one database driver available. - $available = \JDatabaseDriver::getConnectors(); + $available = DatabaseDriver::getConnectors(); $option = new \stdClass; $option->label = Text::_('INSTL_DATABASE_SUPPORT'); $option->label .= '
(' . implode(', ', $available) . ')'; diff --git a/installation/src/Model/DatabaseModel.php b/installation/src/Model/DatabaseModel.php index 53fa5517fe0fb..4274f300c28c2 100644 --- a/installation/src/Model/DatabaseModel.php +++ b/installation/src/Model/DatabaseModel.php @@ -19,6 +19,7 @@ use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; +use Joomla\Database\DatabaseDriver; use Joomla\Database\DatabaseInterface; use Joomla\Database\UTF8MB4SupportInterface; use Joomla\Utilities\ArrayHelper; @@ -367,7 +368,7 @@ public function createDatabase($options) 'select' => $options->db_select, ); - $altDB = \JDatabaseDriver::getInstance($altDBoptions); + $altDB = DatabaseDriver::getInstance($altDBoptions); // Try to create the database now using the alternate driver try diff --git a/installation/template/index.php b/installation/template/index.php index 212389893a704..a18fbb63608b8 100644 --- a/installation/template/index.php +++ b/installation/template/index.php @@ -11,6 +11,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; /** @var JDocumentHtml $this */ @@ -52,7 +53,7 @@ - +
- @@ -215,8 +216,8 @@ class="btn btn-primary"

- - + +
diff --git a/libraries/cms/html/content.php b/libraries/cms/html/content.php index 843e9a8280e91..eac9492a71e7c 100644 --- a/libraries/cms/html/content.php +++ b/libraries/cms/html/content.php @@ -11,6 +11,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; @@ -58,7 +59,7 @@ public static function prepare($text, $params = null, $context = 'text') */ public static function months($state) { - $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); + $model = BaseDatabaseModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); foreach ($state as $key => $value) { diff --git a/libraries/cms/html/debug.php b/libraries/cms/html/debug.php index 897c9f0e7f02f..b230daa76e7db 100644 --- a/libraries/cms/html/debug.php +++ b/libraries/cms/html/debug.php @@ -9,6 +9,7 @@ defined('JPATH_PLATFORM') or die; +use Joomla\CMS\Filesystem\Path; use Joomla\CMS\HTML\HTMLHelper; /** @@ -50,7 +51,7 @@ public static function xdebuglink($file, $line = '') static::$xdebugLinkFormat = ini_get('xdebug.file_link_format'); } - $link = str_replace(JPATH_ROOT, 'JROOT', JPath::clean($file)); + $link = str_replace(JPATH_ROOT, 'JROOT', Path::clean($file)); $link .= $line ? ':' . $line : ''; if (static::$xdebugLinkFormat) diff --git a/libraries/cms/html/uitab.php b/libraries/cms/html/uitab.php index caa30eaf7d28a..8d99731c55317 100644 --- a/libraries/cms/html/uitab.php +++ b/libraries/cms/html/uitab.php @@ -9,6 +9,8 @@ defined('JPATH_PLATFORM') or die; +use Joomla\CMS\HTML\HTMLHelper; + /** * Utility class for the Joomla core UI Tab element. * @@ -39,7 +41,7 @@ public static function startTabSet($selector = 'myTab', $params = array()) if (!isset(static::$loaded[__METHOD__][$sig])) { // Include the custom element - JHtml::_('webcomponent', 'vendor/joomla-custom-elements/joomla-tab.min.js', ['version' => 'auto', 'relative' => true]); + HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-tab.min.js', ['version' => 'auto', 'relative' => true]); // Setup options object $opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : ''; diff --git a/libraries/cms/html/user.php b/libraries/cms/html/user.php index aac2d665aaa15..7558dd6a2573f 100644 --- a/libraries/cms/html/user.php +++ b/libraries/cms/html/user.php @@ -11,6 +11,7 @@ use Joomla\CMS\Access\Access; use Joomla\CMS\Factory; +use Joomla\CMS\Helper\UserGroupsHelper; use Joomla\CMS\HTML\HTMLHelper; /** @@ -31,7 +32,7 @@ abstract class JHtmlUser */ public static function groups($includeSuperAdmin = false) { - $options = array_values(JHelperUsergroups::getInstance()->getAll()); + $options = array_values(UserGroupsHelper::getInstance()->getAll()); for ($i = 0, $n = count($options); $i < $n; $i++) { diff --git a/libraries/joomla/view/html.php b/libraries/joomla/view/html.php index e6df6f5ae9015..4339660021fca 100644 --- a/libraries/joomla/view/html.php +++ b/libraries/joomla/view/html.php @@ -9,6 +9,8 @@ defined('JPATH_PLATFORM') or die; +use Joomla\CMS\Filesystem\Path; + /** * Joomla Platform HTML View Class * @@ -103,10 +105,10 @@ public function getLayout() public function getPath($layout) { // Get the layout file name. - $file = JPath::clean($layout . '.php'); + $file = Path::clean($layout . '.php'); // Find the layout file path. - $path = JPath::find(clone $this->paths, $file); + $path = Path::find(clone $this->paths, $file); return $path; } diff --git a/libraries/src/Application/ApiApplication.php b/libraries/src/Application/ApiApplication.php index 24240c7d1ed94..75bfb73d700c4 100644 --- a/libraries/src/Application/ApiApplication.php +++ b/libraries/src/Application/ApiApplication.php @@ -12,12 +12,14 @@ use Joomla\Application\Web\WebClient; use Joomla\CMS\Access\Exception\AuthenticationFailed; -use Joomla\CMS\Router\Exception\RouteNotFoundException; -use Joomla\CMS\Plugin\PluginHelper; -use Joomla\Input\Json as JInputJson; use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\ApiRouter; +use Joomla\CMS\Router\Exception\RouteNotFoundException; +use Joomla\CMS\Uri\Uri; use Joomla\DI\Container; +use Joomla\Input\Json as JInputJson; use Joomla\Registry\Registry; use Negotiation\Accept; use Negotiation\Exception\InvalidArgument; @@ -77,7 +79,7 @@ public function __construct(JInputJson $input = null, Registry $config = null, W $this->addFormatMap('application/vnd.api+json', 'jsonapi'); // Set the root in the URI based on the application name - \JUri::root(null, str_ireplace('/' . $this->getName(), '', \JUri::base(true))); + Uri::root(null, str_ireplace('/' . $this->getName(), '', Uri::base(true))); } @@ -323,10 +325,10 @@ public function dispatch($component = null) $this->loadDocument(); // Set up the params - $document = \JFactory::getDocument(); + $document = Factory::getDocument(); - // Register the document object with \JFactory - \JFactory::$document = $document; + // Register the document object with Factory + Factory::$document = $document; $contents = ComponentHelper::renderComponent($component); $document->setBuffer($contents, 'component'); diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php index b14e4b5306255..6dad24cae2ec7 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -1010,14 +1010,14 @@ protected function route() if ($item !== null) { - $oldUri = clone \JUri::getInstance(); + $oldUri = clone Uri::getInstance(); if ($oldUri->getVar('Itemid') == $active->id) { $oldUri->setVar('Itemid', $item->id); } - $base = \JUri::base(true); + $base = Uri::base(true); $oldPath = StringHelper::strtolower(substr($oldUri->getPath(), strlen($base) + 1)); $activePathPrefix = StringHelper::strtolower($active->route); diff --git a/libraries/src/Document/Renderer/Feed/AtomRenderer.php b/libraries/src/Document/Renderer/Feed/AtomRenderer.php index b169d6a58c244..ce0e7a4cc0fc9 100644 --- a/libraries/src/Document/Renderer/Feed/AtomRenderer.php +++ b/libraries/src/Document/Renderer/Feed/AtomRenderer.php @@ -15,6 +15,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Version; /** * AtomRenderer is a feed that implements the atom specification @@ -124,7 +125,7 @@ public function render($name = '', $params = null, $content = null) if ($app->get('MetaVersion', 0)) { - $minorVersion = \JVersion::MAJOR_VERSION . '.' . \JVersion::MINOR_VERSION; + $minorVersion = Version::MAJOR_VERSION . '.' . Version::MINOR_VERSION; $versionHtmlEscaped = ' version="' . htmlspecialchars($minorVersion, ENT_COMPAT, 'UTF-8') . '"'; } diff --git a/libraries/src/Document/Renderer/Html/ModuleRenderer.php b/libraries/src/Document/Renderer/Html/ModuleRenderer.php index 4ad2e6003b283..642b5647f5237 100644 --- a/libraries/src/Document/Renderer/Html/ModuleRenderer.php +++ b/libraries/src/Document/Renderer/Html/ModuleRenderer.php @@ -87,7 +87,7 @@ public function render($module, $attribs = array(), $content = null) // Default to itemid creating method and workarounds on $cacheparams = new \stdClass; $cacheparams->cachemode = $cachemode; - $cacheparams->class = 'JModuleHelper'; + $cacheparams->class = 'ModuleHelper'; $cacheparams->method = 'renderModule'; $cacheparams->methodparams = array($module, $attribs); diff --git a/libraries/src/Editor/Editor.php b/libraries/src/Editor/Editor.php index 386a366b16bb8..a988b47604778 100644 --- a/libraries/src/Editor/Editor.php +++ b/libraries/src/Editor/Editor.php @@ -14,6 +14,7 @@ use Joomla\CMS\Filter\InputFilter; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; +use Joomla\CMS\Plugin\PluginHelper; use Joomla\Event\AbstractEvent; use Joomla\Event\DispatcherAwareInterface; use Joomla\Event\DispatcherAwareTrait; @@ -222,7 +223,7 @@ public function getButtons($editor, $buttons = true) } // Get plugins - $plugins = \JPluginHelper::getPlugin('editors-xtd'); + $plugins = PluginHelper::getPlugin('editors-xtd'); foreach ($plugins as $plugin) { @@ -231,7 +232,7 @@ public function getButtons($editor, $buttons = true) continue; } - \JPluginHelper::importPlugin('editors-xtd', $plugin->name, false); + PluginHelper::importPlugin('editors-xtd', $plugin->name, false); $className = 'PlgEditorsXtd' . $plugin->name; if (!class_exists($className)) @@ -302,7 +303,7 @@ protected function _loadEditor($config = array()) require_once $path; // Get the plugin - $plugin = \JPluginHelper::getPlugin('editors', $this->_name); + $plugin = PluginHelper::getPlugin('editors', $this->_name); // If no plugin is published we get an empty array and there not so much to do with it if (empty($plugin)) @@ -323,7 +324,7 @@ protected function _loadEditor($config = array()) { // Load plugin parameters $this->initialise(); - \JPluginHelper::importPlugin('editors-xtd'); + PluginHelper::importPlugin('editors-xtd'); } } } diff --git a/libraries/src/Factory.php b/libraries/src/Factory.php index 274eaa46ceeb3..a73ce90c64e4e 100644 --- a/libraries/src/Factory.php +++ b/libraries/src/Factory.php @@ -13,6 +13,7 @@ use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Cache\Cache; use Joomla\CMS\Cache\CacheControllerFactoryInterface; +use Joomla\CMS\Client\ClientHelper; use Joomla\CMS\Date\Date; use Joomla\CMS\Document\Document; use Joomla\CMS\Document\FactoryInterface; @@ -840,8 +841,8 @@ public static function getStream($use_prefix = true, $use_network = true, $ua = if ($use_prefix) { - $FTPOptions = \JClientHelper::getCredentials('ftp'); - $SCPOptions = \JClientHelper::getCredentials('scp'); + $FTPOptions = ClientHelper::getCredentials('ftp'); + $SCPOptions = ClientHelper::getCredentials('scp'); if ($FTPOptions['enabled'] == 1 && $use_network) { diff --git a/libraries/src/Form/Field/CaptchaField.php b/libraries/src/Form/Field/CaptchaField.php index b1d6ad0139f96..16ed02ce74cdb 100644 --- a/libraries/src/Form/Field/CaptchaField.php +++ b/libraries/src/Form/Field/CaptchaField.php @@ -148,7 +148,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) catch (\RuntimeException $e) { $this->_captcha = null; - \JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); + Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return false; } @@ -176,7 +176,7 @@ protected function getInput() } catch (\RuntimeException $e) { - \JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); + Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); } return ''; } diff --git a/libraries/src/Help/Help.php b/libraries/src/Help/Help.php index c61b2b5032daa..b8f5dfddc3c3f 100644 --- a/libraries/src/Help/Help.php +++ b/libraries/src/Help/Help.php @@ -14,6 +14,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; +use Joomla\CMS\Version; /** * Help system class @@ -98,7 +99,7 @@ public static function createUrl($ref, $useComponent = false, $override = null, * Replace substitution codes in the URL. */ $lang = Factory::getLanguage(); - $version = new \JVersion; + $version = new Version; $jver = explode('.', $version->getShortVersion()); $jlang = explode('-', $lang->getTag()); diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 49aace42e92d1..ce11a0449aa2c 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -322,7 +322,7 @@ public function _($string, $jsSafe = false, $interpretBackSlashes = true) // Store debug information if ($this->debug) { - $value = \JFactory::getApplication()->get('debug_lang_const') == 0 ? $key : $string; + $value = Factory::getApplication()->get('debug_lang_const') == 0 ? $key : $string; $string = '**' . $value . '**'; $caller = $this->getCallerInfo(); diff --git a/libraries/src/Layout/FileLayout.php b/libraries/src/Layout/FileLayout.php index 1c9cfc3b58887..6ecb48c675c59 100644 --- a/libraries/src/Layout/FileLayout.php +++ b/libraries/src/Layout/FileLayout.php @@ -14,6 +14,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\Path; +use Joomla\CMS\Version; /** * Base class for rendering a display layout @@ -355,7 +356,7 @@ public function loadLanguageSuffixes() */ public function loadVersionSuffixes() { - $cmsVersion = new \JVersion; + $cmsVersion = new Version; // Example j311 $fullVersion = 'j' . str_replace('.', '', $cmsVersion->getShortVersion()); diff --git a/libraries/src/Log/Logger/FormattedtextLogger.php b/libraries/src/Log/Logger/FormattedtextLogger.php index 0bb896fbe478a..d4d85d751bf78 100644 --- a/libraries/src/Log/Logger/FormattedtextLogger.php +++ b/libraries/src/Log/Logger/FormattedtextLogger.php @@ -15,6 +15,7 @@ use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Log\LogEntry; use Joomla\CMS\Log\Logger; +use Joomla\CMS\Version; /** * Joomla! Formatted Text File Log class @@ -254,7 +255,7 @@ protected function generateFileHeader() } $head[] = '#Date: ' . gmdate('Y-m-d H:i:s') . ' UTC'; - $head[] = '#Software: ' . (new \JVersion)->getLongVersion(); + $head[] = '#Software: ' . (new Version)->getLongVersion(); $head[] = ''; // Prepare the fields string diff --git a/libraries/src/MVC/Controller/FormController.php b/libraries/src/MVC/Controller/FormController.php index f25701b620707..82cb6963641f8 100644 --- a/libraries/src/MVC/Controller/FormController.php +++ b/libraries/src/MVC/Controller/FormController.php @@ -336,7 +336,7 @@ public function cancel($key = null) // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - if (!is_null($return) && \JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $url = base64_decode($return); } @@ -938,7 +938,7 @@ public function reload($key = null, $urlVar = null) public function editAssociations() { // Initialise variables. - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; $model = $this->getModel(); diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index 90ddfc2f49113..136ee9bf97072 100644 --- a/libraries/src/MVC/Model/AdminModel.php +++ b/libraries/src/MVC/Model/AdminModel.php @@ -18,8 +18,10 @@ use Joomla\CMS\Log\Log; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\Table\Table; +use Joomla\CMS\UCM\UCMType; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; @@ -812,7 +814,7 @@ public function delete(&$pks) $table = $this->getTable(); // Include the plugins for the delete events. - \JPluginHelper::importPlugin($this->events_map['delete']); + PluginHelper::importPlugin($this->events_map['delete']); // Iterate the items to delete each one. foreach ($pks as $i => $pk) @@ -1043,7 +1045,7 @@ public function publish(&$pks, $value = 1) $context = $this->option . '.' . $this->name; // Include the plugins for the change of state event. - \JPluginHelper::importPlugin($this->events_map['change_state']); + PluginHelper::importPlugin($this->events_map['change_state']); // Access checks. foreach ($pks as $i => $pk) @@ -1223,7 +1225,7 @@ public function save($data) $isNew = true; // Include the plugins for the save events. - \JPluginHelper::importPlugin($this->events_map['save']); + PluginHelper::importPlugin($this->events_map['save']); // Allow an exception to be thrown. try @@ -1552,7 +1554,7 @@ public function initBatch() $this->tableClassName = end($tc); // Get UCM Type data - $this->contentType = new \JUcmType; + $this->contentType = new UCMType; $this->type = $this->contentType->getTypeByTable($this->tableClassName) ?: $this->contentType->getTypeByAlias($this->typeAlias); } @@ -1572,7 +1574,7 @@ public function editAssociations($data) // Save the item $this->save($data); - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); $id = $data['id']; // Deal with categories associations diff --git a/libraries/src/MVC/Model/LeagcyModelLoaderTrait.php b/libraries/src/MVC/Model/LeagcyModelLoaderTrait.php index b5c59e04d816a..40d6aaa24ff7e 100644 --- a/libraries/src/MVC/Model/LeagcyModelLoaderTrait.php +++ b/libraries/src/MVC/Model/LeagcyModelLoaderTrait.php @@ -10,8 +10,10 @@ defined('JPATH_PLATFORM') or die; +use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; +use Joomla\CMS\Table\Table; /** * Trait which contains the legacy getInstance functionality @@ -58,12 +60,12 @@ public static function addIncludePath($path = '', $prefix = '') { if (!in_array($includePath, $paths[$prefix])) { - array_unshift($paths[$prefix], \JPath::clean($includePath)); + array_unshift($paths[$prefix], Path::clean($includePath)); } if (!in_array($includePath, $paths[''])) { - array_unshift($paths[''], \JPath::clean($includePath)); + array_unshift($paths[''], Path::clean($includePath)); } } } @@ -124,11 +126,11 @@ public static function getInstance($type, $prefix = '', $config = array()) if (!class_exists($modelClass)) { - $path = \JPath::find(self::addIncludePath(null, $prefix), self::_createFileName('model', array('name' => $type))); + $path = Path::find(self::addIncludePath(null, $prefix), self::_createFileName('model', array('name' => $type))); if (!$path) { - $path = \JPath::find(self::addIncludePath(null, ''), self::_createFileName('model', array('name' => $type))); + $path = Path::find(self::addIncludePath(null, ''), self::_createFileName('model', array('name' => $type))); } if (!$path) @@ -161,6 +163,6 @@ public static function getInstance($type, $prefix = '', $config = array()) */ public static function addTablePath($path) { - \JTable::addIncludePath($path); + Table::addIncludePath($path); } } diff --git a/libraries/src/MVC/View/CategoryFeedView.php b/libraries/src/MVC/View/CategoryFeedView.php index c7465d77a505a..b228232f260e8 100644 --- a/libraries/src/MVC/View/CategoryFeedView.php +++ b/libraries/src/MVC/View/CategoryFeedView.php @@ -11,8 +11,10 @@ defined('JPATH_PLATFORM') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Helper\RouteHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; +use Joomla\CMS\UCM\UCMType; /** * Base feed View class for a category @@ -39,7 +41,7 @@ public function display($tpl = null) $extension = $app->input->getString('option'); $contentType = $extension . '.' . $this->viewName; - $ucmType = new \JUcmType; + $ucmType = new UCMType; $ucmRow = $ucmType->getTypeByAlias($contentType); $ucmMapCommon = json_decode($ucmRow->field_mappings)->common; $createdField = null; @@ -56,7 +58,7 @@ public function display($tpl = null) $titleField = $ucmMapCommon[0]->core_title; } - $document->link = Route::_(\JHelperRoute::getCategoryRoute($app->input->getInt('id'), $language = 0, $extension)); + $document->link = Route::_(RouteHelper::getCategoryRoute($app->input->getInt('id'), $language = 0, $extension)); $app->input->set('limit', $app->get('feed_limit')); $siteEmail = $app->get('mailfrom'); @@ -95,7 +97,7 @@ public function display($tpl = null) } // URL link to article - $router = new \JHelperRoute; + $router = new RouteHelper; $link = Route::_($router->getRoute($item->id, $contentType, null, null, $item->catid)); // Strip HTML from feed item description text. diff --git a/libraries/src/MVC/View/CategoryView.php b/libraries/src/MVC/View/CategoryView.php index 5a5a9f7aeef7a..1779fb3c82782 100644 --- a/libraries/src/MVC/View/CategoryView.php +++ b/libraries/src/MVC/View/CategoryView.php @@ -11,6 +11,7 @@ defined('JPATH_PLATFORM') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; @@ -174,7 +175,7 @@ public function commonCategoryDisplay() if ($this->runPlugins) { - \JPluginHelper::importPlugin('content'); + PluginHelper::importPlugin('content'); foreach ($items as $itemElement) { @@ -242,7 +243,7 @@ public function commonCategoryDisplay() $this->setLayout($layout); } - $this->category->tags = new \JHelperTags; + $this->category->tags = new TagsHelper; $this->category->tags->getItemTags($this->extension . '.category', $this->category->id); } diff --git a/libraries/src/MVC/View/FormView.php b/libraries/src/MVC/View/FormView.php index c373a4fcc509c..57701bff36456 100644 --- a/libraries/src/MVC/View/FormView.php +++ b/libraries/src/MVC/View/FormView.php @@ -15,6 +15,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Toolbar\ToolbarHelper; /** * Base class for a Joomla Form View @@ -174,7 +175,7 @@ protected function addToolbar() $checkedOut = $this->getModel()->isCheckedOut($this->item); $canDo = $this->canDo; - \JToolbarHelper::title( + ToolbarHelper::title( $this->toolbarTitle, $this->toolbarIcon ); @@ -182,7 +183,7 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew && $canDo->get('core.create')) { - \JToolbarHelper::saveGroup( + ToolbarHelper::saveGroup( [ ['apply', $viewName . '.apply'], ['save', $viewName . '.save'], @@ -191,7 +192,7 @@ protected function addToolbar() 'btn-success' ); - \JToolbarHelper::cancel($viewName . '.cancel'); + ToolbarHelper::cancel($viewName . '.cancel'); } else { @@ -226,29 +227,29 @@ protected function addToolbar() $toolbarButtons[] = ['save2copy', $viewName . '.save2copy']; } - \JToolbarHelper::saveGroup( + ToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $itemEditable) { - \JToolbarHelper::versions($this->option . '.' . $viewName, $this->item->id); + ToolbarHelper::versions($this->option . '.' . $viewName, $this->item->id); } if (!$isNew && $this->previewLink) { - \JToolbarHelper::preview($this->previewLink, Text::_('JGLOBAL_PREVIEW'), 'eye', 80, 90); + ToolbarHelper::preview($this->previewLink, Text::_('JGLOBAL_PREVIEW'), 'eye', 80, 90); } - \JToolbarHelper::cancel($viewName . '.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel($viewName . '.cancel', 'JTOOLBAR_CLOSE'); } - \JToolbarHelper::divider(); + ToolbarHelper::divider(); if ($this->helpLink) { - \JToolbarHelper::help($this->helpLink); + ToolbarHelper::help($this->helpLink); } } } diff --git a/libraries/src/MVC/View/ListView.php b/libraries/src/MVC/View/ListView.php index b78953b786c11..1f6dd1261481e 100644 --- a/libraries/src/MVC/View/ListView.php +++ b/libraries/src/MVC/View/ListView.php @@ -15,6 +15,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Toolbar\ToolbarHelper; /** * Base class for a Joomla List View @@ -218,31 +219,31 @@ protected function addToolbar() $viewName = $this->getName(); $singularViewName = \Joomla\String\Inflector::getInstance()->toSingular($viewName); - \JToolbarHelper::title(Text::_($this->toolbarTitle), $this->toolbarIcon); + ToolbarHelper::title(Text::_($this->toolbarTitle), $this->toolbarIcon); if ($canDo->get('core.create')) { - \JToolbarHelper::addNew($singularViewName . '.add'); + ToolbarHelper::addNew($singularViewName . '.add'); } if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own'))) { - \JToolbarHelper::editList($singularViewName . '.edit'); + ToolbarHelper::editList($singularViewName . '.edit'); } if ($canDo->get('core.edit.state')) { - \JToolbarHelper::publish($viewName . '.publish', 'JTOOLBAR_PUBLISH', true); - \JToolbarHelper::unpublish($viewName . '.unpublish', 'JTOOLBAR_UNPUBLISH', true); + ToolbarHelper::publish($viewName . '.publish', 'JTOOLBAR_PUBLISH', true); + ToolbarHelper::unpublish($viewName . '.unpublish', 'JTOOLBAR_UNPUBLISH', true); if (isset($this->items[0]->featured)) { - \JToolbarHelper::custom($viewName . '.featured', 'featured.png', 'featured_f2.png', 'JFEATURE', true); - \JToolbarHelper::custom($viewName . '.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true); + ToolbarHelper::custom($viewName . '.featured', 'featured.png', 'featured_f2.png', 'JFEATURE', true); + ToolbarHelper::custom($viewName . '.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true); } - \JToolbarHelper::archiveList($viewName . '.archive'); - \JToolbarHelper::checkin($viewName . '.checkin'); + ToolbarHelper::archiveList($viewName . '.archive'); + ToolbarHelper::checkin($viewName . '.checkin'); } // Add a batch button @@ -261,21 +262,21 @@ protected function addToolbar() if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { - \JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', $viewName . '.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', $viewName . '.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { - \JToolbarHelper::trash($viewName . '.trash'); + ToolbarHelper::trash($viewName . '.trash'); } if ($user->authorise('core.admin', $this->option) || $user->authorise('core.options', $this->option)) { - \JToolbarHelper::preferences($this->option); + ToolbarHelper::preferences($this->option); } if ($this->helpLink) { - \JToolbarHelper::help($this->helpLink); + ToolbarHelper::help($this->helpLink); } } } diff --git a/libraries/src/Router/ApiRouter.php b/libraries/src/Router/ApiRouter.php index 1f2cfaf1b621e..faf98e2e93c55 100644 --- a/libraries/src/Router/ApiRouter.php +++ b/libraries/src/Router/ApiRouter.php @@ -12,6 +12,7 @@ use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Router\Exception\RouteNotFoundException; +use Joomla\CMS\Uri\Uri; use Joomla\Router\Router; use Joomla\Router\Route; @@ -94,7 +95,7 @@ public function parseApiRoute($method = 'GET') } // Get the path from the route and remove and leading or trailing slash. - $uri = \JUri::getInstance(); + $uri = Uri::getInstance(); $path = urldecode($uri->getPath()); /** @@ -104,7 +105,7 @@ public function parseApiRoute($method = 'GET') */ try { - $baseUri = \JUri::base(true); + $baseUri = Uri::base(true); } catch (\RuntimeException $e) { @@ -127,7 +128,7 @@ public function parseApiRoute($method = 'GET') } } - $query = \JUri::getInstance()->getQuery(true); + $query = Uri::getInstance()->getQuery(true); // Iterate through all of the known routes looking for a match. foreach ($this->routes as $route) diff --git a/libraries/src/Service/Provider/Application.php b/libraries/src/Service/Provider/Application.php index b68d4cbe9880c..24fd9b68ea712 100644 --- a/libraries/src/Service/Provider/Application.php +++ b/libraries/src/Service/Provider/Application.php @@ -140,7 +140,7 @@ function (Container $container) function (Container $container) { $app = new ApiApplication(null, null, null, $container); - // The session service provider needs JFactory::$application, set it if still null + // The session service provider needs Factory::$application, set it if still null if (Factory::$application === null) { Factory::$application = $app; diff --git a/libraries/src/Table/CoreContent.php b/libraries/src/Table/CoreContent.php index c72371df44089..599acfb865074 100644 --- a/libraries/src/Table/CoreContent.php +++ b/libraries/src/Table/CoreContent.php @@ -12,6 +12,7 @@ use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; +use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\Database\DatabaseDriver; use Joomla\Registry\Registry; @@ -300,7 +301,7 @@ protected function storeUcmBase($updateNulls = false, $isNew = false) // Store the ucm_base row $db = $this->getDbo(); $query = $db->getQuery(true); - $languageId = \JHelperContent::getLanguageId($this->core_language); + $languageId = ContentHelper::getLanguageId($this->core_language); // Selecting "all languages" doesn't give a language id - we can't store a blank string in non mysql databases, so save 0 (the default value) if (!$languageId) diff --git a/modules/mod_articles_category/tmpl/default.php b/modules/mod_articles_category/tmpl/default.php index d3ac6a6ee98c7..98f3c891e1f3e 100644 --- a/modules/mod_articles_category/tmpl/default.php +++ b/modules/mod_articles_category/tmpl/default.php @@ -11,6 +11,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; ?>