Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d67cf4
)
add: tem_sets()
author
Jason Woofenden
<jason@jasonwoof.com>
Tue, 6 Apr 2010 03:28:43 +0000
(23:28 -0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Tue, 6 Apr 2010 03:39:26 +0000
(23:39 -0400)
template.php
patch
|
blob
|
history
diff --git
a/template.php
b/template.php
index
396819d
..
87305ce
100644
(file)
--- a/
template.php
+++ b/
template.php
@@
-319,7
+319,6
@@
function tem_auto_first(&$value, $key, $context) {
# 'show' sections will be shown unless the corresponding data
# value === false
# 'show' sections will be shown unless the corresponding data
# value === false
-
function tem_auto_show(&$value) {
if($value === null) $value = array(array());
return $value;
function tem_auto_show(&$value) {
if($value === null) $value = array(array());
return $value;
@@
-327,7
+326,6
@@
function tem_auto_show(&$value) {
# 'nonempty' sections will not be shown if the corresponding data
# value is the empty string
# 'nonempty' sections will not be shown if the corresponding data
# value is the empty string
-
function tem_auto_nonempty(&$value) {
if($value === '') $value = null;
return $value;
function tem_auto_nonempty(&$value) {
if($value === '') $value = null;
return $value;
@@
-335,7
+333,6
@@
function tem_auto_nonempty(&$value) {
# 'evenodd' sections are given an 'evenodd' attribute whose value
# alternates between 'even' and 'odd'.
# 'evenodd' sections are given an 'evenodd' attribute whose value
# alternates between 'even' and 'odd'.
-
function tem_auto_evenodd(&$values) {
$even = true;
if($values) foreach($values as &$value) {
function tem_auto_evenodd(&$values) {
$even = true;
if($values) foreach($values as &$value) {
@@
-401,6
+398,12
@@
class tem {
$this->data[$key] = $value;
}
$this->data[$key] = $value;
}
+ function sets($hash) {
+ foreach($hash as $key => $value) {
+ $this->set($key, $value);
+ }
+ }
+
function append($key, $value) {
$this->data[$key] .= $value;
}
function append($key, $value) {
$this->data[$key] .= $value;
}
@@
-515,6
+518,11
@@
function tem_set($key, $value) {
$GLOBALS['wfpl_template']->set($key, $value);
}
$GLOBALS['wfpl_template']->set($key, $value);
}
+function tem_sets($hash) {
+ tem_init();
+ $GLOBALS['wfpl_template']->sets($hash);
+}
+
function tem_get($key) {
tem_init();
return $GLOBALS['wfpl_template']->get($key);
function tem_get($key) {
tem_init();
return $GLOBALS['wfpl_template']->get($key);