debug = FALSE; $this->dragDrop = $dragdrop; if($this->dragDrop) { $this->debug = TRUE; } if ($NEWSHEADER) { $HEADER .= $NEWSHEADER; } if(isset($_POST['custom_select'])) { $this->curLayout = $_POST['custom_select']; } elseif(isset($_GET['lay'])) { $this->curLayout = $_GET['lay']; } else { $this->curLayout = varsettrue($_GET['configure'], $pref['sitetheme_deflayout']); } $this->dbLayout = ($this->curLayout != $pref['sitetheme_deflayout']) ? $this->curLayout : ""; //menu_layout is left blank when it's default. if(isset($_POST['menu_id']) || $_GET['id']) { $this->menuId = (isset($_POST['menu_id'])) ? intval($_POST['menu_id']) : $_GET['id']; } if ($menu_act == "sv" || isset($_POST['class_submit'])) { $this->menuSaveVisibility(); } if ($_GET['mode'] == "deac") { $this->menuDeactivate(); } if ($_GET['mode'] == "conf") { $this->menuGoConfig(); } $this->menuGrabLayout(); $menu_array = $this->parseheader($HEADER.$FOOTER, 'check'); if($menu_array) { sort($menu_array, SORT_NUMERIC); $menu_check = 'set'; foreach ($menu_array as $menu_value) { if ($menu_value != $menu_check) { $this->menu_areas[] = $menu_value; } $menu_check = $menu_value; } } $this->menuModify(); if($_POST['menuActivate']) { $this->menuActivateLoc = key($_POST['menuActivate']); $this->menuActivateIds = $_POST['menuselect']; $this->menuActivate(); } if($_POST['menuSetCustomPages']) { $this->menuSetCustomPages($_POST['custompages']); } if(isset($_POST['menuUsePreset']) && $_POST['curLayout']) { $this->menuSetPreset(); } $this->menuSetConfigList(); // Update Active MenuConfig List. } // ------------------------------------------------------------------------- function menuRenderIframe($url='') { global $ns,$sql; if(!$url) { $url = e_SELF."?configure=".$this->curLayout; } $cnt = $sql->db_Select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar. $text .= ""; return $text; } function menuRenderMessage() { // return $this->menuMessage; $emessage = &eMessage::getInstance(); $text = $emessage->render($message); // $text .= "ID = ".$this->menuId; return $text; } function menuAddMessage($message, $type = E_MESSAGE_INFO, $session = false) { $emessage = &eMessage::getInstance(); $emessage->add($message, $type, $session); } // ------------------------------------------------------------------------- function menuGrabLayout() { global $HEADER,$FOOTER,$CUSTOMHEADER,$CUSTOMFOOTER; if(($this->curLayout == 'legacyCustom' || $this->curLayout=='legacyDefault') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) ) // 0.6 themes. { if($this->curLayout == 'legacyCustom') { $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER; $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER; } } elseif($this->curLayout && $this->curLayout != "legacyCustom" && (isset($CUSTOMHEADER[$this->curLayout]) || isset($CUSTOMHEADER[$this->curLayout]))) // 0.7 themes { // echo " MODE 0.7 ".$this->curLayout; $HEADER = ($CUSTOMHEADER[$this->curLayout]) ? $CUSTOMHEADER[$this->curLayout] : $HEADER; $FOOTER = ($CUSTOMFOOTER[$this->curLayout]) ? $CUSTOMFOOTER[$this->curLayout] : $FOOTER; } elseif($this->curLayout && is_array($HEADER) && isset($HEADER[$this->curLayout]) && isset($FOOTER[$this->curLayout])) // 0.8 themes - we use only $HEADER and $FOOTER arrays. { // echo " MODE 0.8 ".$this->curLayout; $HEADER = $HEADER[$this->curLayout]; $FOOTER = $FOOTER[$this->curLayout]; } // Almost the same code as found in templates/header_default.php --------- } function menuGoConfig() { if(!$_GET['path'] || ($_GET['mode'] != "conf")) { return; } $file = urldecode($_GET['path']).".php"; $newurl = e_PLUGIN_ABS.$file."?id=".$_GET['id']; /* return ""; */ header("Location: ".$newurl); exit; // echo "URL = ".$newurl; // $newurl = $PLUGINS_DIRECTORY.$location."/{$position}{$this->menuNewLoc}.php"; // $newurl = SITEURL.str_replace("//", "/", $newurl); // echo " "; // exit; } // ----------------------------------------------------------------------------- function menuModify() { global $pref,$sql,$admin_log,$ns; $menu_act = ""; if (isset($_POST['menuAct'])) { foreach ($_POST['menuAct'] as $k => $v) { if (trim($v)) { $this->menuId = $k; list($menu_act, $location, $position, $this->menuNewLoc) = explode(".", $_POST['menuAct'][$k]); } } } if ($menu_act == "move") { $this->menuMove(); } if ($menu_act == "bot") { $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' "); $sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' AND menu_layout = '$this->dbLayout' "); $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' "); $admin_log->log_event('MENU_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } if ($menu_act == "top") { $sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='{$location}' AND menu_order < {$position} AND menu_layout = '".$this->dbLayout."' ",$this->debug); $sql->db_Update("menus", "menu_order=1 WHERE menu_id='{$this->menuId}' "); $admin_log->log_event('MENU_05',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } if ($menu_act == "dec") { $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug); $sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",TRUE); $admin_log->log_event('MENU_08',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } if ($menu_act == "inc") { $sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug); $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' "); $admin_log->log_event('MENU_07',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } if (!isset($_GET['configure'])) { // Scan plugin directories to see if menus to add $this->menuScanMenus(); } } // ---------------------------------------------------------------------------- function menuSetPreset() { global $pref,$sql,$location,$admin_log; if(!$menuAreas = $this->getMenuPreset()) { return FALSE; } $sql->db_Update("menus", "menu_location='0' WHERE menu_layout = '".$this->dbLayout."' "); // Clear All existing. foreach($menuAreas as $val) { if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_name = '".$val['menu_name']."' LIMIT 1")) { $row=$sql->db_Fetch(); if(!$sql->db_Update('menus', "menu_order='{$val['menu_order']}', menu_location = ".$val['menu_location'].", menu_class= ".$val['menu_class']." WHERE menu_name='".$val['menu_name']."' AND menu_layout = '".$this->dbLayout."' LIMIT 1 ")) { $insert = array( 'menu_id' => 0, 'menu_name' => $val['menu_name'], 'menu_location' => $val['menu_location'], 'menu_order' => $val['menu_order'], 'menu_class' => $val['menu_class'], 'menu_pages' => '', 'menu_path' => $row['menu_path'], 'menu_layout' => $this->dbLayout, 'menu_parms' => '' ); $sql->db_Insert("menus",$insert); $admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,''); } } } return $menuAreas; } // ---------------------------------------------------------------------------- function menuScanMenus() { global $sql, $sql2; $efile = new e_file; $efile->dirFilter = array('/', 'CVS', '.svn', 'languages'); $fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2); foreach($fileList as $file) { list($parent_dir) = explode('/',str_replace(e_PLUGIN,"",$file['path'])); $file['path'] = str_replace(e_PLUGIN,"",$file['path']); $file['fname'] = str_replace(".php","",$file['fname']); $valid_menu = FALSE; $existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'"); if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php')) { if (e107::isInstalled($parent_dir)) { // Its a 'new style' plugin with a plugin.php file, or an even newer one with plugin.xml file - only include if plugin installed $valid_menu = TRUE; // Whether new or existing, include in list // echo "Include {$parent_dir}:{$file['fname']}
"; } } else // Just add the menu anyway { $valid_menu = TRUE; // echo "Default Include {$parent_dir}:{$file['fname']}
"; } if ($valid_menu) { $menustr .= "&".str_replace(".php", "", $file['fname']); if (!$existing_menu) // New menu to add to list { $insert = array( 'menu_id' => 0, 'menu_name' => $file['fname'], 'menu_location' => 0, 'menu_order' => 0, 'menu_class' => 0, 'menu_pages' => '', 'menu_path' => $file['path'], 'menu_layout' => '', 'menu_parms' => '' ); if($sql->db_Insert("menus",$insert)) { // Could do admin logging here - but probably not needed $message .= MENLAN_10." - ".$file['fname']."
"; } } } } //Reorder all menus into 1...x order if (!is_object($sql2)) $sql2 = new db; // Shouldn't be needed foreach ($this->menu_areas as $menu_act) { if ($sql->db_Select("menus", "menu_id", "menu_location={$menu_act} ORDER BY menu_order ASC")) { $c = 1; while ($row = $sql->db_Fetch()) { $sql2->db_Update("menus", "menu_order={$c} WHERE menu_id=".$row['menu_id']); $c++; } } } $sql->db_Select("menus", "*", "menu_path NOT REGEXP('[0-9]+') "); while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->db_Fetch(MYSQL_NUM)) { if (stristr($menustr, $menu_name) === FALSE) { $sql2->db_Delete("menus", "menu_name='$menu_name'"); $message .= MENLAN_11." - ".$menu_name."
"; } } $this->menuAddMessage($message, E_MESSAGE_INFO); } // --------------------------------------------------------------------------- function menuPresetPerms($val) { $link_class = strtolower(trim($val)); $menu_perm['everyone'] = e_UC_PUBLIC; $menu_perm['guest'] = e_UC_GUEST; $menu_perm['member'] = e_UC_MEMBER; $menu_perm['mainadmin'] = e_UC_MAINADMIN; $menu_perm['admin'] = e_UC_ADMIN; $menu_perm['nobody'] = e_UC_NOBODY; $link_class = ($menu_perm[$link_class]) ? $menu_perm[$link_class] : e_UC_PUBLIC; return $link_class; } function menuVisibilityOptions() { if(!$_GET['vis']) return; global $sql,$ns,$frm; require_once(e_HANDLER."userclass_class.php"); if(!$sql->db_Select("menus", "*", "menu_id=".intval($_GET['vis']))) { $this->menuAddMessage("Couldn't Load Menu",E_MESSAGE_ERROR); return; }; $row = $sql->db_Fetch(); $listtype = substr($row['menu_pages'], 0, 1); $menu_pages = substr($row['menu_pages'], 2); $menu_pages = str_replace("|", "\n", $menu_pages); $text = "
". MENLAN_7." ".$row['menu_name']."
".MENLAN_4." ". r_userclass('menu_class', $row['menu_class'], "off", "public,member,guest,admin,main,classes,nobody")."

