JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added tem_prepend(), format_email() trim()s
authorJason Woofenden <jason183@herkamire.com>
Wed, 5 Dec 2007 10:38:48 +0000 (05:38 -0500)
committerJason Woofenden <jason183@herkamire.com>
Wed, 5 Dec 2007 10:38:48 +0000 (05:38 -0500)
format.php
template.php

index c14d01a..99a67b7 100644 (file)
@@ -112,7 +112,7 @@ function format_yesno($str) {
 
 function format_email($str) {
        # FIXME
-       return format_oneline($str);
+       return trim(format_oneline($str));
 }
 
 function format_url($str) {
index 2a21975..9a3de85 100644 (file)
@@ -62,6 +62,11 @@ class tem {
                $this->keyval[$key] .= $value;
        }
 
+       # like set() but prepends
+       function prepend($key, $value) {
+               $this->keyval[$key] = $value . $this->keyval[$key];
+       }
+
        # clear a value. Functionally equivalent to set($key, '') but cleaner and more efficient
        function clear($key) {
                unset($this->keyval[$key]);
@@ -228,6 +233,11 @@ function tem_append($key, $value) {
        $GLOBALS['wfpl_template']->append($key, $value);
 }
        
+function tem_prepend($key, $value) {
+       tem_init();
+       $GLOBALS['wfpl_template']->prepend($key, $value);
+}
+       
 function tem_set($key, $value) {
        tem_init();
        $GLOBALS['wfpl_template']->set($key, $value);