aboutsummaryrefslogtreecommitdiffstats
path: root/mod
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 /mod
parentc6bdf7e891f3c0b49a1e9c40622e05aef590e2b6 (diff)
downloadvolse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.tar.gz
volse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.tar.bz2
volse-hubzilla-75d521d42affbafa34e87752deeb1961367de1d5.zip
menu import and sync
Diffstat (limited to 'mod')
-rw-r--r--mod/import.php3
-rw-r--r--mod/menu.php8
-rw-r--r--mod/mitem.php3
3 files changed, 13 insertions, 1 deletions
diff --git a/mod/import.php b/mod/import.php
index 27c2094c3..0e43d2444 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -443,6 +443,9 @@ function import_post(&$a) {
if(is_array($data['event_item']))
import_items($channel,$data['event_item']);
+
+ if(is_array($data['menu']))
+ import_menus($channel,$data['menu']);
$saved_notification_flags = notifications_off($channel['channel_id']);
diff --git a/mod/menu.php b/mod/menu.php
index 7763c4ed1..bfc45adef 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -37,6 +37,7 @@ function menu_post(&$a) {
$_REQUEST['menu_id'] = intval(argv(1));
$r = menu_edit($_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$menu_id);
//info( t('Menu updated.') . EOL);
goaway(z_root() . '/mitem/' . $menu_id . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -45,7 +46,9 @@ function menu_post(&$a) {
}
else {
$r = menu_create($_REQUEST);
- if($r) {
+ if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$r);
+
//info( t('Menu created.') . EOL);
goaway(z_root() . '/mitem/' . $r . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -56,6 +59,8 @@ function menu_post(&$a) {
}
+
+
function menu_content(&$a) {
$uid = local_channel();
@@ -121,6 +126,7 @@ function menu_content(&$a) {
if(intval(argv(1))) {
if(argc() == 3 && argv(2) == 'drop') {
+ menu_sync_packet($uid,get_observer_hash(),intval(argv(1)),true);
$r = menu_delete_id(intval(argv(1)),$uid);
if(!$r)
notice( t('Menu could not be deleted.'). EOL);
diff --git a/mod/mitem.php b/mod/mitem.php
index 0fadd1548..0c3f83bdd 100644
--- a/mod/mitem.php
+++ b/mod/mitem.php
@@ -64,6 +64,7 @@ function mitem_post(&$a) {
$_REQUEST['mitem_id'] = $mitem_id;
$r = menu_edit_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element updated.') . EOL);
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . (($a->is_sys) ? '?f=&sys=1' : ''));
}
@@ -74,6 +75,7 @@ function mitem_post(&$a) {
else {
$r = menu_add_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
+ menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element added.') . EOL);
if($_REQUEST['submit']) {
goaway(z_root() . '/menu' . (($a->is_sys) ? '?f=&sys=1' : ''));
@@ -203,6 +205,7 @@ function mitem_content(&$a) {
if(argc() == 4 && argv(3) == 'drop') {
$r = menu_del_item($mitem['mitem_menu_id'], $uid, intval(argv(2)));
+ menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
if($r)
info( t('Menu item deleted.') . EOL);
else