/** * Displays the view * * @param string $tpl The name of the template file to parse * * @return void * * @since 2.5 */ public function display($tpl = null) { $doc = JFactory::getDocument(); $doc->addStyleSheet(JURI::root() . 'media/overrider/css/overrider.css'); JHTML::core(); $doc->addScript(JURI::root() . 'media/overrider/js/overrider.js'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); return; } // Check whether the cache has to be refreshed $cached_time = JFactory::getApplication()->getUserState('com_languages.overrides.cachedtime.' . $this->state->get('filter.client') . '.' . $this->state->get('filter.language'), 0); if (time() - $cached_time > 60 * 5) { $this->state->set('cache_expired', true); } // Add strings for translations in Javascript JText::script('COM_LANGUAGES_VIEW_OVERRIDE_NO_RESULTS'); JText::script('COM_LANGUAGES_VIEW_OVERRIDE_REQUEST_ERROR'); $this->addToolbar(); parent::display($tpl); }