diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-04-19 15:22:50 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-04-19 15:22:50 +0200 |
commit | 71117628bc0cba92b75caea46379b45c64c2cf43 (patch) | |
tree | 28ad9a37d0dd51d5cb94c61427f28f3fbc7e5fc7 | |
parent | dd5b97639edfb5d562ced806e27e64a6bab556b8 (diff) | |
download | volse-hubzilla-71117628bc0cba92b75caea46379b45c64c2cf43.tar.gz volse-hubzilla-71117628bc0cba92b75caea46379b45c64c2cf43.tar.bz2 volse-hubzilla-71117628bc0cba92b75caea46379b45c64c2cf43.zip |
attach an id to menues, allow $menu_title to be empty, if no custom menu class is provided use default redbasic classes
-rw-r--r-- | include/menu.php | 14 | ||||
-rw-r--r-- | view/css/widgets.css | 1 | ||||
-rw-r--r-- | view/tpl/usermenu.tpl | 27 |
3 files changed, 20 insertions, 22 deletions
diff --git a/include/menu.php b/include/menu.php index fe62d8d32..b4f4555a5 100644 --- a/include/menu.php +++ b/include/menu.php @@ -25,6 +25,7 @@ function menu_fetch($name,$uid,$observer_xchan) { } function menu_render($menu, $class='', $edit = false) { + if(! $menu) return ''; @@ -40,6 +41,7 @@ function menu_render($menu, $class='', $edit = false) { '$menu' => $menu['menu'], '$class' => $class, '$edit' => (($edit) ? t("Edit") : ''), + '$id' => $menu['menu']['menu_id'], '$items' => $menu['items'] )); } @@ -60,14 +62,13 @@ function menu_fetch_id($menu_id,$channel_id) { function menu_create($arr) { - $menu_name = trim(escape_tags($arr['menu_name'])); $menu_desc = trim(escape_tags($arr['menu_desc'])); $menu_flags = intval($arr['menu_flags']); - - if(! $menu_desc) - $menu_desc = $menu_name; + //allow menu_desc (title) to be empty + //if(! $menu_desc) + // $menu_desc = $menu_name; if(! $menu_name) return false; @@ -144,8 +145,9 @@ function menu_edit($arr) { $menu_desc = trim(escape_tags($arr['menu_desc'])); $menu_flags = intval($arr['menu_flags']); - if(! $menu_desc) - $menu_desc = $menu_name; + //allow menu_desc (title) to be empty + //if(! $menu_desc) + // $menu_desc = $menu_name; if(! $menu_name) return false; diff --git a/view/css/widgets.css b/view/css/widgets.css index 8f31a3603..566dd2b8a 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -7,7 +7,6 @@ margin-top: 0px; } - .widget .nav-pills > li > a { padding: 6px 10px; } diff --git a/view/tpl/usermenu.tpl b/view/tpl/usermenu.tpl index a5c6faa99..b05f785a8 100644 --- a/view/tpl/usermenu.tpl +++ b/view/tpl/usermenu.tpl @@ -1,16 +1,13 @@ -<div class="pmenu{{if $class}} {{$class}}{{/if}}"> -{{if $menu.menu_desc}} - <h3 class="pmenu-title">{{$menu.menu_desc}}</h3> -{{/if}} -{{if $edit}} -<a href="mitem/{{$menu.menu_id}}" title="{{$edit}}"><i class="icon-pencil fakelink" title="{{$edit}}"></i></a> -{{/if}} -{{if $items }} -<ul class="pmenu-body"> -{{foreach $items as $mitem }} -<li class="pmenu-item"><a href="{{$mitem.mitem_link}}" {{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}</a></li> -{{/foreach }} -</ul> -{{/if}} -<div class="pmenu-end"></div> +<div id="pmenu-{{$id}}" class="pmenu{{if !$class}} widget{{else}} {{$class}}{{/if}}"> + {{if $menu.menu_desc}} + <h3 class="pmenu-title">{{$menu.menu_desc}}{{if $edit}} <a href="mitem/{{$menu.menu_id}}" title="{{$edit}}"><i class="icon-pencil fakelink" title="{{$edit}}"></i></a>{{/if}}</h3> + {{/if}} + {{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> + {{/foreach }} + </ul> + {{/if}} + <div class="pmenu-end"></div> </div> |