diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-05-10 13:26:44 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-05-10 13:26:44 -0700 |
commit | 0a644a2f416e8e4a93df6b9e0a4497071ead4b56 (patch) | |
tree | 1b01f2363c54e086224b6f9f7ad6b2d41feed255 /include/menu.php | |
parent | 37a63365f1143375a2382a26ad9b07048b9570a6 (diff) | |
parent | 2cb8b19972eb6a023eca1297f281ef9f68934c64 (diff) | |
download | volse-hubzilla-0a644a2f416e8e4a93df6b9e0a4497071ead4b56.tar.gz volse-hubzilla-0a644a2f416e8e4a93df6b9e0a4497071ead4b56.tar.bz2 volse-hubzilla-0a644a2f416e8e4a93df6b9e0a4497071ead4b56.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts:
mod/mitem.php
view/de/messages.po
view/de/strings.php
Diffstat (limited to 'include/menu.php')
-rw-r--r-- | include/menu.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/menu.php b/include/menu.php index a2e91f7ed..5c0811437 100644 --- a/include/menu.php +++ b/include/menu.php @@ -29,17 +29,33 @@ function menu_render($menu, $class='', $edit = false, $var = '') { if(! $menu) return ''; + $channel_id = ((is_array(get_app()->profile)) ? get_app()->profile['profile_uid'] : 0); + $menu_list = menu_list($channel_id); + + foreach($menu_list as $menus) { + if($menus['menu_name'] != $menu['menu']['menu_name']) + $menu_names[] = $menus['menu_name']; + } + for($x = 0; $x < count($menu['items']); $x ++) { + if(in_array($menu['items'][$x]['mitem_link'], $menu_names)) { + $m = menu_fetch($menu['items'][$x]['mitem_link'], $channel_id, get_observer_hash()); + $submenu = menu_render($m, 'dropdown-menu', $edit = false, $var = array('wrap' => 'none')); + $menu['items'][$x]['submenu'] = $submenu; + } + if($menu['items'][$x]['mitem_flags'] & MENU_ITEM_ZID) $menu['items'][$x]['mitem_link'] = zid($menu['items'][$x]['mitem_link']); + if($menu['items'][$x]['mitem_flags'] & MENU_ITEM_NEWWIN) $menu['items'][$x]['newwin'] = '1'; + $menu['items'][$x]['mitem_desc'] = bbcode($menu['items'][$x]['mitem_desc']); } $wrap = (($var['wrap'] === 'none') ? false : true); - return replace_macros(get_markup_template('usermenu.tpl'),array( + $ret = replace_macros(get_markup_template('usermenu.tpl'),array( '$menu' => $menu['menu'], '$class' => $class, '$edit' => (($edit) ? t("Edit") : ''), @@ -47,6 +63,8 @@ function menu_render($menu, $class='', $edit = false, $var = '') { '$items' => $menu['items'], '$wrap' => $wrap )); + + return $ret; } |