diff --git a/src/administrator/components/com_weblinks/script.php b/src/administrator/components/com_weblinks/script.php index 3a1f692..50e6c4d 100644 --- a/src/administrator/components/com_weblinks/script.php +++ b/src/administrator/components/com_weblinks/script.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; /** * Installation class to perform additional changes during install/uninstall/update @@ -46,7 +47,7 @@ class Com_WeblinksInstallerScript $category->metadesc = ''; $category->metakey = ''; $category->language = '*'; - $category->checked_out_time = JFactory::getDbo()->getNullDate(); + $category->checked_out_time = Factory::getDbo()->getNullDate(); $category->version = 1; $category->hits = 0; $category->modified_user_id = 0; @@ -58,7 +59,7 @@ class Com_WeblinksInstallerScript // Check to make sure our data is valid if (!$category->check()) { - JFactory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); return; } @@ -66,7 +67,7 @@ class Com_WeblinksInstallerScript // Now store the category if (!$category->store(true)) { - JFactory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError())); return; } @@ -89,7 +90,7 @@ class Com_WeblinksInstallerScript public function postflight($type, $parent) { // Only execute database changes on MySQL databases - $dbName = JFactory::getDbo()->name; + $dbName = Factory::getDbo()->name; if (strpos($dbName, 'mysql') !== false) { @@ -114,7 +115,7 @@ class Com_WeblinksInstallerScript private function insertMissingUcmRecords() { // Insert the rows in the #__content_types table if they don't exist already - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Get the type ID for a Weblink $query = $db->getQuery(true); @@ -241,7 +242,7 @@ class Com_WeblinksInstallerScript 'approved', ); - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $table = $db->getTableColumns('#__weblinks'); $columns = array_intersect($oldColumns, array_keys($table)); @@ -263,7 +264,7 @@ class Com_WeblinksInstallerScript */ private function addColumnsIfNeeded() { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $table = $db->getTableColumns('#__weblinks'); if (!array_key_exists('version', $table)) diff --git a/src/administrator/components/com_weblinks/tmpl/weblink/edit.php b/src/administrator/components/com_weblinks/tmpl/weblink/edit.php index 206a79d..c5a506c 100644 --- a/src/administrator/components/com_weblinks/tmpl/weblink/edit.php +++ b/src/administrator/components/com_weblinks/tmpl/weblink/edit.php @@ -11,10 +11,11 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; HTMLHelper::_('behavior.formvalidator'); -$app = JFactory::getApplication(); +$app = Factory::getApplication(); $input = $app->input; $assoc = JLanguageAssociations::isEnabled(); diff --git a/src/administrator/components/com_weblinks/tmpl/weblink/modal.php b/src/administrator/components/com_weblinks/tmpl/weblink/modal.php index 5552d2e..be49ded 100644 --- a/src/administrator/components/com_weblinks/tmpl/weblink/modal.php +++ b/src/administrator/components/com_weblinks/tmpl/weblink/modal.php @@ -9,14 +9,15 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Factory; HTMLHelper::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); // @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0. -$function = JFactory::getApplication()->input->getCmd('function', 'jEditWeblink_' . (int) $this->item->id); +$function = Factory::getApplication()->input->getCmd('function', 'jEditWeblink_' . (int) $this->item->id); // Function to update input title when changed -JFactory::getDocument()->addScriptDeclaration(' +Factory::getDocument()->addScriptDeclaration(' function jEditWeblinkModal() { if (window.parent && document.formvalidator.isValid(document.getElementById("weblink-form"))) { return window.parent.' . $this->escape($function) . '(document.getElementById("jform_title").value); diff --git a/src/components/com_weblinks/tmpl/categories/default.php b/src/components/com_weblinks/tmpl/categories/default.php index e4f7273..7e89cb1 100644 --- a/src/components/com_weblinks/tmpl/categories/default.php +++ b/src/components/com_weblinks/tmpl/categories/default.php @@ -9,7 +9,9 @@ defined('_JEXEC') or die; -JFactory::getDocument()->addScriptDeclaration(" +use Joomla\CMS\Factory; + +Factory::getDocument()->addScriptDeclaration(" jQuery(function($) { $('.categories-list').find('[id^=category-btn-]').each(function(index, btn) { var btn = $(btn); diff --git a/src/components/com_weblinks/tmpl/category/default_items.php b/src/components/com_weblinks/tmpl/category/default_items.php index 4ce00f3..3352b1e 100644 --- a/src/components/com_weblinks/tmpl/category/default_items.php +++ b/src/components/com_weblinks/tmpl/category/default_items.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; // HTMLHelper::_('behavior.framework'); @@ -18,7 +19,7 @@ use Joomla\CMS\Language\Text; $params = &$this->category->params; // Get the user object. -$user = JFactory::getUser(); +$user = Factory::getUser(); // Check if user is allowed to add/edit based on weblinks permissinos. $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $this->category->id); diff --git a/src/components/com_weblinks/tmpl/form/edit.php b/src/components/com_weblinks/tmpl/form/edit.php index 841b596..0adc774 100644 --- a/src/components/com_weblinks/tmpl/form/edit.php +++ b/src/components/com_weblinks/tmpl/form/edit.php @@ -11,13 +11,14 @@ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; HTMLHelper::_('behavior.keepalive'); HTMLHelper::_('behavior.formvalidator'); // HTMLHelper::_('behavior.modal', 'a.modal_jform_contenthistory'); $captchaEnabled = false; -$captchaSet = $this->params->get('captcha', JFactory::getApplication()->get('captcha', '0')); +$captchaSet = $this->params->get('captcha', Factory::getApplication()->get('captcha', '0')); foreach (JPluginHelper::getPlugin('captcha') as $plugin) { diff --git a/src/components/com_weblinks/tmpl/weblink/default.php b/src/components/com_weblinks/tmpl/weblink/default.php index f90f781..ceda2f6 100644 --- a/src/components/com_weblinks/tmpl/weblink/default.php +++ b/src/components/com_weblinks/tmpl/weblink/default.php @@ -9,11 +9,12 @@ defined('_JEXEC') or die; -$weblinkUrl = JStringPunycode::urlToUTF8($this->item->url); +use Joomla\CMS\Factory; +$weblinkUrl = JStringPunycode::urlToUTF8($this->item->url); ?>