aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/menu.php')
-rw-r--r--include/menu.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/menu.php b/include/menu.php
index 7ed931a59..32d8630a6 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -6,7 +6,7 @@ require_once('include/bbcode.php');
function menu_fetch($name,$uid,$observer_xchan) {
- $sql_options = permissions_sql($uid);
+ $sql_options = permissions_sql($uid,$observer_xchan);
$r = q("select * from menu where menu_channel_id = %d and menu_name = '%s' limit 1",
intval($uid),
@@ -388,3 +388,14 @@ function menu_del_item($menu_id,$uid,$item_id) {
return $r;
}
+function menu_sync_packet($uid,$observer_hash,$menu_id,$delete = false) {
+ $r = menu_fetch_id($menu_id,$uid);
+ if($r) {
+ $m = menu_fetch($r[0]['menu_name'],$uid,$observer_hash);
+ if($m) {
+ if($delete)
+ $m['menu_delete'] = 1;
+ build_sync_packet($uid,array('menu' => array(menu_element($m))));
+ }
+ }
+}