# <!--~rows {~-->
# <!--~row {~-->
# row content...
-# <!--~separator sep {~--><hr><!--~}"-->
+# <!--~separator sep {~--><hr><!--~}~-->
# <!--~}~-->
# <!--~}~-->
#
}
# 'show' sections will be shown unless the corresponding data value
-# is false. We check only for false; 0 or '' will not work.
+# is false (only false, not 0 or '' or array()).
function tem_auto_show(&$value) {
if($value !== false) $value = array(array());
# alternates between 'even' and 'odd'.
function tem_auto_evenodd(&$values) {
- $even = false;
- foreach($values as &$value) {
+ $even = true;
+ if($values) foreach($values as &$value) {
$value['evenodd'] = $even ? 'even' : 'odd';
$even = !$even;
}
if($tem) return $tem;
}
}
+ return false;
}
class tem {
function show($name) {
$tem = tem_is_old_sub($name, $this->template);
- $this->data[$name] .= fill_template($tem, $this->data);
+ if($tem) {
+ $this->data[$name] .= fill_template($tem, $this->data);
+ }
}
function show_separated($name) {