From d8f03450e7564f8a790ce514fa98330aa8535229 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 12 Jul 2015 00:40:12 +0200 Subject: make menu creation for sys channel work --- mod/menu.php | 2 +- mod/mitem.php | 7 +------ view/tpl/menuedit.tpl | 4 ++-- view/tpl/mitemedit.tpl | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/mod/menu.php b/mod/menu.php index f46dc9471..d1943960f 100644 --- a/mod/menu.php +++ b/mod/menu.php @@ -137,7 +137,7 @@ function menu_content(&$a) { $o = replace_macros(get_markup_template('menuedit.tpl'), array( '$header' => t('Edit Menu'), - '$menu_id' => intval(argv(1)), + '$menu_edit_link' => 'mitem/' . intval(argv(1)) . (($a->is_sys) ? '?f=&sys=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'), '*'), diff --git a/mod/mitem.php b/mod/mitem.php index c4c293d1e..e3341f5de 100644 --- a/mod/mitem.php +++ b/mod/mitem.php @@ -44,9 +44,6 @@ function mitem_post(&$a) { if(! $a->data['menu']) return; - - $channel = $a->get_channel(); - if(!$_REQUEST['mitem_desc'] || !$_REQUEST['mitem_link']) { notice( t('Unable to create element.') . EOL); return; @@ -90,9 +87,6 @@ function mitem_post(&$a) { } - - - } @@ -155,6 +149,7 @@ function mitem_content(&$a) { $create = replace_macros(get_markup_template('mitemedit.tpl'), array( '$menu_id' => $a->data['menu']['menu_id'], + '$action' => 'mitem/' . $a->data['menu']['menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''), '$permissions' => t('Menu Item Permissions'), '$permdesc' => t("\x28click to open/close\x29"), '$aclselect' => populate_acl($perm_defaults,false), diff --git a/view/tpl/menuedit.tpl b/view/tpl/menuedit.tpl index 0e5df2c47..5c8734ef7 100644 --- a/view/tpl/menuedit.tpl +++ b/view/tpl/menuedit.tpl @@ -1,9 +1,9 @@ {{if $header}}
- {{if $menu_id}} + {{if $menu_edit_link}} {{/if}}

{{$header}}

diff --git a/view/tpl/mitemedit.tpl b/view/tpl/mitemedit.tpl index 8715d6391..569552e28 100644 --- a/view/tpl/mitemedit.tpl +++ b/view/tpl/mitemedit.tpl @@ -5,7 +5,7 @@
{{/if}}