1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-15 10:02:02 +02:00

Pages/Menu: Menu-Options tab added with custom button text and url.

This commit is contained in:
Cameron 2014-06-28 18:38:15 -07:00
parent 24c2cb33e9
commit 8ded7c1fd1
3 changed files with 13 additions and 4 deletions

View File

@ -430,7 +430,7 @@ 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', 'name' => 'page_sef'), 'name' => 'page_title', 'description' => ''); // 'link' only needed if profile not provided.
protected $tabs = array("Page","Page Options","Menu");
protected $tabs = array("Page","Page Options","Menu", "Menu Options");
protected $featurebox = array('name'=>'page_title', 'description'=>'page_text', 'image' => 'menu_image', 'visibility' => 'page_class', 'url' => true);
/*
@ -477,7 +477,10 @@ class page_admin_ui extends e_admin_ui
'menu_title' => array('title'=> "Menu Title", 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Caption displayed on the menu item.", 'writeParms'=>'size=xxlarge'),
'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_template' => array('title'=> "Menu Template", 'nolist'=>true, 'tab' => 2, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
'menu_class' => array('title'=> LAN_USERCLASS, 'tab' => 2, 'type' => 'userclass', 'data'=>'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true),
'menu_class' => array('title'=> LAN_VISIBILITY, 'tab' => 3, 'type' => 'userclass', 'data'=>'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true),
'menu_button_text' => array('title'=> "Custom Button Text", 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Leave blank to use the default"),
'menu_button_url' => array('title'=> "Custom Button URL", 'nolist'=>true, 'tab' => 3, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Leave blank to use the corresponding page", 'writeParms'=>'size=xxlarge'),
'menu_icon' => array('title' =>"Menu Icon/Glyph", 'nolist'=>true, 'tab' => 2, 'type' => 'icon', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParms'=>'media=page&glyphs=1', 'readonly'=>false),

View File

@ -244,6 +244,7 @@ class cpage_shortcodes extends e_shortcode
function sc_cpagebutton($parm)
{
$tp = e107::getParser();
if(!check_class($this->var['page_class']))
{
@ -264,11 +265,14 @@ class cpage_shortcodes extends e_shortcode
parse_str($parm,$options);
$text = vartrue($options['text'], LAN_READ_MORE);
$buttonText = (empty($this->var['menu_button_text'])) ? LAN_READ_MORE : $this->var['menu_button_text'];
$buttonUrl = (empty($this->var['menu_button_url'])) ? $url : $tp->replaceConstants($this->var['menu_button_url']);
$text = vartrue($options['text'], $buttonText);
$size = vartrue($options['size'], "");
$inc = ($size) ? " btn-".$size : "";
return '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$url.'">'.$text.'</a>';
return '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$buttonUrl.'">'.$text.'</a>';
}

View File

@ -394,6 +394,8 @@ CREATE TABLE page (
menu_icon varchar(250) NOT NULL default '',
menu_template varchar(50) NOT NULL default '',
menu_class varchar(250) NOT NULL default '0',
menu_button_url varchar(250) NOT NULL default '',
menu_button_text varchar(250) NOT NULL default '',
PRIMARY KEY (page_id)
) ENGINE=MyISAM;