mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Reworked storage of custom menus.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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; }
|
||||
|
||||
|
||||
|
@@ -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. ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -167,6 +167,39 @@ class cpage_shortcodes extends e_shortcode
|
||||
}
|
||||
return '<a class="cpage" href="'.$url.'">'.$this->sc_cpagetitle().'</a>';
|
||||
}
|
||||
|
||||
function sc_cpagebutton($parm)
|
||||
{
|
||||
$url = $this->sc_cpageurl();
|
||||
|
||||
if($parm == 'href' || !$url)
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
return '<a class="cpage btn btn-small" href="'.$url.'">Read More..</a>';
|
||||
}
|
||||
|
||||
|
||||
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 "<img src='".$img."' alt='' />";
|
||||
}
|
||||
|
||||
|
||||
function sc_cpageurl()
|
||||
{
|
||||
|
@@ -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;
|
||||
# --------------------------------------------------------
|
||||
|
@@ -95,14 +95,7 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
|
||||
$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?
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -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']; */
|
||||
|
@@ -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 .= "
|
||||
</th>
|
||||
";
|
||||
@@ -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 .= "
|
||||
<form method='post' action='".$url."' id='{$form['id']}-form' enctype='multipart/form-data'>
|
||||
@@ -3145,14 +3145,14 @@ class e_form
|
||||
$text .= '<ul class="nav nav-tabs">';
|
||||
foreach($data['tabs'] as $i=>$label)
|
||||
{
|
||||
$class = ($i == 0) ? 'class="active" ' : '';
|
||||
$class = ($i == $curTab) ? 'class="active" ' : '';
|
||||
$text .= '<li '.$class.'><a href="#tab'.$i.'" data-toggle="tab">'.$label.'</a></li>';
|
||||
}
|
||||
$text .= ' </ul><div class="tab-content">';
|
||||
|
||||
foreach($data['tabs'] as $tabId=>$label)
|
||||
{
|
||||
$active = ($tabId == 0) ? 'active' : '';
|
||||
$active = ($tabId == $curTab) ? 'active' : '';
|
||||
$text .= '<div class="tab-pane '.$active.'" id="tab'.$tabId.'">';
|
||||
$text .= $this->renderCreateFieldset($elid, $data, $model, $tabId);
|
||||
$text .= "</div>";
|
||||
|
@@ -262,13 +262,33 @@ class e_menu
|
||||
echo "\n<!-- Menu Start: ".$mname." -->\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
|
||||
{
|
||||
|
@@ -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 .= "<tr style='background-color:$color;color:black'>
|
||||
<td style='text-align:left; color:black;' class='checkbox'>";
|
||||
|
||||
|
||||
// $text .= "
|
||||
//// <input type='checkbox' id='menuselect-{$row['menu_id']}' name='menuselect[]' value='{$row['menu_id']}' />
|
||||
// <label class='selection-row' for='menuselect-{$row['menu_id']}'>".$row['menu_name'].$menuInf."</label>";
|
||||
|
||||
$text .= $frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf));
|
||||
|
||||
$text .= "
|
||||
</td>
|
||||
<td style='color:black'> ".$pdeta." </td>
|
||||
</tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Menu Choices box.
|
||||
$text .= "<div class='portlet block block-archive' id='block-".$row['menu_id']."' style='border:1px outset black;text-align:left;color:black'>";
|
||||
$text .= $this->menuRenderMenu($row, $menu_count,true);
|
||||
$text .= "</div>\n";
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function menuRenderPage()
|
||||
{
|
||||
@@ -877,64 +938,55 @@ class e_menuManager {
|
||||
<td style='width:50%;padding-bottom:4px;text-align:center'>...".MENLAN_37."</td></tr>";
|
||||
$text .= "<tr><td style='width:35%;vertical-align:top;text-align:center'>";
|
||||
|
||||
$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 .= "<div class='column' id='portal-column-block-list' style='border:1px inset black;height:250px;display:block;overflow:auto;margin-bottom:20px'>";
|
||||
$text .= "<table class='table-striped core-menumanager-main' id='core-menumanager-main' >
|
||||
$text .= "<table class='table table-striped core-menumanager-main' id='core-menumanager-main' >
|
||||
<tbody>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<div class='column' id='remove' style='border:1px solid silver'>\n";
|
||||
// $text .= "<div class='column' id='remove' style='border:1px solid silver'>\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 .= "<tr style='background-color:$color;color:black'>
|
||||
<td style='text-align:left; color:black;'>";
|
||||
|
||||
|
||||
// $text .= "
|
||||
//// <input type='checkbox' id='menuselect-{$row['menu_id']}' name='menuselect[]' value='{$row['menu_id']}' />
|
||||
// <label class='selection-row' for='menuselect-{$row['menu_id']}'>".$row['menu_name'].$menuInf."</label>";
|
||||
|
||||
$text .= $frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf));
|
||||
|
||||
$text .= "
|
||||
</td>
|
||||
<td style='color:black'> ".$pdeta." </td>
|
||||
</tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Menu Choices box.
|
||||
$text .= "<div class='portlet block block-archive' id='block-".$row['menu_id']."' style='border:1px outset black;text-align:left;color:black'>";
|
||||
$text .= $this->menuRenderMenu($row, $menu_count,true);
|
||||
$text .= "</div>\n";
|
||||
$pluginMenu[] = $row;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$text .= "<tr><th colspan='2'>Your Menus</th></tr>";
|
||||
|
||||
foreach($pageMenu as $row)
|
||||
{
|
||||
$text .= $this->renderOptionRow($row);
|
||||
}
|
||||
|
||||
$text .= "<tr><th colspan='2' >Plugin Menus</th></tr>";
|
||||
foreach($pluginMenu as $row)
|
||||
{
|
||||
$text .= $this->renderOptionRow($row);
|
||||
}
|
||||
|
||||
$text .= (!$this->dragDrop) ? "</tbody></table>" : "";
|
||||
$text .= "</div>";
|
||||
|
||||
|
@@ -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; }
|
||||
|
Reference in New Issue
Block a user