diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-05-07 23:02:14 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-05-07 23:02:14 +0200 |
commit | cd8ecb86499c7b1fdaff44653cf3771c60ee2454 (patch) | |
tree | ea997acd1c98f009020a84411e54396c614ed1e5 /include/comanche.php | |
parent | ef384be35f745ea0553041808b31fecddce58687 (diff) | |
download | volse-hubzilla-cd8ecb86499c7b1fdaff44653cf3771c60ee2454.tar.gz volse-hubzilla-cd8ecb86499c7b1fdaff44653cf3771c60ee2454.tar.bz2 volse-hubzilla-cd8ecb86499c7b1fdaff44653cf3771c60ee2454.zip |
provide wrap variable for comanche menus
Diffstat (limited to 'include/comanche.php')
-rw-r--r-- | include/comanche.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/comanche.php b/include/comanche.php index 630c4f655..f385f3c5a 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -101,11 +101,22 @@ function comanche_parser(&$a, $s, $pass = 0) { } -function comanche_menu($name, $class = '') { +function comanche_menu($s, $class = '') { + $channel_id = comanche_get_channel_id(); + $name = $s; + + $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $s, $matches, PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $var[$mtch[1]] = $mtch[2]; + $name = str_replace($mtch[0], '', $name); + } + } + if($channel_id) { $m = menu_fetch($name,$channel_id, get_observer_hash()); - return menu_render($m, $class); + return menu_render($m, $class, $edit = false, $var); } } |