/** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed False if unsuccessful, otherwise void. * * @since 1.6 */ public function display($tpl = null) { // Set variables $app = JFactory::getApplication(); $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'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // 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()); $app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice'); } else { $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); $app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error'); } $this->addToolbar(); parent::display($tpl); }