aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-12 21:18:34 -0700
committerredmatrix <git@macgirvin.com>2016-05-12 21:18:34 -0700
commit2f222546da869b904f076ec17e785470b06af770 (patch)
tree6b598c3d104733ed8e07e59d5aa2047ebe880d81
parent522fec5763f35fc8c49ffd5343991b5f365c4d6f (diff)
downloadvolse-hubzilla-2f222546da869b904f076ec17e785470b06af770.tar.gz
volse-hubzilla-2f222546da869b904f076ec17e785470b06af770.tar.bz2
volse-hubzilla-2f222546da869b904f076ec17e785470b06af770.zip
Comanche: provide a variable '$region' which can be used within a layout to make content aware of where it is on the page. For instance this can be passed as a variable to a widget and trigger either a vertical or horizontal layout depending on which region it is assigned to.
-rw-r--r--Zotlabs/Render/Comanche.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index 776874e35..1017ec6aa 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -8,7 +8,6 @@ require_once('include/widgets.php');
-
class Comanche {
@@ -95,7 +94,7 @@ class Comanche {
$cnt = preg_match_all("/\[region=(.*?)\](.*?)\[\/region\]/ism", $s, $matches, PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
- \App::$layout['region_' . $mtch[1]] = $this->region($mtch[2]);
+ \App::$layout['region_' . $mtch[1]] = $this->region($mtch[2],$mtch[1]);
}
}
}
@@ -320,7 +319,9 @@ class Comanche {
}
- function region($s) {
+ function region($s,$region_name) {
+
+ $s = str_replace('$region',$region_name,$s);
$matches = array();