aboutsummaryrefslogtreecommitdiffstats
path: root/include/comanche.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
committerfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
commit22391a24378cae317cdf62dc4be4b31b68e8191f (patch)
treeeca9be09c179ab036625dd64fbaea91d181f87fc /include/comanche.php
parente73d0ee418564eb32517f86930c78384ca3bd52d (diff)
downloadvolse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.gz
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.bz2
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.zip
straighten out some directory stuff, which required some Comanche structural changes
Diffstat (limited to 'include/comanche.php')
-rw-r--r--include/comanche.php66
1 files changed, 35 insertions, 31 deletions
diff --git a/include/comanche.php b/include/comanche.php
index e8d3ca5a1..1ddabb693 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -43,7 +43,7 @@ function pdl_selector($uid, $current="") {
-function comanche_parser(&$a, $s) {
+function comanche_parser(&$a, $s, $pass = 0) {
$matches = array();
$cnt = preg_match_all("/\[comment\](.*?)\[\/comment\]/ism", $s, $matches, PREG_SET_ORDER);
@@ -53,43 +53,47 @@ function comanche_parser(&$a, $s) {
}
}
- $cnt = preg_match("/\[layout\](.*?)\[\/layout\]/ism", $s, $matches);
- if($cnt)
- $a->page['template'] = trim($matches[1]);
+ if($pass == 0) {
+ $cnt = preg_match("/\[layout\](.*?)\[\/layout\]/ism", $s, $matches);
+ if($cnt)
+ $a->page['template'] = trim($matches[1]);
- $cnt = preg_match("/\[template=(.*?)\](.*?)\[\/template\]/ism", $s, $matches);
- if($cnt) {
- $a->page['template'] = trim($matches[2]);
- $a->page['template_style'] = trim($matches[2]) . '_' . $matches[1];
- }
+ $cnt = preg_match("/\[template=(.*?)\](.*?)\[\/template\]/ism", $s, $matches);
+ if($cnt) {
+ $a->page['template'] = trim($matches[2]);
+ $a->page['template_style'] = trim($matches[2]) . '_' . $matches[1];
+ }
- $cnt = preg_match("/\[template\](.*?)\[\/template\]/ism", $s, $matches);
- if($cnt) {
- $a->page['template'] = trim($matches[1]);
- }
+ $cnt = preg_match("/\[template\](.*?)\[\/template\]/ism", $s, $matches);
+ if($cnt) {
+ $a->page['template'] = trim($matches[1]);
+ }
- $cnt = preg_match("/\[theme=(.*?)\](.*?)\[\/theme\]/ism", $s, $matches);
- if($cnt) {
- $a->layout['schema'] = trim($matches[1]);
- $a->layout['theme'] = trim($matches[2]);
- }
+ $cnt = preg_match("/\[theme=(.*?)\](.*?)\[\/theme\]/ism", $s, $matches);
+ if($cnt) {
+ $a->layout['schema'] = trim($matches[1]);
+ $a->layout['theme'] = trim($matches[2]);
+ }
- $cnt = preg_match("/\[theme\](.*?)\[\/theme\]/ism", $s, $matches);
- if($cnt)
- $a->layout['theme'] = trim($matches[1]);
+ $cnt = preg_match("/\[theme\](.*?)\[\/theme\]/ism", $s, $matches);
+ if($cnt)
+ $a->layout['theme'] = trim($matches[1]);
- $cnt = preg_match_all("/\[region=(.*?)\](.*?)\[\/region\]/ism", $s, $matches, PREG_SET_ORDER);
- if($cnt) {
- foreach($matches as $mtch) {
- $a->layout['region_' . $mtch[1]] = comanche_region($a,$mtch[2]);
- }
}
+ else {
+ $cnt = preg_match_all("/\[region=(.*?)\](.*?)\[\/region\]/ism", $s, $matches, PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $a->layout['region_' . $mtch[1]] = comanche_region($a,$mtch[2]);
+ }
+ }
- $cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER);
- if($cnt) {
- // only the last webpage definition is used if there is more than one
- foreach($matches as $mtch) {
- $a->layout['webpage'] = comanche_webpage($a,$mtch[1]);
+ $cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER);
+ if($cnt) {
+ // only the last webpage definition is used if there is more than one
+ foreach($matches as $mtch) {
+ $a->layout['webpage'] = comanche_webpage($a,$mtch[1]);
+ }
}
}