aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-08-03 21:17:08 +0200
committerMario Vavti <mario@mariovavti.com>2016-08-03 21:17:08 +0200
commitb959641ca82d45f641a803b58dcfb91a90274956 (patch)
treefa658a7f3a8ab4f862e503ad2113fc24bffd0304 /include/menu.php
parentc50bfa07ca3a456d69d73988f42e58e3282879e9 (diff)
parent416adeb169f16fd25f7dbf54232451d8647cc999 (diff)
downloadvolse-hubzilla-b959641ca82d45f641a803b58dcfb91a90274956.tar.gz
volse-hubzilla-b959641ca82d45f641a803b58dcfb91a90274956.tar.bz2
volse-hubzilla-b959641ca82d45f641a803b58dcfb91a90274956.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include/menu.php')
-rw-r--r--include/menu.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/menu.php b/include/menu.php
index e8f1d8eb8..3b0180d37 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -25,7 +25,7 @@ function menu_fetch($name,$uid,$observer_xchan) {
return null;
}
-function menu_element($menu) {
+function menu_element($channel,$menu) {
$arr = array();
$arr['type'] = 'menu';
@@ -46,7 +46,12 @@ function menu_element($menu) {
$arr['items'] = array();
foreach($menu['items'] as $it) {
$entry = array();
+
+ $entry['link'] = str_replace(z_root() . '/channel/' . $channel['channel_address'],'[channelurl]',$it['mitem_link']);
+ $entry['link'] = str_replace(z_root() . '/page/' . $channel['channel_address'],'[pageurl]',$it['mitem_link']);
+ $entry['link'] = str_replace(z_root() . '/cloud/' . $channel['channel_address'],'[cloudurl]',$it['mitem_link']);
$entry['link'] = str_replace(z_root(),'[baseurl]',$it['mitem_link']);
+
$entry['desc'] = $it['mitem_desc'];
$entry['order'] = $it['mitem_order'];
if($it['mitem_flags']) {
@@ -389,12 +394,13 @@ function menu_del_item($menu_id,$uid,$item_id) {
function menu_sync_packet($uid,$observer_hash,$menu_id,$delete = false) {
$r = menu_fetch_id($menu_id,$uid);
+ $c = channelx_by_n($uid);
if($r) {
$m = menu_fetch($r['menu_name'],$uid,$observer_hash);
if($m) {
if($delete)
$m['menu_delete'] = 1;
- build_sync_packet($uid,array('menu' => array(menu_element($m))));
+ build_sync_packet($uid,array('menu' => array(menu_element($c,$m))));
}
}
}