"; $checked = ($listtype == 1) ? " checked='checked' " : ""; $text .= " ".MENLAN_26."
"; $checked = ($listtype == 2) ? " checked='checked' " : ""; $text .= " ".MENLAN_27."

".MENLAN_28."
"; $text .= ""; $text .= "
"; // $text .= $frm->admin_button('class_submit', MENLAN_6, 'update'); $text .= "
"; return $text; $caption = MENLAN_7." ".$row['menu_name']; $ns->tablerender($caption, $text); } // ----------------------------------------------------------------------------- function menuActivate() // Activate Multiple Menus. { global $sql, $admin_log, $pref; $location = $this->menuActivateLoc; $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$location." AND menu_layout = '".$this->dbLayout."' "); foreach($this->menuActivateIds as $sel_mens) { //Get info from menu being activated if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_id = ".$sel_mens." ")) { $row=$sql->db_Fetch(); //If menu is not already activated in that area, add the record. //$query = "SELECT menu_name,menu_path FROM #menus WHERE menu_name='".$row['menu_name']."' AND menu_layout = '".$this->dbLayout."' AND menu_location = ".$location." LIMIT 1 "; //if(!$sql->db_Select_gen($query, $this->debug)) { $insert = array( 'menu_id' => 0, 'menu_name' => $row['menu_name'], 'menu_location' => $location, 'menu_order' => $menu_count, 'menu_class' => $row['menu_class'], 'menu_pages' => '', 'menu_path' => $row['menu_path'], 'menu_layout' => $this->dbLayout, 'menu_parms' => '' ); $sql->db_Insert("menus",$insert, $this->debug); $admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,''); $menu_count++; } } } } // ----------------------------------------------------------------------------- function menuSetCustomPages($array) { global $pref; $key = key($array); $pref['sitetheme_custompages'][$key] = array_filter(explode(" ",$array[$key])); save_prefs(); } // ------------------------------------------------------------------------------ function getMenuPreset() { global $pref; $layout = $this->curLayout; if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets'])) { return FALSE; } $temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area']; foreach($temp as $key=>$val) { $iD = $val['@attributes']['id']; if(varset($val['menu'][1])) // More than one menu item under in theme.xml. { foreach($val['menu'] as $k=>$v) { // $uclass = (defined(trim($v['@attributes']['perm']))) ? constant(trim($v['@attributes']['userclass'])) : 0; $menuArea[] = array( 'menu_location' => $iD, 'menu_order' => $k, 'menu_name' => $v['@attributes']['name']."_menu", 'menu_class' => $this->menuPresetPerms($v['@attributes']['perm']) ); } } else // Only one menu item under in theme.xml. { // $uclass = (defined(trim($val['menu']['@attributes']['userclass']))) ? constant(trim($val['menu']['@attributes']['userclass'])) : 0; $menuArea[] = array( 'menu_location' => $iD, 'menu_order' => 0, 'menu_name' => $val['menu']['@attributes']['name']."_menu", 'menu_class' => $this->menuPresetPerms($v['@attributes']['perm']) ); } } return $menuArea; } // ------------------------------------------------------------------------------ function checkMenuPreset($array,$name) { if(!is_array($array)) { return; } foreach($array as $key=>$val) { if($val['menu_name']==$name) { return $val['menu_location']; } } return FALSE; } // -------------------------------------------------------------------------- function menuSaveVisibility() { global $sql, $admin_log; $pagelist = explode("\r\n", $_POST['pagelist']); for ($i = 0 ; $i < count($pagelist) ; $i++) { $pagelist[$i] = trim($pagelist[$i]); } $plist = implode("|", $pagelist); $pageparms = $_POST['listtype'].'-'.$plist; $pageparms = preg_replace("#\|$#", "", $pageparms); $pageparms = (trim($_POST['pagelist']) == '') ? '' : $pageparms; if($sql->db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id=".intval($this->menuId))) { $admin_log->log_event('MENU_02',$_POST['menu_class'].'[!br!]'.$pageparms.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); $message = "
".MENLAN_8."
"; $this->menuAddMessage($message,E_MESSAGE_SUCCESS); } else { $message = "the update failed"; $this->menuAddMessage($message,E_MESSAGE_ERROR); } } // ----------------------------------------------------------------------- function menuDeactivate() { // Get current menu name global $sql,$admin_log; if($sql->db_Select('menus', 'menu_name', 'menu_id='.$this->menuId, 'default')) { $row = $sql->db_Fetch(); //Check to see if there is already a menu with location = 0 (to maintain BC) if($sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0 AND menu_layout ='".$this->dbLayout."' LIMIT 1")) { //menu_location=0 already exists, we can just delete this record $sql->db_Delete('menus', 'menu_id='.$this->menuId); } else { //menu_location=0 does NOT exist, let's just convert this to it if(!$sql->db_Update("menus", "menu_location=0, menu_order=0, menu_class=0, menu_pages='' WHERE menu_id=".$this->menuId)) { $message = "FAILED"; } } //Move all other menus up $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$location} AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' "); $admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } echo $message; } // ---------------------------------------------------------------------- function menuMove() {// Get current menu name global $admin_log,$sql; if($sql->db_Select('menus', 'menu_name', 'menu_id='.$this->menuId, 'default')) { $row = $sql->db_Fetch(); //Check to see if menu is already active in the new area, if not then move it if(!$sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$this->menuNewLoc." AND menu_layout='".$this->dbLayout ."' LIMIT 1")) { $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$this->menuNewLoc); $sql->db_Update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId); $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout='".$this->dbLayout ."' "); } $admin_log->log_event('MENU_03',$row['menu_name'].'[!br!]'.$this->menuNewLoc.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } } // =----------------------------------------------------------------------------- function menuRenderPage() { global $sql, $ns, $HEADER, $FOOTER, $rs, $pref, $tp; //FIXME - XHTML cleanup, front-end standards (elist, forms etc) echo "
"; $this->parseheader($HEADER); // $layouts_str; $layout = ($this->curLayout); $menuPreset = $this->getMenuPreset($layout); echo "
"; echo $rs->form_open("post", e_SELF."?configure=".$this->curLayout, "menuActivation"); $text = ""; $text .= ""; $text .= ""; $text .= "
".MENLAN_36."......".MENLAN_37."
"; $sql->db_Select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 GROUP BY menu_name ORDER BY menu_name ASC"); if(!$this->dragDrop) { $text .= "
"; $text .= "\n"; } else { $text .= "
\n"; } $color = ""; while ($row = $sql->db_Fetch()) { $pdeta = ""; $color = ($color == "white") ? "#DDDDDD" : "white"; if($row['menu_pages'] == "dbcustom") { $pdeta = MENLAN_42; } else { $row['menu_name'] = preg_replace("#_menu$#i", "", $row['menu_name']); if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name'].'_menu')) { $pdeta = MENLAN_39." {$pnum}"; } } if(!$this->dragDrop) { $menuInf = (strlen($row['menu_path']) > 1) ? ' ('.substr($row['menu_path'],0,-1).')' : ''; $text .= "
\n"; } else { $text .= "
dbLayout."' style='border:1px outset black;text-align:left;color:black'>
".$row['menu_name']." {$pdeta}
"; $text .= $this->menuRenderMenu($row, $menu_count); $text .= "
\n"; } } $text .= (!$this->dragDrop) ? "
".$pdeta." 
" : ""; $text .= "
"; $text .= "

"; foreach ($this->menu_areas as $menu_act) { $text .= "

\n"; } if($layout) { if(isset($pref['sitetheme_layouts'][$layout]['menuPresets'])) { $text .= "toJS(MENLAN_41)."')\" />

\n"; // Use Menu Presets $text .= ""; } $text .= ""; } $text .= "
"; $ns -> tablerender(MENLAN_22, $text); echo $rs->form_close(); echo "
"; $this->parseheader($FOOTER); if($this->debug) { echo "
 
"; } echo "
"; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// function menuSelectLayout() { global $rs, $pref; $text .= "
"; // color:white;background-color:black;width:98%;display:block;padding:15px;text-align:center $text .= "
".MENLAN_30." "; // $text .= "\n"; // window.frames['menu_iframe'].location=this.options[selectedIndex].value ??? $text .= "
"; return $text; } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// function parseheader($LAYOUT, $check = FALSE) { // $tmp = explode("\n", $LAYOUT); // Split up using the same function as the shortcode handler $tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for ($c = 0; $c < count($tmp); $c++) { if (preg_match("/[\{|\}]/", $tmp[$c])) { if ($check) { if (strstr($tmp[$c], "{MENU=")) { $str[] = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $tmp[$c]); } } else { $this->checklayout($tmp[$c],$this->curLayout); } } else { if (!$check) { echo $tmp[$c]; } } } if ($check) { return $str; } } function checklayout($str) { // Displays a basic representation of the theme global $pref, $ns, $PLUGINS_DIRECTORY, $rs, $sc_style, $tp, $menu_order; $menuLayout = ($this->curLayout != $pref['sitetheme_deflayout']) ? $this->curLayout : ""; if (strstr($str, "LOGO")) { echo $tp -> parseTemplate("{LOGO}"); } else if(strstr($str, "SITENAME")) { echo "
[SiteName]
"; } else if (strstr($str, "SITETAG")) { echo "
[SiteTag]
"; } else if (strstr($str, "SITELINKS")) { echo "
[SiteLinks]
"; } else if (strstr($str, "LANGUAGELINKS")) { echo "
[Language]
"; } else if (strstr($str, "CUSTOM")) { $cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str); echo "
[".$cust."]
"; } // Display embedded Plugin information. else if (strstr($str, "PLUGIN")) { $plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str); $plug = trim($plug); if (file_exists((e_PLUGIN."{$plug}/{$plug}_config.php"))) { $link = e_PLUGIN."{$plug}/{$plug}_config.php"; } if(file_exists((e_PLUGIN.$plug."/config.php"))) { $link = e_PLUGIN.$plug."/config.php"; } $plugtext = ($link) ? "(".MENLAN_34.":".LAN_CONFIGURE.")" : "(".MENLAN_34.")" ; echo "
"; $ns -> tablerender($plug, $plugtext); } else if (strstr($str, "MENU")) { // $ns = new e107table; $menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str); if (isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) { echo $sc_style['MENU']['pre']; } echo "
".MENLAN_14." ".$menu."

"; $text = " "; $sql9 = new db; if ($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '".$this->dbLayout."' ")) { unset($text); echo $rs->form_open("post", e_SELF."?configure=".$this->curLayout, "frm_menu_".intval($menu)); $MODE = 1; $sql9->db_Select("menus", "*", "menu_location='$menu' AND menu_layout='".$this->dbLayout."' ORDER BY menu_order"); $menu_count = $sql9->db_Rows(); while ($row = $sql9->db_Fetch(MYSQL_ASSOC)) { echo "\n\n\n \n\n
dbLayout."'>
"; echo $this->menuRenderMenu($row,$menu_count); echo "\n
"; echo "\n\n\n\n\n\n"; echo "

"; } echo $rs->form_close(); } echo "
"; if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false) { echo $sc_style['MENU']['post']; } } else if (strstr($str, "SETSTYLE")) { $tmp = explode("=", $str); $style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str); } else if (strstr($str, "SITEDISCLAIMER")) { echo "[Sitedisclaimer]"; } } //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// function menuRenderMenu($row,$menu_count ) { global $ns,$rs,$menu,$menu_info,$menu_act; // $menu_count is empty in here //FIXME extract extract($row); if(!$menu_id){ return; } $menu_name = preg_replace("#_menu#i", "", $menu_name); //TODO we need a CSS class for this $vis = ($menu_class || strlen($menu_pages) > 1) ? " * " : ""; //DEBUG div not allowed in final tags $caption = "
{$menu_name}{$vis}
"; // use theme render style instead $caption = $menu_name.$vis; $menu_info = "{$menu_location}.{$menu_order}"; $text = ""; $conf = ''; if (file_exists(e_PLUGIN.$menu_path.$menu_name.'_menu_config.php')) { $conf = $menu_path.$menu_name.'_menu_config.php'; } if($conf == '' && file_exists(e_PLUGIN."{$menu_path}config.php")) { $conf = "{$menu_path}config"; } $text .= "