JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added dwt_append_raw(), format_filename() converts ^[.-] to _ instead of removing...
authorJason Woofenden <jason183@herkamire.com>
Thu, 14 Jun 2007 04:03:04 +0000 (00:03 -0400)
committerJason Woofenden <jason183@herkamire.com>
Thu, 14 Jun 2007 04:03:04 +0000 (00:03 -0400)
dwt.php
format.php
messages.php

diff --git a/dwt.php b/dwt.php
index 78daa54..d07abd8 100644 (file)
--- a/dwt.php
+++ b/dwt.php
@@ -61,15 +61,19 @@ function dwt_find($name) {
        return dwt_find_raw("<!-- TemplateBeginEditable name=\"$name\" -->");
 }
 
-function dwt_append($name, $value) {
-       $index = dwt_find($name);
+function dwt_append_raw($name, $value) {
+       $index = dwt_find_raw($name);
        if($index !== null) {
                $GLOBALS['_dwt_values'][$index] .= $value;
        } else {
-               dwt_set($name, $value);
+               dwt_set_raw($name, $value);
        }
 }
 
+function dwt_append($name, $value) {
+       dwt_append_raw("<!-- TemplateBeginEditable name=\"$name\" -->", $value);
+}
+
 function dwt_output($filename = null) {
        if($filename !== null) {
                dwt_load($filename);
index 1bac609..1fc74af 100644 (file)
@@ -33,7 +33,7 @@ function format_zip($str) {
 function format_filename($str) {
        $str = strtolower($str);
        $str = ereg_replace('[^a-z0-9_.-]', '_', $str);
-       return ereg_replace('^[0-9.-]*', '', $str);
+       return ereg_replace('^[.-]', '_', $str);
 }
 
 function format_varname($str) {
index 8d8196d..326ed16 100644 (file)
 # Full-featured example:
 #
 #    <!--~message_container start~-->
-#         <div style="border: 2px solid red; background: #800; padding: 15px">
+#         <div style="border: 2px solid red; background: #f88; padding: 5px">
 #         <!--~message_box start~-->
 #             <!--~message_divider start~-->
 #                 <hr />
 #             <!--~end~-->
-#             <p>~message_text.html~</p>
+#             <p style="font-size: 120%">~message_text.html~</p>
 #         <!--~end~-->
 #         </div>
 #    <!--~end~-->