/** * Get the component information. * * @param string $option Option name * * @return object */ public function getComponent($option) { $this->loadExtensionLanguage($option, $option); $this->loadExtensionLanguage($option, $option . '.sys'); $component = JComponentHelper::getComponent($option); $component->option = $option; $component->xml = RComponentHelper::getComponentManifestFile($option); return $component; }
/** * Display method * * @param string $tpl The template name * * @return void */ public function display($tpl = null) { /** @var RedcoreModelConfig $model */ $model = $this->getModel('Config'); $option = JFactory::getApplication()->input->getString('component', 'com_redcore'); $lang = JFactory::getLanguage(); // Load component language files $lang->load($option, JPATH_ADMINISTRATOR, 'en-GB', false, false) || $lang->load($option, JPATH_ADMINISTRATOR . '/components/' . $option, 'en-GB', false, false); $this->form = $model->getForm(); $this->component = $model->getComponent($option); $this->return = JFactory::getApplication()->input->get('return', '', 'Base64'); $this->componentTitle = RText::getTranslationIfExists($this->component->xml->name, '', ''); $this->contentElements = $model->loadContentElements($option); $this->missingContentElements = $model->loadMissingContentElements($option, $this->contentElements); RLayoutHelper::$defaultBasePath = JPATH_ADMINISTRATOR . '/components/' . $option . '/layouts'; $extensionXml = RComponentHelper::getComponentManifestFile($option); if (isset($extensionXml->redcore)) { $attributes = $extensionXml->redcore->attributes(); if (!empty($attributes['defaultFramework'])) { RHtmlMedia::setFramework((string) $attributes['defaultFramework']); } } parent::display($tpl); }
$displayJoomlaMenu = false; $displayBackToJoomla = true; $displayComponentVersion = false; if (isset($data['display_joomla_menu'])) { $displayJoomlaMenu = (bool) $data['display_joomla_menu']; } if (isset($data['display_back_to_joomla'])) { $displayBackToJoomla = (bool) $data['display_back_to_joomla']; } if ($displayJoomlaMenu) { JLoader::import('joomla.application.module.helper'); $modules = JModuleHelper::getModules('menu'); } if (isset($data['display_component_version'])) { $displayComponentVersion = (bool) $data['display_component_version']; $xml = RComponentHelper::getComponentManifestFile($option); $componentName = JText::_($xml->name); $version = (string) $xml->version; } if (!empty($data['logoutReturnUri'])) { $logoutReturnUri = base64_encode($data['logoutReturnUri']); } else { $logoutReturnUri = base64_encode('index.php'); } ?> <script type="text/javascript"> jQuery(document).ready(function () { setInterval(function () { updateDateTime(); }, 1000); });