JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Oh yeah, and now hyphens are allowed in filenames (just not at the beginning)
authorJason Woofenden <jason183@herkamire.com>
Thu, 14 Jun 2007 04:05:44 +0000 (00:05 -0400)
committerJason Woofenden <jason183@herkamire.com>
Thu, 14 Jun 2007 04:05:44 +0000 (00:05 -0400)
1  2 
dwt.php
format.php

diff --combined dwt.php
+++ b/dwt.php
@@@ -18,7 -18,7 +18,7 @@@
  #  along with wfpl; if not, write to the Free Software Foundation, Inc., 51
  #  Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  
- require_once('code/wfpl/misc.php');
+ require_once('code/wfpl/file.php');
  
  function dwt_reset() {
        $GLOBALS['_dwt_keys'] = array('<!-- TemplateEndEditable -->');
@@@ -61,19 -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);
diff --combined format.php
@@@ -32,8 -32,8 +32,8 @@@ function format_zip($str) 
  
  function format_filename($str) {
        $str = strtolower($str);
 -      $str = ereg_replace('[^a-z0-9_.]', '_', $str);
 -      return ereg_replace('^[.]*', '', $str);
 +      $str = ereg_replace('[^a-z0-9_.-]', '_', $str);
 +      return ereg_replace('^[.-]', '_', $str);
  }
  
  function format_varname($str) {
@@@ -52,10 -52,10 +52,10 @@@ function format_unix($str) 
  }
  
  function format_yesno($str) {
-       if($str) {
-               return "Yes";
+       if($str && $str != 'No') {
+               return 'Yes';
        } else {
-               return "No";
+               return 'No';
        }
  }