aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-04 01:42:43 -0800
committerfriendica <info@friendica.com>2014-02-04 01:42:43 -0800
commit46b9352a84a684d3e419604824f99105bea1272f (patch)
treea2363a144e05f4f19cfbab326c8d75c433a91073
parent50a1ffd24408fca66a8d957a2dcb261390fd2c0a (diff)
downloadvolse-hubzilla-46b9352a84a684d3e419604824f99105bea1272f.tar.gz
volse-hubzilla-46b9352a84a684d3e419604824f99105bea1272f.tar.bz2
volse-hubzilla-46b9352a84a684d3e419604824f99105bea1272f.zip
fix the search for system bookmarks
-rw-r--r--include/menu.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/menu.php b/include/menu.php
index be9831951..7522f69a3 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -75,7 +75,6 @@ function menu_create($arr) {
$r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d limit 1",
dbesc($menu_name),
intval($menu_channel_id),
- intval($menu_flags)
);
if($r)
@@ -101,9 +100,15 @@ function menu_create($arr) {
}
+/**
+ * If $flags is present, check that all the bits in $flags are set
+ * so that MENU_SYSTEM|MENU_BOOKMARK will return entries with both
+ * bits set. We will use this to find system generated bookmarks.
+ */
+
function menu_list($channel_id, $flags = 0) {
- $sel_options = (($flags) ? " and ( menu_flags & " . intval($flags) . " ) " : '');
+ $sel_options = (($flags) ? " and ( menu_flags & " . intval($flags) . " ) = " . intval($flags) . " " : '');
$r = q("select * from menu where menu_channel_id = %d $sel_options order by menu_name",
intval($channel_id)
@@ -204,7 +209,8 @@ function menu_add_item($menu_id, $uid, $arr) {
$channel = get_app()->get_channel();
}
- if ((! $arr['contact_allow'])
+ if (($channel)
+ && (! $arr['contact_allow'])
&& (! $arr['group_allow'])
&& (! $arr['contact_deny'])
&& (! $arr['group_deny'])) {