a bit more work on menus

This commit is contained in:
friendica 2013-08-13 01:24:02 -07:00
parent 04f8de184e
commit 55cb322489
4 changed files with 43 additions and 1 deletions

View File

@ -80,6 +80,14 @@ function menu_create($arr) {
}
function menu_list($channel_id) {
$r = q("select * from menu where menu_channel_id = %d order by menu_name",
intval($channel_id)
);
return $r;
}
function menu_edit($arr) {

View File

@ -27,6 +27,24 @@ function menu_content(&$a) {
if(argc() == 1) {
// list menus
$x = menu_list(local_user());
if($x) {
$o = replace_macros(get_markup_template('menulist.tpl'),array(
'$title' => t('Manage Menus'),
'$menus' => $x,
'$edit' => t('Edit'),
'$drop' => t('Drop'),
'$new' => t('New'),
'$hintnew' => t('Create a new menu'),
'$hintdrop' => t('Delete this menu'),
'$hintedit' => t('Edit this menu')
));
}
return $o;
}

View File

@ -1 +1 @@
2013-08-12.403
2013-08-13.404

16
view/tpl/menulist.tpl Normal file
View File

@ -0,0 +1,16 @@
<h1>{{$title}}</h1>
<a href="menu/new" title="{{$hintnew}}">{{$hintnew}}</a>
<br />
{{if $menus }}
<ul id="menulist">
{{foreach $menus as $m }}
<li>{{$m.menu_name}} <a href="menu/{{$m.menu_id}}" title="{{$hintedit}}">{{$edit}}</a>|<a href="menu/{{$m.menu.id}}/drop" title={{$hintdrop}}>{{$drop}}</a></li>
{{/foreach}}
</ul>
{{/if}}