diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 95aaa9aa5..56d16f47a 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -2,16 +2,14 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2012 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * - * $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if(isset($_GET['configure'])) @@ -29,7 +27,9 @@ if (!getperms("2")) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('menus', true); +e107::coreLan('admin', true); $e_sub_cat = 'menus'; @@ -78,6 +78,7 @@ if($_POST) $text .= $men->menuRenderMessage(); $text .= $men->menuSelectLayout(); $text .= $men->menuVisibilityOptions(); + $text .= $men->menuInstanceParameters(); $text .= $men->menuRenderIframe(); $ns -> tablerender(ADLAN_6." :: ".LAN_MENULAYOUT, $text, 'menus_config'); } diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 7aceaf13e..b6641c77f 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -2,16 +2,14 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2012 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * - * $Source: /cvs_backup/e107_0.8/e107_handlers/menumanager_class.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if (!defined('e107_INIT')) { exit; } @@ -71,14 +69,16 @@ class e_menuManager { if(isset($_POST['menu_id']) || $_GET['id']) { - $this->menuId = (isset($_POST['menu_id'])) ? intval($_POST['menu_id']) : $_GET['id']; + $this->menuId = (isset($_POST['menu_id'])) ? intval($_POST['menu_id']) : intval($_GET['id']); } - if ($menu_act == "sv" || isset($_POST['class_submit'])) + if (/*$menu_act == "sv" || */isset($_POST['class_submit'])) { - $this->menuSaveVisibility(); - + } + elseif(isset($_POST['parms_submit'])) + { + $this->menuSaveParameters(); } if ($_GET['mode'] == "deac") @@ -155,19 +155,18 @@ class e_menuManager { function menuRenderMessage() { // return $this->menuMessage; - $emessage = &eMessage::getInstance(); - - $text = $emessage->render($message); + $emessage = eMessage::getInstance(); + $text = $emessage->render('menuUi'); // $text .= "ID = ".$this->menuId; return $text; - + } function menuAddMessage($message, $type = E_MESSAGE_INFO, $session = false) { - $emessage = &eMessage::getInstance(); - $emessage->add($message, $type, $session); + $emessage = eMessage::getInstance(); + $emessage->add(array($message, 'menuUi'), $type, $session); } // ------------------------------------------------------------------------- @@ -245,7 +244,7 @@ class e_menuManager { { if (trim($v)) { - $this->menuId = $k; + $this->menuId = intval($k); list($menu_act, $location, $position, $this->menuNewLoc) = explode(".", $_POST['menuAct'][$k]); } } @@ -448,9 +447,48 @@ class e_menuManager { return $link_class; } - - - + /** + * This one will be greatly extended, allowing menus to offer UI and us + * settings per instance later ($parm variable available for menus - same as shortcode's $parm) + */ + function menuInstanceParameters() + { + if(!$_GET['parmsId']) return; + $id = intval($_GET['parmsId']); + $frm = e107::getForm(); + $sql = e107::getDb(); + + if(!$sql->db_Select("menus", "*", "menu_id=".$id)) + { + $this->menuAddMessage("Couldn't Load Menu",E_MESSAGE_ERROR); + return; + }; + $row = $sql->db_Fetch(); + + // TODO lan + $text = "