array( 'controller' => 'docs_ui', 'path' => null, 'ui' => 'docs_form_ui', 'uipath' => null ), ); protected $adminMenu = array(); protected $adminMenuAliases = array(); protected $menuTitle = LAN_DOCS; protected static $helpList = array(); public static function getDocs() { return self::$helpList; } function init() { $fl = e107::getFile(); $helplist_all = $fl->get_files(DOC_PATH_ALT); if(!is_dir(DOC_PATH) || DOC_PATH == DOC_PATH_ALT) { $helplist = $helplist_all; } else { $helplist = $fl->get_files(DOC_PATH); } sort($helplist); self::$helpList = $helplist; foreach($helplist as $key => $helpdata) { $id = 'doc-' . $key; $k = 'main/' . $id; $this->adminMenu[$k] = array('caption' => str_replace("_", " ", $helpdata['fname']), 'perm' => false, 'uri' => "#" . $id); } } } class docs_ui extends e_admin_ui { public function Doc0Page() { $helplist = docs_admin::getDocs(); $text = ''; $iconQ = e107::getParser()->toGlyph('fa-question-circle'); $iconA = " "; foreach($helplist as $key => $helpdata) { $filename = DOC_PATH . $helpdata['fname']; $filename_alt = DOC_PATH_ALT . vartrue($helpdata['fname']); if(is_readable($filename)) { $tmp = file_get_contents($filename); } else { $tmp = file_get_contents($filename_alt); } $tmp = preg_replace('/Q\>(.*?)A>/si', "###QSTART###