aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-09-20 16:31:56 +0200
committermarijus <mario@mariovavti.com>2014-09-20 16:31:56 +0200
commitbd54358aa6bfe90bfbc8aed7baf3a8110d6e45ba (patch)
tree54d5f45f497c5ff3cfd48c316aa3df9a0da60e50 /include/menu.php
parent9feb619bea39824823ce39ca203b92fb6b68e6fb (diff)
downloadvolse-hubzilla-bd54358aa6bfe90bfbc8aed7baf3a8110d6e45ba.tar.gz
volse-hubzilla-bd54358aa6bfe90bfbc8aed7baf3a8110d6e45ba.tar.bz2
volse-hubzilla-bd54358aa6bfe90bfbc8aed7baf3a8110d6e45ba.zip
show bookmarks menu only if we have any bookmarks already
Diffstat (limited to 'include/menu.php')
-rw-r--r--include/menu.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/menu.php b/include/menu.php
index 4b0a11f10..8997d2e39 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -124,7 +124,17 @@ function menu_list($channel_id, $name = '', $flags = 0) {
return $r;
}
+function menu_list_count($channel_id, $name = '', $flags = 0) {
+ $sel_options = '';
+ $sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : '');
+ $sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : '');
+
+ $r = q("select count(*) as total from menu where menu_channel_id = %d $sel_options",
+ intval($channel_id)
+ );
+ return $r[0]['total'];
+}
function menu_edit($arr) {