aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-20 16:22:21 -0700
committerfriendica <info@friendica.com>2014-09-20 16:22:21 -0700
commit44cb423f21b6a34a138e7ffd2814fdd08788cfbe (patch)
treebbd84e79b59b3e6ccd848758a65aeae9033d37fa /include/menu.php
parent8d23a8da8dd7326d6ce9c3a64f96e5325a09d4a1 (diff)
parenta1773fea2529e6e3b1dcc816e948dacb4a250705 (diff)
downloadvolse-hubzilla-44cb423f21b6a34a138e7ffd2814fdd08788cfbe.tar.gz
volse-hubzilla-44cb423f21b6a34a138e7ffd2814fdd08788cfbe.tar.bz2
volse-hubzilla-44cb423f21b6a34a138e7ffd2814fdd08788cfbe.zip
Merge https://github.com/friendica/red into pending_merge
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) {