/** * Display the view */ public function display($tpl = null) { if ($this->getLayout() !== 'modal') { OSMapHelper::addSubmenu('sitemaps'); } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $version = new JVersion(); $message = $this->get('ExtensionsMessage'); if ($message) { JFactory::getApplication()->enqueueMessage($message); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { if (version_compare($version->getShortVersion(), '3.0.0', '<')) { $tpl = 'legacy'; } $this->addToolbar(); } // Load the extension $extension = Factory::getExtension('OSMap', 'component'); $extension->loadLibrary(); $displayLegacyStats = (bool) $extension->params->get('display_legacy_stats', 0); $this->assignRef("extension", $extension); $this->assignRef("displayLegacyStats", $displayLegacyStats); parent::display($tpl); }