| 1 |
<?php |
<?php |
| 2 |
//$Id: template.php,v 1.7.2.3 2009/10/24 14:59:26 himerus Exp $ |
//$Id: template.php,v 1.7.2.4 2009/10/31 23:54:05 himerus Exp $ |
| 3 |
// Report all PHP errors (see changelog) |
// Report all PHP errors (see changelog) |
| 4 |
//ini_set('error_reporting', E_ALL); |
//ini_set('error_reporting', E_ALL); |
| 5 |
/** |
/** |
| 141 |
} |
} |
| 142 |
|
|
| 143 |
/** |
/** |
| 144 |
|
* The region_builder function will create the variables needed to create |
| 145 |
|
* a dynamic group of regions. This function is only used for groups of |
| 146 |
|
* regions that should be displayed inline. Region groups that should be |
| 147 |
|
* either displayed inline or stacked (header, footer) should not be |
| 148 |
|
* passed through this function. |
| 149 |
|
* |
| 150 |
|
*/ |
| 151 |
|
function static_region_builder($region_data, $container_width, $vars) { |
| 152 |
|
// let's cycle the region data, and determine what we have |
| 153 |
|
foreach ($region_data AS $region => $info) { |
| 154 |
|
// if we do have content for this region, let's create it. |
| 155 |
|
if ($info['data']) { |
| 156 |
|
$vars[$region .'_classes'] = ns('grid-'. $info['width']); |
| 157 |
|
} |
| 158 |
|
if (is_array($info['spacing'])) { |
| 159 |
|
foreach ($info['spacing'] AS $attribute => $value) { |
| 160 |
|
if ($value) { |
| 161 |
|
$vars[$region .'_classes'] .= ' '. $attribute .'-'. $value; |
| 162 |
|
} |
| 163 |
|
} |
| 164 |
|
} |
| 165 |
|
} |
| 166 |
|
//krumo($vars); |
| 167 |
|
return $vars; |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
/** |
| 171 |
|
* The rfilter function takes one argument, an array of values for the regions |
| 172 |
|
* for a "group" of regions like preface or postscript |
| 173 |
|
* @param $vars |
| 174 |
|
*/ |
| 175 |
|
function rfilter($vars) { |
| 176 |
|
return count(array_filter($vars)); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
* OMEGA - A function to return the alpha and or omega classes based on context |
* OMEGA - A function to return the alpha and or omega classes based on context |
| 181 |
* |
* This function is not currently being used. |
| 182 |
* @param $vars |
* @param $vars |
| 183 |
* @param $elements |
* @param $elements |
| 184 |
* @param $current |
* @param $current |