aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/menu.php14
-rw-r--r--view/css/widgets.css1
-rw-r--r--view/tpl/usermenu.tpl27
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>