JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added dwt_get(), messages only display once
authorjason <jason@lappy.(none)>
Wed, 21 May 2008 21:19:02 +0000 (17:19 -0400)
committerjason <jason@lappy.(none)>
Wed, 21 May 2008 21:19:02 +0000 (17:19 -0400)
dwt.php
messages.php
session.php

diff --git a/dwt.php b/dwt.php
index d347753..1849778 100644 (file)
--- a/dwt.php
+++ b/dwt.php
@@ -97,6 +97,19 @@ function dwt_prepend($name, $value) {
        dwt_prepend_raw("<!-- TemplateBeginEditable name=\"$name\" -->", $value);
 }
 
+function dwt_get_raw($name) {
+       $index = dwt_find_raw($name);
+       if($index !== null) {
+               return $GLOBALS['_dwt_values'][$index];
+       } else {
+               return false;
+       }
+}
+
+function dwt_get($name) {
+       return dwt_get_raw("<!-- TemplateBeginEditable name=\"$name\" -->");
+}
+
 function dwt_output($filename = null) {
        if($filename !== null) {
                dwt_load($filename);
index 187f083..c238951 100644 (file)
@@ -89,6 +89,7 @@ function display_messages($template = 0) {
                        $template->sub('message_box');
                }
                $template->sub('message_container');
+               unset($GLOBALS['wfpl_messages']);
        }
 }
 
index 4efec20..c99ba3f 100644 (file)
@@ -48,7 +48,7 @@ if(!isset($GLOBALS['wfpl_db_handle'])) {
 
 # generate a new random 16-character string
 function session_generate_key() {
-       $character_set = "abcdefghijklmnopqrstuvwqyzABCDEFGHIJKLMNOPQRSTUVWQYZ0123456789";
+       $character_set = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
     $id = "                ";
 
        # PHP 4.2.0 and up seed the random number generator for you.