aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/menu.php8
-rw-r--r--mod/menu.php18
-rw-r--r--version.inc2
-rw-r--r--view/tpl/menulist.tpl16
4 files changed, 43 insertions, 1 deletions
diff --git a/include/menu.php b/include/menu.php
index ad9d3eb1c..951a2b1fe 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -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) {
diff --git a/mod/menu.php b/mod/menu.php
index 3198027f4..a624b4727 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -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;
+
+
+
+
}
diff --git a/version.inc b/version.inc
index d95786ab1..551ca203d 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-08-12.403
+2013-08-13.404
diff --git a/view/tpl/menulist.tpl b/view/tpl/menulist.tpl
new file mode 100644
index 000000000..3ad92cb7e
--- /dev/null
+++ b/view/tpl/menulist.tpl
@@ -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}}
+
+
+