aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-08 17:51:48 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-08 17:52:39 -0700
commit75d521d42affbafa34e87752deeb1961367de1d5 (patch)
treeae068699ab0372837d35f73146745accb6f0ce2d /include/menu.php
parentc6bdf7e891f3c0b49a1e9c40622e05aef590e2b6 (diff)
downloadvolse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.tar.gz
volse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.tar.bz2
volse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.zip
menu import and sync
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))));
+ }
+ }
+}