"; if (getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) // Set default icons. { $user_pref['core-infopanel-mye107'] = $pref['core-infopanel-default']; } $iconlist = array_merge($array_functions_assoc, getPluginLinks(E_16_PLUGMANAGER, "array")); $text .= "
Welcome to your e107 Content Management System

".ucwords(USERNAME)."'s Admin Panel

Welcome to your Website Content Manager
"; // Rendering the saved configuration. foreach ($iconlist as $key=>$val) { if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107'])) { $text .= render_links($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div"); } } $text .= "
 
"; // ------------------------------- e107 News -------------------------------- $text .= "
e107 News
"; // TODO Load with Ajax /* $xml = e107::getXml(); $vars = $xml->loadXMLfile('http://www.e107.org/e107_plugins/rss_menu/rss.php?1.2', true, true); $text .= print_r($vars,TRUE); */ $text .= " RSS News feed from e107.org goes here.
"; // ---------------------Latest Stuff --------------------------- $text .= "
"; require_once (e_CORE."shortcodes/batch/admin_shortcodes.php"); $text .= $tp->parseTemplate("{ADMIN_LATEST}"); $text .= ""; $text .= $tp->parseTemplate("{ADMIN_STATUS}"); $text .= "
"; // ---------------------- Who's Online ------------------------ // TODO Could use a new _menu item instead. $nOnline = e107::getDB()->db_Select('online', '*'); $text .= "
Visitors Online : ".$nOnline."
"; if (e107::getDB()->db_Select('online', '*',"online_ip !='' LIMIT 20")) { $newsarray = $e107->sql->db_getList(); foreach ($newsarray as $key=>$val) { $text .= " "; } } $text .= "
Timestamp Username IP Page Agent
".e107::getDateConvert()->convert_date($val['online_timestamp'],'%H:%M:%S')." ".renderOnlineName($val['online_user_id'])." ".e107::getIPHandler()->ipDecode($val['online_ip'])." ".$tp->text_truncate($val['online_location'],50,'...')." ".$tp->text_truncate(str_replace("/"," / ",$val['online_agent']),20,'...')."
"; // --------------------- User Selected Menus ------------------- if (varset($pref['core-infopanel-menus'])) { foreach ($pref['core-infopanel-menus'] as $val) { $id = $frm->name2id('core-infopanel_'.$val); $text .= "
"; $text .= $tp->parseTemplate("{PLUGIN=$val|TRUE}"); $text .= "
"; } } $text .= "
 
"; $text .= render_infopanel_options(); $text .= "
"; $text .= ""; if($_GET['mode'] != 'customize') { $ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text); } else { echo render_infopanel_options(true); } function renderOnlineName($val) { if($val==0) { return "Guest"; } return $val; } function render_info_panel($caption, $text) { return "
".$caption."
".$text."
"; } // ------------------ function render_infopanel_options($render = false) { // $frm = e107::getSingleton('e_form'); $frm = e107::getForm(); $mes = e107::getMessage(); $start = "
To customize this page, please click here.
"; if($render == false){ return $start; } $text2 = "

Icons

"; $text2 .= render_infopanel_icons(); $text2 .= "
 
"; $text2 .= "

Menus

"; $text2 .= render_infopanel_menu_options(); $text2 .= "
 
"; $text2 .= "
"; $text2 .= $frm->admin_button('submit-mye107', 'Save', 'Save'); $text2 .= "
"; $end = ""; return $mes->render().$text2.$end; } function render_infopanel_icons() { $frm = e107::getSingleton('e_form'); global $iconlist,$pluglist, $user_pref; $text = ""; foreach ($iconlist as $key=>$icon) { if (getperms($icon['perms'])) { $checked = (varset($user_pref['core-infopanel-mye107']) && in_array($key, $user_pref['core-infopanel-mye107'])) ? true : false; $text .= "
".$icon['icon'].' '.$frm->checkbox_label($icon['title'], 'e-mye107[]', $key, $checked)."
"; } } if (is_array($pluglist)) { foreach ($pluglist as $key=>$icon) { if (getperms($icon['perms'])) { $checked = (in_array('p-'.$key, $user_pref['core-infopanel-mye107'])) ? true : false; $text .= "
".$icon['icon'].$frm->checkbox_label($icon['title'], 'e-mye107[]', $key, $checked)."
"; } } } return $text; } function render_infopanel_menu_options() { if(!getperms('0')) { return; } global $pref; $frm = e107::getSingleton('e_form'); $text = ""; $menu_qry = 'SELECT * FROM #menus WHERE menu_id!= 0 GROUP BY menu_name ORDER BY menu_name'; $settings = varset($pref['core-infopanel-menus'],array()); if (e107::getDb()->db_Select_gen($menu_qry)) { while ($row = e107::getDb()->db_Fetch()) { // if(!is_numeric($row['menu_path'])) { $label = str_replace("_menu","",$row['menu_name']); $path_to_menu = $row['menu_path'].$row['menu_name']; $checked = ($settings && in_array($path_to_menu, $settings)) ? true : false; $text .= "\n
"; $text .= $frm->checkbox_label($label, "e-mymenus[]",$path_to_menu, $checked); $text .= "
"; } } } return $text; } ?>