getLanguage(); $app = Factory::getApplication(); $this->document = $app->getDocument(); //get vars $helpsearch = Factory::getApplication()->input->getString('filter_search', ''); // // Load css // HTMLHelper::_('stylesheet', 'com_jem/backend.css', array(), true); $wa = $app->getDocument()->getWebAssetManager(); $wa->registerStyle('jem.backend', 'com_jem/backend.css')->useStyle('jem.backend'); // Check for files in the actual language $langTag = $lang->getTag(); if (!Folder::exists(JPATH_SITE .'/administrator/components/com_jem/help/'.$langTag)) { $langTag = 'en-GB'; // use english as fallback } //search the keyword in the files $toc = JemViewHelp::getHelpToc($helpsearch); //assign data to template $this->langTag = $langTag; $this->helpsearch = $helpsearch; $this->toc = $toc; // add toolbar $this->addToolbar(); parent::display($tpl); } /** * Compiles the help table of contents * Based on the Joomla admin component * * @param string A specific keyword on which to filter the resulting list */ public function getHelpTOC($helpsearch) { $lang = Factory::getApplication()->getLanguage(); // Check for files in the actual language $langTag = $lang->getTag(); if (!Folder::exists(JPATH_SITE .'/administrator/components/com_jem/help/'.$langTag)) { $langTag = 'en-GB'; // use english as fallback } $files = Folder::files(JPATH_SITE .'/administrator/components/com_jem/help/'.$langTag, '\.xml$|\.html$'); $toc = array(); foreach ($files as $file) { $buffer = file_get_contents(JPATH_SITE .'/administrator/components/com_jem/help/'.$langTag.'/'.$file); if (preg_match('#