aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-05-06 10:53:26 +0200
committerMario Vavti <mario@mariovavti.com>2015-05-06 10:53:26 +0200
commit9391f6f9052ae16c9789e04a2a96b8aa96adb220 (patch)
tree5fabde66504f553e25a655398ebd8da04387d193 /include
parent245080a6d7b86ad2a94c62b02a8591bc70b99632 (diff)
downloadvolse-hubzilla-9391f6f9052ae16c9789e04a2a96b8aa96adb220.tar.gz
volse-hubzilla-9391f6f9052ae16c9789e04a2a96b8aa96adb220.tar.bz2
volse-hubzilla-9391f6f9052ae16c9789e04a2a96b8aa96adb220.zip
allow blocks to have custom classes and add a new template called zen which gives you an empty page to work with
Diffstat (limited to 'include')
-rw-r--r--include/comanche.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/comanche.php b/include/comanche.php
index c1a98ed6c..7115b5635 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -133,10 +133,11 @@ function comanche_get_channel_id() {
return $channel_id;
}
-function comanche_block($s) {
+function comanche_block($s, $class = '') {
$var = array();
$matches = array();
$name = $s;
+ $class = (($class) ? $class : 'bblock widget');
$cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $s, $matches, PREG_SET_ORDER);
if($cnt) {
@@ -155,7 +156,7 @@ function comanche_block($s) {
dbesc($name)
);
if($r) {
- $o .= (($var['wrap'] == 'none') ? '' : '<div class="bblock widget">');
+ $o .= (($var['wrap'] == 'none') ? '' : '<div class="' . $class . '">');
if($r[0]['title'])
$o .= '<h3>' . $r[0]['title'] . '</h3>';
@@ -238,6 +239,13 @@ function comanche_region(&$a, $s) {
}
}
+ $cnt = preg_match_all("/\[block=(.*?)\](.*?)\[\/block\]/ism", $s, $matches, PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $s = str_replace($mtch[0],comanche_block(trim($mtch[2]),trim($mtch[1])),$s);
+ }
+ }
+
// need to modify this to accept parameters
$cnt = preg_match_all("/\[widget=(.*?)\](.*?)\[\/widget\]/ism", $s, $matches, PREG_SET_ORDER);