aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-31 20:14:25 -0700
committerredmatrix <git@macgirvin.com>2016-07-31 20:14:25 -0700
commit9b9621e10d669e7d1bc18a781c40bfc5687330c3 (patch)
treef84527d4c04d002b2ed4060de15921cc27de3cc2 /Zotlabs
parent86eb923f296ff911e3f516e9052b3edc55a02c8a (diff)
downloadvolse-hubzilla-9b9621e10d669e7d1bc18a781c40bfc5687330c3.tar.gz
volse-hubzilla-9b9621e10d669e7d1bc18a781c40bfc5687330c3.tar.bz2
volse-hubzilla-9b9621e10d669e7d1bc18a781c40bfc5687330c3.zip
add a few more path macros to portable menu elements (channelurl, pageurl, storeurl and baseurl)
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Impel.php4
-rw-r--r--Zotlabs/Module/Menu.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php
index 735c311d0..c1bf45a77 100644
--- a/Zotlabs/Module/Impel.php
+++ b/Zotlabs/Module/Impel.php
@@ -88,7 +88,11 @@ class Impel extends \Zotlabs\Web\Controller {
foreach($j['items'] as $it) {
$mitem = array();
+ $mitem['mitem_link'] = str_replace('[channelurl]',z_root() . '/channel/' . $channel['channel_address'],$it['link']);
+ $mitem['mitem_link'] = str_replace('[pageurl]',z_root() . '/page/' . $channel['channel_address'],$it['link']);
+ $mitem['mitem_link'] = str_replace('[storeurl]',z_root() . '/store/' . $channel['channel_address'],$it['link']);
$mitem['mitem_link'] = str_replace('[baseurl]',z_root(),$it['link']);
+
$mitem['mitem_desc'] = escape_tags($it['desc']);
$mitem['mitem_order'] = intval($it['order']);
if(is_array($it['flags'])) {
diff --git a/Zotlabs/Module/Menu.php b/Zotlabs/Module/Menu.php
index e98053f8c..1dec65c1f 100644
--- a/Zotlabs/Module/Menu.php
+++ b/Zotlabs/Module/Menu.php
@@ -65,7 +65,7 @@ class Menu extends \Zotlabs\Web\Controller {
- function get() {
+ function get() {
$uid = local_channel();
@@ -81,7 +81,7 @@ class Menu extends \Zotlabs\Web\Controller {
if(argc() == 1) {
-
+ $channel = (($sys) ? $sys : \App::get_channel());
// list menus
$x = menu_list($uid);
@@ -89,7 +89,7 @@ class Menu extends \Zotlabs\Web\Controller {
for($y = 0; $y < count($x); $y ++) {
$m = menu_fetch($x[$y]['menu_name'],$uid,get_observer_hash());
if($m)
- $x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($m))) . '[/element]';
+ $x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($channel,$m))) . '[/element]';
$x[$y]['bookmark'] = (($x[$y]['menu_flags'] & MENU_BOOKMARK) ? true : false);
}
}