diff --git a/administrator/components/com_plugins/views/plugin/tmpl/edit.php b/administrator/components/com_plugins/views/plugin/tmpl/edit.php index e7e1d11f2ed5f..a8ef8fa57f54e 100644 --- a/administrator/components/com_plugins/views/plugin/tmpl/edit.php +++ b/administrator/components/com_plugins/views/plugin/tmpl/edit.php @@ -20,6 +20,11 @@ { if (task == 'plugin.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) { Joomla.submitform(task, document.getElementById('style-form')); + + if (self != top){ + window.top.setTimeout('window.parent.jModalClose()', 1000); + window.parent.jQuery('#plugin" . $this->item->extension_id . "Modal').modal('hide'); + } } }; "); diff --git a/administrator/components/com_plugins/views/plugin/tmpl/modal.php b/administrator/components/com_plugins/views/plugin/tmpl/modal.php new file mode 100644 index 0000000000000..87faa774c05f9 --- /dev/null +++ b/administrator/components/com_plugins/views/plugin/tmpl/modal.php @@ -0,0 +1,26 @@ +addScriptDeclaration(' + window.parent.jQuery(".modal").on("hidden", function () { + if (typeof window.parent.jQuery("#plugin' . $this->item->extension_id . 'Modal iframe").contents().find("#closeBtn") !== "undefined") { + window.parent.jQuery("#plugin' . $this->item->extension_id . 'Modal iframe").contents().find("#closeBtn").click(); + } + }); +'); +?> + + + +setLayout('edit'); +echo $this->loadTemplate(); diff --git a/administrator/components/com_redirect/helpers/redirect.php b/administrator/components/com_redirect/helpers/redirect.php index 5373a97bf65ef..44973c260ec9e 100644 --- a/administrator/components/com_redirect/helpers/redirect.php +++ b/administrator/components/com_redirect/helpers/redirect.php @@ -73,17 +73,17 @@ public static function publishedOptions() } /** - * Determines if the plugin for Redirect to work is enabled. + * get the redirect system plugin id to use for direct access * - * @return boolean + * @return int * - * @since 1.6 + * @since 3.4 */ - public static function isEnabled() + public static function getRedirectPluginId() { $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select($db->quoteName('enabled')) + ->select($db->quoteName('extension_id')) ->from('#__extensions') ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) ->where($db->quoteName('element') . ' = ' . $db->quote('redirect')); @@ -91,7 +91,7 @@ public static function isEnabled() try { - $result = (boolean) $db->loadResult(); + $result = (int) $db->loadResult(); } catch (RuntimeException $e) { diff --git a/administrator/components/com_redirect/views/links/tmpl/default.php b/administrator/components/com_redirect/views/links/tmpl/default.php index 27aeae5fe992b..c90c6a335d0ad 100755 --- a/administrator/components/com_redirect/views/links/tmpl/default.php +++ b/administrator/components/com_redirect/views/links/tmpl/default.php @@ -35,8 +35,8 @@
- - + +
@@ -44,22 +44,47 @@
- enabled) : ?> -
- × - - collect_urls_enabled) : ?> - - - - -
- -
- × - -
+ + enabled) : ?> +
+ × + + + collect_urls_enabled) : ?> + + + + + + +
+ × + + + redirectpluginid . "&tmpl=component&layout=modal"); ?> + + + +
+ redirectpluginid . 'Modal', + array( + 'url' => $link, + 'title' => JText::_('COM_REDIRECT_EDIT_PLUGIN_SETTINGS'), + 'height' => '300px', + 'width' => '800px', + 'footer' => '' + . '' + ) + ); ?> + items)) : ?>
diff --git a/administrator/components/com_redirect/views/links/view.html.php b/administrator/components/com_redirect/views/links/view.html.php index 8eadb771548a1..9462640f7877a 100644 --- a/administrator/components/com_redirect/views/links/view.html.php +++ b/administrator/components/com_redirect/views/links/view.html.php @@ -20,6 +20,8 @@ class RedirectViewLinks extends JViewLegacy protected $collect_urls_enabled; + protected $redirectpluginid; + protected $items; protected $pagination; @@ -37,8 +39,9 @@ class RedirectViewLinks extends JViewLegacy */ public function display($tpl = null) { - $this->enabled = RedirectHelper::isEnabled(); + $this->enabled = JPluginHelper::isEnabled('system', 'redirect'); $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); + $this->redirectpluginid = RedirectHelper::getRedirectPluginId(); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); @@ -109,6 +112,7 @@ protected function addToolbar() // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); + JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button @@ -129,7 +133,7 @@ protected function addToolbar() JToolbarHelper::divider(); } - if ($canDo->get('core.admin') || $canDo->get('core.options')) + if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_redirect'); JToolbarHelper::divider(); diff --git a/administrator/language/en-GB/en-GB.com_redirect.ini b/administrator/language/en-GB/en-GB.com_redirect.ini index c2202bf5aab94..964f14d0b1958 100644 --- a/administrator/language/en-GB/en-GB.com_redirect.ini +++ b/administrator/language/en-GB/en-GB.com_redirect.ini @@ -13,6 +13,7 @@ COM_REDIRECT_COLLECT_URLS_DISABLED="The option 'Collect URLs' is disabled." COM_REDIRECT_CONFIGURATION="Redirect Manager Options" COM_REDIRECT_DISABLE_LINK="Disable Link" COM_REDIRECT_EDIT_LINK="Edit Link #%d" +COM_REDIRECT_EDIT_PLUGIN = "Edit the Plugin now" COM_REDIRECT_ENABLE_LINK="Enable Link" COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED="The redirect must have a destination URL" COM_REDIRECT_ERROR_DUPLICATE_OLD_URL="The source URL must be unique." @@ -56,11 +57,11 @@ COM_REDIRECT_N_LINKS_UPDATED_1="1 link has been updated." COM_REDIRECT_NEW_LINK="New Link" COM_REDIRECT_NO_ITEM_ADDED="No links added." COM_REDIRECT_NO_ITEM_SELECTED="No links selected." -; Change 'System%20-%20Redirect' to the value in plg_system_redirect.sys.ini for your language -COM_REDIRECT_PLUGIN_DISABLED="The Redirect Plugin is disabled. Enable it in the Plugin Manager." +COM_REDIRECT_PLUGIN_DISABLED="The Redirect Plugin is disabled. You need to enable it." COM_REDIRECT_PLUGIN_ENABLED="The Redirect Plugin is enabled." COM_REDIRECT_REDIRECTED_ON="Redirected on: %s." COM_REDIRECT_SAVE_SUCCESS="Link successfully saved." COM_REDIRECT_SEARCH_LINKS="Search in link fields." COM_REDIRECT_XML_DESCRIPTION="This component implements link redirection." JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
Inherited means that the permissions from global configuration and parent group will be used.
Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
2. If you select a new setting, select Save to refresh the calculated settings." +COM_REDIRECT_EDIT_PLUGIN_SETTINGS = "Edit Plugin Settings" diff --git a/administrator/language/en-GB/en-GB.com_redirect.sys.ini b/administrator/language/en-GB/en-GB.com_redirect.sys.ini index 0630bf1d5c033..cf33104d861ef 100644 --- a/administrator/language/en-GB/en-GB.com_redirect.sys.ini +++ b/administrator/language/en-GB/en-GB.com_redirect.sys.ini @@ -4,4 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 COM_REDIRECT="Redirect" -COM_REDIRECT_XML_DESCRIPTION="This component implements link redirection." \ No newline at end of file +COM_REDIRECT_XML_DESCRIPTION="This component implements link redirection." diff --git a/libraries/cms/plugin/helper.php b/libraries/cms/plugin/helper.php index bdc8f5fa7a161..7e7d890b36780 100644 --- a/libraries/cms/plugin/helper.php +++ b/libraries/cms/plugin/helper.php @@ -299,7 +299,7 @@ protected static function load() { $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('folder AS type, element AS name, params') + ->select('extension_id as id, folder AS type, element AS name, params') ->from('#__extensions') ->where('enabled = 1') ->where('type =' . $db->quote('plugin'))