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###
" . $iconQ . "\\1
###QEND###", $tmp); $tmp = preg_replace('/###QEND###(.*?)###QSTART###/si', "
" . $iconA . "\\1
", $tmp); $tmp = str_replace(array('###QSTART###', '###QEND###'), array('', "
" . $iconA), $tmp) . "
"; $id = 'doc-' . $key; $display = ($key === 0) ? "" : "style='display:none'"; $text .= "

" . LAN_DOCS . SEP . str_replace("_", " ", $helpdata['fname']) . "

{$tmp}
"; //
".LAN_DOCS_GOTOP."
} return $text; } } class docs_form_ui extends e_admin_form_ui { } new docs_admin(); require_once(e_ADMIN . "auth.php"); $data = e107::getAdminUI()->runPage('raw'); echo $data[1]; // just to remove the title. require_once(e_ADMIN . "footer.php");