rework and hopefully improve webpage menu creation workflow

This commit is contained in:
Mario Vavti 2015-04-21 10:05:26 +02:00
parent 6bc2766d79
commit 0bd9fe0b11
11 changed files with 255 additions and 197 deletions

View file

@ -37,7 +37,7 @@ function menu_post(&$a) {
$_REQUEST['menu_id'] = intval(argv(1));
$r = menu_edit($_REQUEST);
if($r) {
info( t('Menu updated.') . EOL);
//info( t('Menu updated.') . EOL);
goaway(z_root() . '/mitem/' . $menu_id . (($a->is_sys) ? '?f=&sys=1' : ''));
}
else
@ -46,7 +46,7 @@ function menu_post(&$a) {
else {
$r = menu_create($_REQUEST);
if($r) {
info( t('Menu created.') . EOL);
//info( t('Menu created.') . EOL);
goaway(z_root() . '/mitem/' . $r . (($a->is_sys) ? '?f=&sys=1' : ''));
}
else
@ -70,8 +70,10 @@ function menu_content(&$a) {
return '';
}
if(argc() == 1) {
// list menus
$x = menu_list($uid);
if($x) {
@ -80,14 +82,26 @@ function menu_content(&$a) {
}
}
$create = replace_macros(get_markup_template('menuedit.tpl'), array(
'$menu_name' => array('menu_name', t('Menu Name'), '', t('Unique name (not visible on webpage) - required'), '*'),
'$menu_desc' => array('menu_desc', t('Menu Title'), '', t('Visible on webpage - leave empty for no title'), ''),
'$menu_bookmark' => array('menu_bookmark', t('Allow Bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
'$submit' => t('Submit and proceed'),
'$sys' => $a->is_sys,
'$display' => 'none'
));
$o = replace_macros(get_markup_template('menulist.tpl'),array(
'$title' => t('Manage Menus'),
'$title' => t('Menus'),
'$create' => $create,
'$menus' => $x,
'$nametitle' => t('Menu Name'),
'$desctitle' => t('Menu Title'),
'$edit' => t('Edit'),
'$drop' => t('Drop'),
'$new' => t('New'),
'$bmark' => t('Bookmarks allowed'),
'$hintnew' => t('Create a new menu'),
'$hintnew' => t('Create'),
'$hintdrop' => t('Delete this menu'),
'$hintcontent' => t('Edit menu contents'),
'$hintedit' => t('Edit this menu'),
@ -98,50 +112,38 @@ function menu_content(&$a) {
}
if(argc() > 1) {
if(argv(1) === 'new') {
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
'$header' => t('New Menu'),
'$menu_name' => array('menu_name', t('Menu name'), '', t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), '', t('Menu title as seen by others'), ''),
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), ''),
'$submit' => t('Create'),
'$sys' => $a->is_sys
));
if(intval(argv(1))) {
return $o;
}
elseif(intval(argv(1))) {
$m = menu_fetch_id(intval(argv(1)),$uid);
if(! $m) {
notice( t('Menu not found.') . EOL);
return '';
}
if(argc() == 3 && argv(2) == 'drop') {
$r = menu_delete_id(intval(argv(1)),$uid);
if($r)
info( t('Menu deleted.') . EOL);
else
if(!$r)
notice( t('Menu could not be deleted.'). EOL);
goaway(z_root() . '/menu' . (($a->is_sys) ? '?f=&sys=1' : ''));
}
else {
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
'$header' => t('Edit Menu'),
'$menu_id' => intval(argv(1)),
'$hintedit' => t('Add or remove entries to this menu'),
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), ''),
'$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
'$submit' => t('Modify')
));
return $o;
$m = menu_fetch_id(intval(argv(1)),$uid);
if(! $m) {
notice( t('Menu not found.') . EOL);
return '';
}
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
'$header' => t('Edit Menu'),
'$menu_id' => intval(argv(1)),
'$hintedit' => t('Add or remove entries to this menu'),
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), ''),
'$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
'$submit' => t('Modify')
));
return $o;
}
else {
notice( t('Not found.') . EOL);

View file

@ -41,14 +41,17 @@ function mitem_post(&$a) {
return;
}
if(! $a->data['menu'])
return;
$channel = $a->get_channel();
if(!$_REQUEST['mitem_desc'] || !$_REQUEST['mitem_link']) {
notice( t('Unable to create element.') . EOL);
return;
}
$_REQUEST['mitem_channel_id'] = $uid;
$_REQUEST['menu_id'] = $a->data['menu']['menu_id'];
@ -64,7 +67,7 @@ function mitem_post(&$a) {
$_REQUEST['mitem_id'] = $mitem_id;
$r = menu_edit_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
info( t('Menu element updated.') . EOL);
//info( t('Menu element updated.') . EOL);
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''));
}
else
@ -74,8 +77,13 @@ function mitem_post(&$a) {
else {
$r = menu_add_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
info( t('Menu element added.') . EOL);
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''));
//info( t('Menu element added.') . EOL);
if($_REQUEST['submit']) {
goaway(z_root() . '/menu' . (($a->is_sys) ? '?f=&sys=1' : ''));
}
if($_REQUEST['submit-more']) {
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . '?f=&display=block' . (($a->is_sys) ? '&sys=1' : '') );
}
}
else
notice( t('Unable to add menu element.') . EOL);
@ -84,6 +92,7 @@ function mitem_post(&$a) {
}
@ -115,28 +124,58 @@ function mitem_content(&$a) {
$m = menu_fetch($a->data['menu']['menu_name'],$uid,$ob_hash);
$a->data['menu_item'] = $m;
if(argc() == 2) {
$r = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d order by mitem_order asc, mitem_desc asc",
intval($a->data['menu']['menu_id']),
intval($uid)
);
$perm_defaults = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
if($_GET['display']) {
$display = $_GET['display'];
}
else {
$display = (($r) ? 'none' : 'block');
}
$create = replace_macros(get_markup_template('mitemedit.tpl'), array(
'$menu_id' => $a->data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($perm_defaults,false),
'$mitem_desc' => array('mitem_desc', t('Link Name'), '', 'Visible name of the link','*'),
'$mitem_link' => array('mitem_link', t('Link Target'), '', 'URL of the link', '*'),
'$usezid' => array('usezid', t('Use RedMatrix magic-auth if available'), true, ''),
'$newwin' => array('newwin', t('Open link in new window'), false,''),
'$mitem_order' => array('mitem_order', t('Order in list'),'0',t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Submit and finish'),
'$submit_more' => t('Submit and continue'),
'$display' => $display
));
$o .= replace_macros(get_markup_template('mitemlist.tpl'),array(
'$title' => t('Manage Menu Elements'),
'$menuname' => $a->data['menu']['menu_name'],
'$menudesc' => $a->data['menu']['menu_desc'],
'$edmenu' => t('Edit menu'),
'$menu_id' => $a->data['menu']['menu_id'],
'$mlist' => $r,
'$edit' => t('Edit element'),
'$drop' => t('Drop element'),
'$new' => t('New element'),
'$hintmenu' => t('Edit this menu container'),
'$hintnew' => t('Add menu element'),
'$hintdrop' => t('Delete this menu item'),
'$hintedit' => t('Edit this menu item')
'$title' => t('Menu:'),
'$create' => $create,
'$nametitle' => t('Link Name'),
'$targettitle' => t('Link Target'),
'$menuname' => $a->data['menu']['menu_name'],
'$menudesc' => $a->data['menu']['menu_desc'],
'$edmenu' => t('Edit menu'),
'$menu_id' => $a->data['menu']['menu_id'],
'$mlist' => $r,
'$edit' => t('Edit element'),
'$drop' => t('Drop element'),
'$new' => t('New element'),
'$hintmenu' => t('Edit this menu container'),
'$hintnew' => t('Add menu element'),
'$hintdrop' => t('Delete this menu item'),
'$hintedit' => t('Edit this menu item')
));
return $o;
@ -145,38 +184,13 @@ function mitem_content(&$a) {
if(argc() > 2) {
if(argv(2) === 'new') {
if(intval(argv(2))) {
$perm_defaults = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
$o = replace_macros(get_markup_template('mitemedit.tpl'), array(
'$header' => t('New Menu Element'),
'$menu_id' => $a->data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($perm_defaults,false),
'$mitem_desc' => array('mitem_desc', t('Link text'), '', '','*'),
'$mitem_link' => array('mitem_link', t('URL of link'), '', '', '*'),
'$usezid' => array('usezid', t('Use RedMatrix magic-auth if available'), true, ''),
'$newwin' => array('newwin', t('Open link in new window'), false,''),
// permissions go here
'$mitem_order' => array('mitem_order', t('Order in list'),'0',t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Create')
));
return $o;
}
elseif(intval(argv(2))) {
$m = q("select * from menu_item where mitem_id = %d and mitem_channel_id = %d limit 1",
intval(argv(2)),
intval($uid)
);
if(! $m) {
notice( t('Menu item not found.') . EOL);
goaway(z_root() . '/menu'. (($a->is_sys) ? '?f=&sys=1' : ''));
@ -193,27 +207,24 @@ function mitem_content(&$a) {
goaway(z_root() . '/mitem/' . $mitem['mitem_menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''));
}
else {
// edit menu item
// edit menu item
$o = replace_macros(get_markup_template('mitemedit.tpl'), array(
'$header' => t('Edit Menu Element'),
'$menu_id' => $a->data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($mitem,false),
'$mitem_id' => intval(argv(2)),
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
'$mitem_link' => array('mitem_link', t('URL of link'), $mitem['mitem_link'], '', '*'),
'$usezid' => array('usezid', t('Use RedMatrix magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), ''),
'$newwin' => array('newwin', t('Open link in new window'), (($mitem['mitem_flags'] & MENU_ITEM_NEWWIN) ? 1 : 0),''),
'$mitem_order' => array('mitem_order', t('Order in list'),$mitem['mitem_order'],t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Submit')
));
$o = replace_macros(get_markup_template('mitemedit.tpl'), array(
'$header' => t('Edit Menu Element'),
'$menu_id' => $a->data['menu']['menu_id'],
'$permissions' => t('Menu Item Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$aclselect' => populate_acl($mitem,false),
'$mitem_id' => intval(argv(2)),
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
'$mitem_link' => array('mitem_link', t('URL of link'), $mitem['mitem_link'], '', '*'),
'$usezid' => array('usezid', t('Use RedMatrix magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), ''),
'$newwin' => array('newwin', t('Open link in new window'), (($mitem['mitem_flags'] & MENU_ITEM_NEWWIN) ? 1 : 0),''),
// permissions go here
'$mitem_order' => array('mitem_order', t('Order in list'),$mitem['mitem_order'],t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Modify')
));
return $o;
}
return $o;
}
}
}

View file

@ -1,3 +1,11 @@
#menulist > li {
margin-top: 15px;
}
#menu-list-table {
width: 100%;
}
#menu-list-table th:nth-child(2){
white-space: nowrap;
}
.menu-list-tool {
padding: 7px 10px;
}

View file

@ -1,11 +1,13 @@
.menu-item-list {
list-style-type: none;
#mitem-list-table {
width: 100%;
}
.mitem-edit {
margin-right: 15px;
#mitem-list-table th:nth-child(1),
#mitem-list-table td:nth-child(1){
padding: 7px 3px 7px 10px;
white-space: nowrap;
}
.menu-item-list li {
margin-bottom: 15px;
}
.mitem-list-tool {
padding: 7px 10px;
}

View file

@ -1102,8 +1102,6 @@ nav .acpopup {
.required {
color: #ff0000;
font-size: 1.8rem;
margin-left: 5px;
}
@ -1934,7 +1932,9 @@ nav .dropdown-menu {
background-color: $item_colour;
}
[id^="webpage-list-item-"]:hover td {
[id^="webpage-list-item-"]:hover td,
[id^="menu-list-item-"]:hover td,
[id^="mitem-list-item-"]:hover td {
background-color: $item_colour;
}

View file

@ -1,6 +1,6 @@
<div class='form-group field input'>
<label for='id_{{$field.0}}' id='label_{{$field.0}}'>{{$field.1}}</label>
<input class="form-control" name='{{$field.0}}' id='id_{{$field.0}}' type="text" value="{{$field.2}}"{{if $field.5}} {{$field.5}}{{/if}}>{{if $field.4}} <span class="required">{{$field.4}}</span> {{/if}}
<label for='id_{{$field.0}}' id='label_{{$field.0}}'>{{$field.1}}{{if $field.4}}<span class="required"> {{$field.4}}</span>{{/if}}</label>
<input class="form-control" name='{{$field.0}}' id='id_{{$field.0}}' type="text" value="{{$field.2}}"{{if $field.5}} {{$field.5}}{{/if}}>
<span id='help_{{$field.0}}' class='help-block'>{{$field.3}}</span>
<div class="clear"></div>
</div>

View file

@ -1,24 +1,28 @@
<h2>{{$header}}</h2>
{{if $menu_id}}
<a href="mitem/{{$menu_id}}" title="{{$hintedit}}">{{$editcontents}}</a>
{{/if}}
<form id="menuedit" action="menu{{if $menu_id}}/{{$menu_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" >
{{if $menu_id}}
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
{{/if}}
{{if $menu_system}}
<input type="hidden" name="menu_system" value="{{$menu_system}}" />
{{/if}}
{{include file="field_input.tpl" field=$menu_name}}
{{include file="field_input.tpl" field=$menu_desc}}
{{include file="field_checkbox.tpl" field=$menu_bookmark}}
<div class="menuedit-submit-wrapper" >
<input type="submit" name="submit" class="menuedit-submit" value="{{$submit}}" />
{{if $header}}
<div class="section-title-wrapper">
{{if $menu_id}}
<div class="pull-right">
<a href="mitem/{{$menu_id}}" title="{{$hintedit}}" class="btn btn-xs btn-success"><i class="icon-edit"></i>&nbsp;{{$editcontents}}</a>
</div>
{{/if}}
<h2>{{$header}}</h2>
<div class="clear"></div>
</div>
{{/if}}
<div id="menu-creator" class="section-content-tools-wrapper" style="display: {{$display}};">
<form id="menuedit" action="menu{{if $menu_id}}/{{$menu_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" >
{{if $menu_id}}
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
{{/if}}
{{if $menu_system}}
<input type="hidden" name="menu_system" value="{{$menu_system}}" />
{{/if}}
{{include file="field_input.tpl" field=$menu_name}}
{{include file="field_input.tpl" field=$menu_desc}}
{{include file="field_checkbox.tpl" field=$menu_bookmark}}
<div class="menuedit-submit-wrapper form-group pull-right" >
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
</div>
<div class="clear"></div>
</form>
</div>
</form>

View file

@ -1,16 +1,32 @@
<div class="generic-content-wrapper-styled">
<h1>{{$title}}</h1>
<a href="menu/new{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintnew}}">{{$hintnew}}</a>
<br>
<div class="section-title-wrapper">
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('menu-creator');"><i class="icon-edit"></i>&nbsp;{{$hintnew}}</button>
</div>
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
{{$create}}
{{if $menus }}
<ul id="menulist">
{{foreach $menus as $m }}
<li>
<a href="menu/{{$m.menu_id}}{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintedit}}"><i class="icon-pencil design-icons design-edit-icon btn btn-default"></i></a>
<a href="menu/{{$m.menu_id}}/drop{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintdrop}}"><i class="icon-trash drop-icons design-icons design-remove-icon btn btn-default"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;{{if $m.bookmark}}<i class="icon-bookmark" title="{{$bmark}}" ></i>&nbsp;{{/if}}<a href="mitem/{{$m.menu_id}}/new{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintcontent}}">{{$m.menu_name}}</a>
</li>
{{/foreach}}
</ul>
<div id="menulist-content-wrapper" class="section-content-wrapper-np">
<table id="menu-list-table">
<tr>
<th width="1%"></th>
<th width="1%">{{$nametitle}}</th>
<th width="96%">{{$desctitle}}</th>
<th width="1%"></th>
<th width="1%"></th>
</tr>
{{foreach $menus as $m }}
<tr id="menu-list-item-{{$m.menu_id}}">
<td width="1%">{{if $m.bookmark}}<i class="icon-bookmark menu-list-tool" title="{{$bmark}}" ></i>{{/if}}</td>
<td width="1%"><a href="mitem/{{$m.menu_id}}{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintcontent}}">{{$m.menu_name}}</a></td>
<td width="96%">{{$m.menu_desc}}</td>
<td width="1%" class="menu-list-tool"><a href="menu/{{$m.menu_id}}{{if $sys}}?f=&sys=1{{/if}}" title="{{$hintedit}}"><i class="icon-pencil"></i></a></td>
<td width="1%" class="menu-list-tool"><a href="#" title="{{$hintdrop}}" onclick="dropItem('menu/{{$m.menu_id}}/drop{{if $sys}}?f=&sys=1{{/if}}', '#menu-list-item-{{$m.menu_id}}'); return false;"><i class="icon-trash drop-icons"></i></a></td>
</tr>
{{/foreach}}
</table>
</div>
{{/if}}
</div>

View file

@ -1,32 +1,33 @@
<h2>{{$header}}</h2>
<form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}" method="post" >
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
{{if $mitem_id}}
<input type="hidden" name="mitem_id" value="{{$mitem_id}}" />
{{if $header}}
<div class="section-title-wrapper">
<h2>{{$header}}</h2>
</div>
{{/if}}
<div id="menu-element-creator" class="section-content-tools-wrapper" style="display: {{$display}};">
<form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}" method="post" >
{{include file="field_input.tpl" field=$mitem_desc}}
{{include file="field_input.tpl" field=$mitem_link}}
{{include file="field_input.tpl" field=$mitem_order}}
{{include file="field_checkbox.tpl" field=$usezid}}
{{include file="field_checkbox.tpl" field=$newwin}}
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
<div id="settings-default-perms" class="settings-default-perms" >
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
{{$aclselect}}
<div id="settings-default-perms-menu-end"></div>
{{if $mitem_id}}
<input type="hidden" name="mitem_id" value="{{$mitem_id}}" />
{{/if}}
{{include file="field_input.tpl" field=$mitem_desc}}
{{include file="field_input.tpl" field=$mitem_link}}
{{include file="field_input.tpl" field=$mitem_order}}
{{include file="field_checkbox.tpl" field=$usezid}}
{{include file="field_checkbox.tpl" field=$newwin}}
<div id="settings-default-perms" class="settings-default-perms form-group">
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
{{$aclselect}}
</div>
<div class="mitemedit-submit-wrapper" >
{{if $submit_more}}
<input type="submit" name="submit-more" class="mitemedit-submit" value="{{$submit_more}}" />
{{/if}}
<input type="submit" name="submit" class="mitemedit-submit" value="{{$submit}}" />
</div>
</form>
</div>
<br/>
<div id="settings-default-perms-end"></div>
<div class="mitemedit-submit-wrapper" >
<input id="dbtn-submit" type="submit" name="submit" class="mitemedit-submit" value="{{$submit}}" />
</div>
</form>

View file

@ -1,18 +1,32 @@
<h1>{{$title}}</h1>
<h2>{{$menudesc}} ({{$menuname}})</h2>
<div class="section-title-wrapper">
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('menu-element-creator');"><i class="icon-edit"></i>&nbsp;{{$hintnew}}</button>
</div>
<h2>{{$title}} {{if $menudesc}}{{$menudesc}}{{else}}{{$menuname}}{{/if}}</h2>
<div class="clear"></div>
</div>
<a href="menu/{{$menu_id}}" title="{{$hintmenu}}">{{$edmenu}}</a><br />
<a href="mitem/{{$menu_id}}/new" title="{{$hintnew}}">{{$hintnew}}</a>
<br />
<br />
{{$create}}
{{if $mlist }}
<ul id="mitemlist" class="menu-item-list">
{{foreach $mlist as $m }}
<li><a href="mitem/{{$menu_id}}/{{$m.mitem_id}}" title="{{$hintedit}}"><i class="icon-pencil mitem-edit btn btn-default"></i></a><a href="mitem/{{$menu_id}}/{{$m.mitem_id}}/drop" title={{$hintdrop}}><i class="icon-trash btn btn-default"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="mitem/{{$menu_id}}/{{$m.mitem_id}}" title="{{$hintcontent}}">{{$m.mitem_desc}}</a> ({{$m.mitem_link}})</li>
{{/foreach}}
</ul>
<div id="mitemlist-content-wrapper" class="section-content-wrapper-np">
<table id="mitem-list-table">
<tr>
<th width="1%">{{$nametitle}}</th>
<th width="97%">{{$targettitle}}</th>
<th width="1%"></th>
<th width="1%"></th>
</tr>
{{foreach $mlist as $m }}
<tr id="mitem-list-item-{{$m.mitem_id}}">
<td width="1%">{{$m.mitem_desc}}</td>
<td width="97%"><a href="{{$m.mitem_link}}">{{$m.mitem_link}}</a></td>
<td width="1%" class="mitem-list-tool"><a href="mitem/{{$menu_id}}/{{$m.mitem_id}}" title="{{$hintedit}}"><i class="icon-pencil"></i></a></td>
<td width="1%" class="mitem-list-tool"><a href="#" title="{{$hintdrop}}" onclick="dropItem('mitem/{{$menu_id}}/{{$m.mitem_id}}/drop', '#mitem-list-item-{{$m.mitem_id}}, #pmenu-item-{{$m.mitem_id}}'); return false;"><i class="icon-trash drop-icons"></i></a></td>
</tr>
{{/foreach}}
</table>
</div>
{{/if}}

View file

@ -5,7 +5,7 @@
{{if $items }}
<ul class="pmenu-body{{if !$class}} nav nav-pills nav-stacked{{/if}}">
{{foreach $items as $mitem }}
<li class="pmenu-item"><a href="{{$mitem.mitem_link}}" {{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}</a></li>
<li id="pmenu-item-{{$mitem.mitem_id}}" class="pmenu-item"><a href="{{$mitem.mitem_link}}" {{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}</a></li>
{{/foreach }}
</ul>
{{/if}}