diff --git a/administrator/components/com_redirect/helpers/redirect.php b/administrator/components/com_redirect/helpers/redirect.php index 156917a8ea3cc..b8d17f9236bf0 100644 --- a/administrator/components/com_redirect/helpers/redirect.php +++ b/administrator/components/com_redirect/helpers/redirect.php @@ -92,4 +92,22 @@ public static function isEnabled() return $result; } + + /** + * Checks whether the option "Collect URLs" is enabled for the output message + * + * @return mixed + */ + public static function collectUrlsEnabled() + { + $collect_urls = false; + + if (JPluginHelper::isEnabled('system', 'redirect')) + { + $params = new JRegistry(JPluginHelper::getPlugin('system', 'redirect')->params); + $collect_urls = (bool) $params->get('collect_urls', 1); + } + + return $collect_urls; + } } diff --git a/administrator/components/com_redirect/views/links/tmpl/default.php b/administrator/components/com_redirect/views/links/tmpl/default.php index e7aff3692c6a0..ce8d5e87f51c7 100644 --- a/administrator/components/com_redirect/views/links/tmpl/default.php +++ b/administrator/components/com_redirect/views/links/tmpl/default.php @@ -48,6 +48,11 @@
× + collect_urls_enabled) : ?> + + + +
@@ -78,6 +83,9 @@ + + + @@ -118,6 +126,9 @@ created_date, JText::_('DATE_FORMAT_LC4')); ?> + + hits; ?> + id; ?> diff --git a/administrator/components/com_redirect/views/links/view.html.php b/administrator/components/com_redirect/views/links/view.html.php index df2de3454d08a..a582ed76629ca 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 $enabled; + protected $collect_urls_enabled; + protected $items; protected $pagination; @@ -33,10 +35,11 @@ class RedirectViewLinks extends JViewLegacy */ public function display($tpl = null) { - $this->enabled = RedirectHelper::isEnabled(); - $this->items = $this->get('Items'); - $this->pagination = $this->get('Pagination'); - $this->state = $this->get('State'); + $this->enabled = RedirectHelper::isEnabled(); + $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) diff --git a/administrator/language/en-GB/en-GB.com_redirect.ini b/administrator/language/en-GB/en-GB.com_redirect.ini index 82f9af59b9943..61f6d62885300 100644 --- a/administrator/language/en-GB/en-GB.com_redirect.ini +++ b/administrator/language/en-GB/en-GB.com_redirect.ini @@ -5,6 +5,8 @@ COM_REDIRECT="Redirect" COM_REDIRECT_BUTTON_UPDATE_LINKS="Update Links" +COM_REDIRECT_COLLECT_URLS_ENABLED="The option 'Collect URLs' is enabled." +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" @@ -50,4 +52,4 @@ 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 cannot 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, click Save to refresh the calculated settings." +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 cannot 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, click Save to refresh the calculated settings." \ No newline at end of file diff --git a/administrator/language/en-GB/en-GB.plg_system_redirect.ini b/administrator/language/en-GB/en-GB.plg_system_redirect.ini index 54df935b6112a..82b67ff6ecbe7 100644 --- a/administrator/language/en-GB/en-GB.plg_system_redirect.ini +++ b/administrator/language/en-GB/en-GB.plg_system_redirect.ini @@ -5,3 +5,5 @@ PLG_REDIRECT_XML_DESCRIPTION="The system redirect plugin enables the Joomla Redirect system to catch missing pages and redirect users." PLG_SYSTEM_REDIRECT="System - Redirect" +PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_DESC="This option controls the collection of URLs. This is useful to avoid unnecessary load on the database." +PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_LABEL="Collect URLs" diff --git a/administrator/templates/hathor/html/com_redirect/links/default.php b/administrator/templates/hathor/html/com_redirect/links/default.php index 4ed3131bada14..a81e368c6dc0c 100644 --- a/administrator/templates/hathor/html/com_redirect/links/default.php +++ b/administrator/templates/hathor/html/com_redirect/links/default.php @@ -70,6 +70,9 @@ + + + @@ -106,6 +109,9 @@ created_date, JText::_('DATE_FORMAT_LC4')); ?> + + hits; ?> + published, $i); ?> @@ -121,6 +127,11 @@
+ + + + +
+ +