Skip to content

Commit

Permalink
fix redirect plugin messages (#12280)
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 authored and wilsonge committed Oct 3, 2016
1 parent 9469e92 commit dd0cb3c
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions administrator/components/com_redirect/views/links/view.html.php
Expand Up @@ -47,19 +47,6 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

if ($this->enabled && $this->collect_urls_enabled)
{
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . ' ' . JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice');
}
elseif ($this->enabled && !$this->collect_urls_enabled)
{
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::_('COM_REDIRECT_COLLECT_URLS_DISABLED'), 'notice');
}
else
{
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_DISABLED'), 'error');
}

// Check for errors.
if (count($errors = $this->get('Errors')))
{
Expand All @@ -68,15 +55,20 @@ public function display($tpl = null)
return false;
}

if (!$this->enabled)
// Show messages about the enabled plugin and if the plugin should collect URLs
if ($this->enabled && $this->collect_urls_enabled)
{
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . ' ' . JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice');
}
elseif ($this->enabled && !$this->collect_urls_enabled)
{
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId());
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'warning');
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice');
}
elseif (!$this->collect_urls_enabled)
else
{
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId());
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice');
$app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error');
}

$this->addToolbar();
Expand Down

0 comments on commit dd0cb3c

Please sign in to comment.