From 8895d48dd172567aee30eaf4bb86c7f270eedc92 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 6 Mar 2013 23:01:16 -0800 Subject: [PATCH] Reworked storage of custom menus. --- e107_admin/cpage.php | 175 ++++++++++++------ e107_admin/menus.php | 12 +- e107_admin/update_routines.php | 17 ++ .../shortcodes/batch/page_shortcodes.php | 33 ++++ e107_core/sql/core_sql.php | 6 + e107_core/templates/page_template.php | 9 +- e107_handlers/admin_ui.php | 13 ++ e107_handlers/form_handler.php | 8 +- e107_handlers/menu_class.php | 28 ++- e107_handlers/menumanager_class.php | 130 +++++++++---- e107_themes/bootstrap/admin_style.css | 1 + 11 files changed, 321 insertions(+), 111 deletions(-) diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 9342802be..74e42c0a1 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -41,9 +41,9 @@ class page_admin extends e_admin_dispatcher 'uipath' => null ), 'menu' => array( - 'controller' => 'menu_admin_ui', + 'controller' => 'page_admin_ui', 'path' => null, - 'ui' => 'menu_admin_form_ui', + 'ui' => 'page_admin_form_ui', 'uipath' => null ), 'dialog' => array( @@ -61,15 +61,15 @@ class page_admin extends e_admin_dispatcher 'cat/list' => array('caption'=> "List Books/Chapters", 'perm' => '5'), // Create Category. 'cat/create' => array('caption'=> "Add Book/Chapter", 'perm' => '5'), // Category List - 'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J'), - 'menu/create' => array('caption'=> CUSLAN_31, 'perm' => 'J'), + 'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J', 'tab' => 2), + 'menu/create' => array('caption'=> CUSLAN_31, 'perm' => 'J', 'tab' => 2), 'page/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '0') ); protected $adminMenuAliases = array( 'page/edit' => 'page/list', - 'menu/edit' => 'menu/list' + 'menu/edit' => 'menu/create' ); protected $menuTitle = 'Custom Pages'; @@ -173,6 +173,7 @@ class page_chapters_form_ui extends e_admin_form_ui // Menu Area. +/* class menu_admin_ui extends e_admin_ui { protected $pluginTitle = ADLAN_42; @@ -195,13 +196,13 @@ class menu_admin_ui extends e_admin_ui 'page_id' => array('title'=> 'ID', 'type'=>'text', 'tab' => 0, 'width'=>'5%', 'readParms'=>'','forced'=> TRUE), 'page_theme' => array('title'=> "Menu Name", 'tab' => 0, 'type' => 'text', 'width' => 'auto','nolist'=>true), - 'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'width'=>'25%', 'inline'=>true,/*'readParms'=>'link={e_BASE}page.php?[id]&dialog=1'*/), + 'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'width'=>'25%', 'inline'=>true), // 'page_template' => array('title'=> 'Template', 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), // 'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'data'=>'int','width' => 'auto', 'thclass' => 'left'), 'page_text' => array('title'=> CUSLAN_9, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), 'page_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'data'=>'int', 'width' => 'auto','writeParms'=>'auto=1&readonly=1'), - 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center'/*,'readParms'=>'sort=1'*/) + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center' ); protected $fieldpref = array("page_id","page_theme", "page_title", "page_text"); @@ -243,47 +244,7 @@ class menu_admin_ui extends e_admin_ui } // Create Menu in Menu Table - function afterCreate($newdata,$olddata, $id) - { - $tp = e107::getParser(); - $sql = e107::getDb(); - $mes = e107::getMessage(); - - $menu_name = $tp->toDB($newdata['page_theme']); // not to be confused with menu-caption. - $menu_path = intval($id); - - if (!$sql->select('menus', 'menu_name', "`menu_path` = ".$menu_path." LIMIT 1")) - { - $insert = array('menu_name' => $menu_name, 'menu_path' => $menu_path); - - if($sql->insert('menus', $insert) !== false) - { - - $mes->addDebug("Menu Created"); - return true; - } - } - - } - - // Update Menu in Menu Table - function afterUpdate($newdata,$olddata,$id) - { - $tp = e107::getParser(); - $sql = e107::getDb(); - $mes = e107::getMessage(); - - $menu_name = $tp->toDB($newdata['page_theme']); // not to be confused with menu-caption. - - if ($sql->select('menus', 'menu_name', "`menu_path` = ".$id." LIMIT 1")) - { - if($sql->update('menus', "menu_name='{$menu_name}' WHERE menu_path=".$id." LIMIT 1") !== false) - { - $mes->addDebug("Menu Updated"); - return true; - } - } - } + function previewPage() //XXX FIXME Doesn't work when in Ajax mode.. why??? @@ -318,7 +279,7 @@ class menu_form_ui extends e_admin_form_ui { } - +*/ @@ -343,21 +304,22 @@ class page_admin_ui extends e_admin_ui protected $orderStep = 10; //protected $url = array('profile'=>'page/view', 'name' => 'page_title', 'description' => '', 'link'=>'{e_BASE}page.php?id=[id]'); // 'link' only needed if profile not provided. protected $url = array('route'=>'page/view/index', 'vars' => array('id' => 'page_id', 'sef' => 'page_sef'), 'name' => 'page_title', 'description' => ''); // 'link' only needed if profile not provided. - protected $tabs = array("Main","Advanced"); + protected $tabs = array("Page","Page Options","Menu"); // protected $listSorting = true; - + // PAGE LIST/EDIT and MENU EDIT modes. protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), 'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=dialog'), 'page_chapter' => array('title'=> 'Book/Chapter', 'tab' => 0, 'type' => 'dropdown', 'width' => '20%', 'filter' => true, 'batch'=>true, 'inline'=>true), 'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'inline'=>true, 'width'=>'25%'), - 'page_theme' => array('title'=> LAN_TYPE, 'tab' => 0, 'type' => 'text', 'width' => 'auto','nolist'=>true, 'noedit'=>true), 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), 'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'data'=>'int','width' => 'auto', 'thclass' => 'left'), 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page'), + + // Options Tab. 'page_datestamp' => array('title'=> LAN_DATE, 'tab' => 1, 'type' => 'datestamp', 'data'=>'int', 'width' => 'auto','writeParms'=>'auto=1'), 'page_class' => array('title'=> LAN_USERCLASS, 'tab' => 1, 'type' => 'userclass', 'data'=>'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true), 'page_rating_flag' => array('title'=> LAN_RATING, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ), @@ -368,9 +330,19 @@ class page_admin_ui extends e_admin_ui 'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'width' => 'auto'), 'page_order' => array('title'=> LAN_ORDER, 'tab' => 1, 'type' => 'number', 'width' => 'auto', 'inline'=>true), + + // Menu Tab XXX 'page_theme' is 'menu_name' - not caption. + 'page_theme' => array('title'=> "Menu Name", 'tab' => 2, 'type' => 'text', 'width' => 'auto','nolist'=>true, "help"=>"Will be listed in the Menu-Manager under this name"), + 'menu_title' => array('title'=> "Menu Title", 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Caption displayed on the menu item."), + 'menu_text' => array('title'=> "Menu Body", 'nolist'=>true, 'tab' => 2, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page' ), + 'menu_image' => array('title' =>"Menu Image", 'nolist'=>true, 'tab' => 2, 'type' => 'image', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>false), + 'menu_template' => array('title'=> "Menu Template", 'nolist'=>true, 'tab' => 2, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), + + + // 'page_ip_restrict' => array('title'=> LXXAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar - 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1') + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1') ); protected $fieldpref = array("page_id","page_title","page_chapter","page_template","page_author","page_class"); @@ -385,10 +357,43 @@ class page_admin_ui extends e_admin_ui protected $templates = array(); function init() - { + { + + // USED IN Menu LIST-MODE ONLY. + if($this->getMode() == 'menu' && $this->getACtion() == 'list') + { + + $this->listQry = "SELECT p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE p.page_theme != '' "; // without any Order or Limit. + + $this->batchDelete = false; + $this->fields = array( + 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), + 'page_id' => array('title'=> 'ID', 'type'=>'text', 'tab' => 0, 'width'=>'5%', 'readParms'=>'','forced'=> TRUE), + + 'menu_image' => array('title' =>"Menu Image", 'type' => 'image', 'width' => '110px', 'thclass' => 'left', 'class' => "left", 'nosort' => false, 'readParms'=>'thumb=80&thumb_urlraw=0&thumb_aw=80','readonly'=>false), + + 'page_theme' => array('title'=> "Menu Name", 'type' => 'text', 'width' => 'auto','nolist'=>true, "help"=>"Will be listed in the Menu-Manager under this name"), + + // 'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'data'=>'int','width' => 'auto', 'thclass' => 'left'), + 'page_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'data'=>'int', 'width' => 'auto','writeParms'=>'auto=1&readonly=1'), + + 'menu_title' => array('title'=> "Menu Title", 'forced'=> TRUE, 'type' => 'text', 'inline'=>true, 'width'=>'25%'), + 'menu_text' => array('title'=> "Menu Body", 'type' => 'bbarea', 'data'=>'str', 'width' => 'auto', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page'), + 'menu_template' => array('title'=> "Menu Template", 'type' => 'dropdown', 'width' => 'auto', 'filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), + + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'noselector' => true, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center'/*,'readParms'=>'sort=1'*/) + ); + + $this->fieldpref = array("page_id","page_theme", "menu_title", "menu_text", 'menu_image', 'menu_template'); + } + + $this->templates = e107::getLayouts('', 'page', 'front', '', false, false); - $this->fields['page_template']['writeParms'] = $this->templates; + unset($this->templates['panel'], $this->templates['nav']); + + $this->fields['page_template']['writeParms'] = $this->templates; + $this->fields['menu_template']['writeParms'] = e107::getLayouts('', 'menu', 'front', '', false, false); $sql = e107::getDb(); $sql->gen("SELECT chapter_id,chapter_name,chapter_parent FROM #page_chapters ORDER BY chapter_parent asc, chapter_order"); @@ -412,6 +417,66 @@ class page_admin_ui extends e_admin_ui } + + + + function afterCreate($newdata,$olddata, $id) + { + $tp = e107::getParser(); + $sql = e107::getDb(); + $mes = e107::getMessage(); + + $menu_name = $tp->toDB($newdata['page_theme']); // not to be confused with menu-caption. + $menu_path = intval($id); + + if (!$sql->select('menus', 'menu_name', "`menu_path` = ".$menu_path." LIMIT 1")) + { + $insert = array('menu_name' => $menu_name, 'menu_path' => $menu_path); + + if($sql->insert('menus', $insert) !== false) + { + + $mes->addDebug("Menu Created"); + return true; + } + } + + return $newdata; + + } + + function beforeCreate($newdata,$olddata) + { + return $newdata; + + } + + + + // Update Menu in Menu Table + function afterUpdate($newdata,$olddata,$id) + { + $tp = e107::getParser(); + $sql = e107::getDb(); + $mes = e107::getMessage(); + + $menu_name = $tp->toDB($newdata['menu_title']); // not to be confused with menu-caption. + + if ($sql->select('menus', 'menu_name', "`menu_path` = ".$id." LIMIT 1")) + { + if($sql->update('menus', "menu_name='{$menu_name}' WHERE menu_path=".$id." ") !== false) + { + $mes->addDebug("Menu Updated"); + return true; + } + } + } + + + + + + } diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 019c829b7..b4dc7db82 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -232,7 +232,17 @@ if(strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc'])) label.selection-row { padding:6px ; cursor: pointer; width:90%} table.table tbody > tr >td { } - table.table tbody > tr >td label { padding:15px; display:block; cursor: pointer; font-size:14px ; } + + + table.table tbody > tr > td label { + display: block; + cursor: pointer; + font-size: 14px; + line-height: 2em; + padding-left: 15px; +} + + table.table tbody > tr >td label > input { margin-right: 10px; float: left; } diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 15a1e301f..def31ef83 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -976,7 +976,24 @@ function update_706_to_800($type='') //TODO - send notification messages to Log. + + if($sql->gen("SELECT * FROM #page WHERE page_theme != '' AND menu_title = '' LIMIT 1")) + { + if ($just_check) + { + return update_needed("Pages/Menus Table requires updating."); + } + + if($sql->update('page',"menu_title = page_title, menu_text = page_text WHERE menu_title = '' AND menu_text = '' ")) + { + $mes->addDebug("Successfully updated pages/menus table to new format. "); + } + } + + + + diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index e93244cda..4488f0d82 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -167,6 +167,39 @@ class cpage_shortcodes extends e_shortcode } return ''.$this->sc_cpagetitle().''; } + + function sc_cpagebutton($parm) + { + $url = $this->sc_cpageurl(); + + if($parm == 'href' || !$url) + { + return $url; + } + return 'Read More..'; + } + + + function sc_cmenutitle($parm='') + { + return e107::getParser()->toHTML($this->getParserVars()->menu_title, true, 'TITLE'); + } + + + function sc_cmenubody($parm='') + { + // print_a($this); + return e107::getParser()->toHTML($this->page['menu_text'], true, 'BODY'); + } + + + function sc_cmenuimage($parm='') + { + // print_a($this); + $img = e107::getParser()->thumbUrl($this->page['menu_image']); + return ""; + } + function sc_cpageurl() { diff --git a/e107_core/sql/core_sql.php b/e107_core/sql/core_sql.php index f56fa5cad..db075eaa5 100644 --- a/e107_core/sql/core_sql.php +++ b/e107_core/sql/core_sql.php @@ -386,6 +386,12 @@ CREATE TABLE page ( page_theme varchar(50) NOT NULL default '', page_template varchar(50) NOT NULL default '', page_order int(4) unsigned NOT NULL default '9999', + + menu_title varchar(50) NOT NULL default '', + menu_text mediumtext NOT NULL, + menu_image varchar(250) NOT NULL default '', + menu_template varchar(50) NOT NULL default '', + PRIMARY KEY (page_id) ) ENGINE=MyISAM; # -------------------------------------------------------- diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php index 535abe2e3..c97064388 100644 --- a/e107_core/templates/page_template.php +++ b/e107_core/templates/page_template.php @@ -95,14 +95,7 @@ $sc_style['CPAGENAV|default']['post'] = ''; $PAGE_TEMPLATE['custom']['tableRender'] = ''; -#### Panel Template - Used by e107_plugins/page/page_menu.php - $PAGE_TEMPLATE['panel']['start'] = ''; - $PAGE_TEMPLATE['panel']['body'] = '{CPAGEBODY}'; - $PAGE_TEMPLATE['panel']['authorize'] = ''; - $PAGE_TEMPLATE['panel']['restricted'] = ''; - $PAGE_TEMPLATE['panel']['end'] = ''; - $PAGE_TEMPLATE['panel']['noTableRender'] = false; -// $PAGE_TEMPLATE['panel']['tableRender'] = ''; // needed? + diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 153236383..88858c6a1 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1464,9 +1464,12 @@ class e_admin_dispatcher default: $k2 = $k; + break; } + + // Access check done above // if($val['perm']!= null) // check perms // { @@ -1478,15 +1481,25 @@ class e_admin_dispatcher // else { $var[$key][$k2] = $v; + } } + + + // TODO slide down menu options? if(!vartrue($var[$key]['link'])) { $var[$key]['link'] = e_SELF.'?mode='.$tmp[0].'&action='.$tmp[1]; // FIXME - URL based on $modes, remove url key } + + if(varset($val['tab'])) + { + $var[$key]['link'] .= "&tab=".$val['tab']; + } + /*$var[$key]['text'] = $val['caption']; $var[$key]['link'] = (vartrue($val['url']) ? $tp->replaceConstants($val['url'], 'abs') : e_SELF).'?mode='.$tmp[0].'&action='.$tmp[1]; $var[$key]['perm'] = $val['perm']; */ diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index dd44746c8..4298103b0 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -1897,7 +1897,7 @@ class e_form $text .= ($key == "options" && !vartrue($val['noselector'])) ? $this->columnSelector($fieldarray, $columnPref) : ""; $text .= ($key == "checkboxes") ? $this->checkbox_toggle('e-column-toggle', vartrue($val['toggle'], 'multiselect')) : ""; - + $text .= " "; @@ -3126,7 +3126,7 @@ class e_form $model = $models[$fid]; $query = isset($form['query']) ? $form['query'] : e_QUERY ; $url = (isset($form['url']) ? e107::getParser()->replaceConstants($form['url'], 'abs') : e_SELF).($query ? '?'.$query : ''); - + $curTab = varset($_GET['tab'],0); $text .= "
@@ -3145,14 +3145,14 @@ class e_form $text .= '
'; foreach($data['tabs'] as $tabId=>$label) { - $active = ($tabId == 0) ? 'active' : ''; + $active = ($tabId == $curTab) ? 'active' : ''; $text .= '
'; $text .= $this->renderCreateFieldset($elid, $data, $model, $tabId); $text .= "
"; diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index d3ec25816..24fd96b48 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -262,13 +262,33 @@ class e_menu echo "\n\n"; } e107::getDB()->db_Mark_Time($mname); - if(is_numeric($mpath)) + + if(is_numeric($mpath)) // Custom Page/Menu { - $sql->db_Select("page", "*", "page_id=".intval($mpath)." "); - $page = $sql->db_Fetch(); + $sql->select("page", "*", "page_id=".intval($mpath)." "); + $page = $sql->fetch(); + $caption = $e107->tp->toHTML($page['page_title'], true, 'parse_sc, constants'); - $text = $e107->tp->toHTML($page['page_text'], true, 'parse_sc, constants'); + + if(vartrue($page['menu_template'])) // New v2.x templates. see core/menu_template.php + { + $template = e107::getCoreTemplate('menu',$page['menu_template']); + $page_shortcodes = e107::getScBatch('page',null,'cpage'); + $page_shortcodes->page = $page; + + // print_a($template['body']); + $text = $tp->parseTemplate($template['body'], true, $page_shortcodes); + // echo "TEMPLATE= ($mpath)".$page['menu_template']; + + } + else + { + + $text = $e107->tp->toHTML($page['page_text'], true, 'parse_sc, constants'); + } + e107::getRender()->tablerender($caption, $text); + } else { diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index f7b129b67..0e231aef7 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -850,6 +850,67 @@ class e_menuManager { // =----------------------------------------------------------------------------- + + function renderOptionRow($row) + { + $sql = e107::getDb(); + $tp = e107::getParser(); + $ns = e107::getRender(); + $frm = e107::getForm(); + + + $text = ""; + + $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 = (!is_numeric($row['menu_path'])) ? ' ('.substr($row['menu_path'],0,-1).')' : " ( #".$row['menu_path']." )"; + // $menuInf = $row['menu_path']; + + $text .= " + "; + + + // $text .= " + //// + // "; + + $text .= $frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf)); + + $text .= " + +   ".$pdeta."  + \n"; + } + else + { + // Menu Choices box. + $text .= "
"; + $text .= $this->menuRenderMenu($row, $menu_count,true); + $text .= "
\n"; + } + + return $text; + } + + + + + function menuRenderPage() { @@ -877,64 +938,55 @@ class e_menuManager { ...".MENLAN_37.""; $text .= ""; - $sql->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 .= " + $text .= "
\n"; } else { - $text .= "
\n"; + // $text .= "
\n"; } $color = ""; + + $pageMenu = array(); + $pluginMenu = array(); + + $sql->select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 GROUP BY menu_name ORDER BY menu_name ASC"); while ($row = $sql->fetch()) { - $pdeta = ""; - $color = ($color == "white") ? "#DDDDDD" : "white"; - if($row['menu_pages'] == "dbcustom") + if(is_numeric($row['menu_path'])) { - $pdeta = MENLAN_42; + $pageMenu[] = $row; } - else + 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 - { - // Menu Choices box. - $text .= "
"; - $text .= $this->menuRenderMenu($row, $menu_count,true); - $text .= "
\n"; + $pluginMenu[] = $row; } + } + + $text .= ""; + + foreach($pageMenu as $row) + { + $text .= $this->renderOptionRow($row); + } + + $text .= ""; + foreach($pluginMenu as $row) + { + $text .= $this->renderOptionRow($row); + } + $text .= (!$this->dragDrop) ? "
"; - - - // $text .= " - //// - // "; - - $text .= $frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf)); - - $text .= " -   ".$pdeta." 
Your Menus
Plugin Menus
" : ""; $text .= "
"; diff --git a/e107_themes/bootstrap/admin_style.css b/e107_themes/bootstrap/admin_style.css index c0b6e65e9..342b159d2 100644 --- a/e107_themes/bootstrap/admin_style.css +++ b/e107_themes/bootstrap/admin_style.css @@ -34,6 +34,7 @@ e-tabs fieldset { padding:0px ; padding-left:3px; border-top:0px;} #tab-container table { border-top:0px;} #tab-container td { border-top:0px; border-bottom:1px solid rgb(221, 221, 221) } .tab-border { border-left: 1px solid #ddd; } +.tab-content { overflow: visible } .core-mainpanel-block { text-align:center; width:110px; float:left; height:48px; display:block; padding:20px 5px 20px 5px; margin: 0px 6px 30px 6px; } .core-mainpanel-link-text { text-decoration: none; display:block; }