Index: /trunk/bin/file_importer.php
===================================================================
--- /trunk/bin/file_importer.php	(revision 41)
+++ /trunk/bin/file_importer.php	(revision 42)
@@ -27,5 +27,5 @@
             $file_text = join('', file($file));
             fclose($fp);
-            
+
             // Do something with file contents.
             preg_match('/BALANCE:\s*\$([\.\d]+)/', $file_text, $amt);
@@ -68,5 +68,5 @@
 
 /**
- * Find all files in directories recursivly with a specified file extension. 
+ * Find all files in directories recursivly with a specified file extension.
  *
  * @param  string $dir               the full path to the directory to scan
@@ -80,5 +80,5 @@
 {
     static $output;
-    
+
     $dir_handle = opendir($dir);
     while ($dir_handle && ($file = readdir($dir_handle)) !== false) {
Index: /trunk/bin/module_maker/form_template.cli.php
===================================================================
--- /trunk/bin/module_maker/form_template.cli.php	(revision 41)
+++ /trunk/bin/module_maker/form_template.cli.php	(revision 42)
@@ -40,5 +40,5 @@
 if (is_array($cols) && !empty($cols)) {
     foreach ($cols as $col) {
-        
+
         // Human readable.
         $field = $col[0];
@@ -48,15 +48,15 @@
             $primary_key_field = $field;
         }
-        
+
         // Column types like this are usually single toggle checkboxes.
         if (preg_match("/enum\('true'\)/", $col[1])) {
             $type = 'toggle';
         }
-        
+
         if (in_array($field, $exclude) || $primary_key_field == $field) {
             // Don't add a field for this column.
             continue;
         }
-        
+
         // Select menu from the column of a related database table.
         if (preg_match('/.*_id$/i', $field)) {
@@ -79,5 +79,5 @@
             continue;
         }
-        
+
         // File upload.
         if (preg_match('/file|image/i', $field)) {
@@ -96,5 +96,5 @@
             continue;
         }
-        
+
         // Password field.
         if (preg_match('/pass/i', $field)) {
@@ -109,7 +109,7 @@
             continue;
         }
-        
+
         switch ($type) {
-        
+
         // Select menu (or radio buttons)
         case 'enum' :
@@ -125,5 +125,5 @@
 E_O_F;
             break;
-        
+
         // Set checkboxes
         case 'set' :
@@ -137,5 +137,5 @@
 E_O_F;
             break;
-        
+
         // Single checkbox
         case 'toggle' :
@@ -149,5 +149,5 @@
 E_O_F;
             break;
-            
+
         // Textarea
         case 'tinytext' :
@@ -168,6 +168,6 @@
 E_O_F;
             break;
-        
-            
+
+
         // Text
         case 'tinyint' :
@@ -179,5 +179,5 @@
         case 'integer' :
         case 'bigint' :
-        
+
         case 'float' :
         case 'float' :
@@ -188,5 +188,5 @@
         case 'dec' :
         case 'numeric' :
-        
+
         case 'date' :
         case 'datetime' :
@@ -194,5 +194,5 @@
         case 'time' :
         case 'year' :
-        
+
         case 'char' :
         case 'varchar' :
Index: /trunk/bin/module_maker/list_template.cli.php
===================================================================
--- /trunk/bin/module_maker/list_template.cli.php	(revision 41)
+++ /trunk/bin/module_maker/list_template.cli.php	(revision 42)
@@ -49,18 +49,18 @@
 if (is_array($cols) && !empty($cols)) {
     foreach ($cols as $col) {
-        
+
         // Human readable.
         $field = $col[0];
         $title = ucfirst(str_replace('_', ' ', $field));
         $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
-        
+
         // Get primary key.
         if ('PRI' == $col[3]) {
             $primary_key = $field;
         }
-        
+
         // Column headers.
         $headers[$field] = $title;
-        
+
         // Column data.
         if (preg_match("/enum\('true'\)/", $col[1])) {
@@ -111,5 +111,5 @@
     <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>
     <br />
-    
+
     <input type="text" class="small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />
     <select name="filter_<##>">
Index: /trunk/bin/module_maker/module.cli.php
===================================================================
--- /trunk/bin/module_maker/module.cli.php	(revision 41)
+++ /trunk/bin/module_maker/module.cli.php	(revision 42)
@@ -17,5 +17,5 @@
 } else {
     die(basename($_SERVER['argv'][0]) . " Error: invalid arguments. Try like this:
-    
+
     " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [clean]
 
@@ -46,5 +46,5 @@
     break;
 default :
-    
+
 }
 
@@ -91,5 +91,5 @@
     trashFile("$public_dir/$public_script");
     trashFile("$public_tpl_dir/$public_list_template");
-    trashFile("$public_tpl_dir/$public_detail_template");    
+    trashFile("$public_tpl_dir/$public_detail_template");
     echo "End file cleanup\n";
     die;
@@ -163,5 +163,5 @@
 if (is_array($cols) && !empty($cols)) {
     foreach ($cols as $col) {
-        
+
         // Human readable.
         $field = $col[0];
@@ -169,18 +169,18 @@
         $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
         $default = $col[4];
-        
+
         // Get primary key.
 //         if ('PRI' == $col[3]) {
 //             $primary_key = $field;
 //         }
-        
+
         // Our form will require type="multipart/form-data".
         if (preg_match('/file|image/i', $field)) {
             $upload_file_capability = true;
         }
-        
+
         // Column headers.
         $headers[$field] = $field_title;
-        
+
         // Get php code for printing variables.
         $public_list_page_vars[] = "<\x3fphp echo oTxt(\$" . $module_name_singular . "_list[\$i]['$field']); \x3f>";
@@ -222,5 +222,5 @@
     // Form arguments
     $replace['admin_form_tag_init'] = "<form enctype=\"multipart/form-data\" method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"<##>\" />";
-    
+
     // Include statement.
     $replace['admin_upload_include'] = "require_once 'codebase/lib/Upload.inc.php';\n";
@@ -245,5 +245,5 @@
 // Copy uploaded image name into form data.
 \$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : '';
- 
+
 
 E_O_F;
@@ -261,5 +261,5 @@
     $replace['admin_upload_insert'] = <<<E_O_F
 
-	    // Upload files with prepended primary key.
+        // Upload files with prepended primary key.
         \$new_file = \$upload->process('<##>',  \$%PRIMARY_KEY% . '_' . getFormData('<##>'));
 
@@ -443,5 +443,5 @@
 if ('var' == $op) {
     if (isset($replace[$_SERVER['argv'][5]])) {
-    	echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n";
+        echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n";
     } else if (isset($skel_files[$_SERVER['argv'][5]])) {
         echo "\n\n" . preg_replace($search, $replace, $skel_files[$_SERVER['argv'][5]]) . "\n\n";
@@ -540,5 +540,5 @@
     global $user_trash_folder;
     static $file_prefix;
-    
+
     if (!isset($file_prefix)) {
         $file_prefix = time();
@@ -546,5 +546,5 @@
         $file_prefix++;
     }
-    
+
     // Make user trash folder.
     if (!dir($user_trash_folder)) {
Index: /trunk/bin/module_maker/skel/adm_list.ihtml
===================================================================
--- /trunk/bin/module_maker/skel/adm_list.ihtml	(revision 41)
+++ /trunk/bin/module_maker/skel/adm_list.ihtml	(revision 42)
@@ -7,5 +7,5 @@
     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
     <br />
-    
+
     <input type="text" class="small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: <##> %SEARCH_FIELDS%.")); ?>" />
     <select name="filter_<##>">
Index: /trunk/bin/module_maker/skel/admin.php
===================================================================
--- /trunk/bin/module_maker/skel/admin.php	(revision 41)
+++ /trunk/bin/module_maker/skel/admin.php	(revision 42)
@@ -26,8 +26,8 @@
  * CONFIG
  *****************************************************************************/
- 
+
 // Titles and navigation header.
 $nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']);
-    
+
 // The object to validate form input.
 $fv = new FormValidator();
@@ -215,5 +215,5 @@
     // Get the information for the form.
     $qid = DB::query("
-        SELECT * 
+        SELECT *
         FROM %DB_TBL%
         WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
@@ -227,5 +227,5 @@
     // Lock this record.
     $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['<##>']);
-    
+
     // Set misc values for the form.
     $frm = array_merge(array(
@@ -246,5 +246,5 @@
 {
     global $lock;
-    
+
     $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     if ($lock->isLocked() && !$lock->isMine()) {
@@ -254,8 +254,8 @@
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
     // Get the information for this object.
     $qid = DB::query("
-        SELECT <##> 
+        SELECT <##>
         FROM %DB_TBL%
         WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
@@ -266,8 +266,8 @@
         App::dieBoomerangURL();
     }
-    
+
     // Delete the record.
     DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'");
-    
+
     App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
 
@@ -279,8 +279,8 @@
 {
     global $auth;
-    
+
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
 %INSERT%
     $last_insert_id = mysql_insert_id(DB::getDBH());
@@ -289,7 +289,7 @@
     $version = RecordVersion::getInstance($GLOBALS['auth']);
     $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']);
-    
+
     App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been added."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
-    
+
     return $last_insert_id;
 }
@@ -298,5 +298,5 @@
 {
     global $auth, $lock;
-    
+
     $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']);
     if ($lock->isLocked() && !$lock->isMine()) {
@@ -308,5 +308,5 @@
 
 %UPDATE%
-    
+
     // Create version.
     $version = RecordVersion::getInstance($GLOBALS['auth']);
@@ -323,7 +323,7 @@
     global $page;
     global $so;
-    
+
     $where_clause = '';
-    
+
     // Build search query if available.
     if (getFormData('search_query', false)) {
@@ -333,26 +333,26 @@
         }
     }
-    
+
     if (getFormData('filter_<##>', false)) {
         // Limit by filter.
         $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . addslashes(getFormData('filter_<##>')) . "'";
     }
-    
+
     // Count the total number of records so we can do something about the page numbers.
     $qid = DB::query("
-        SELECT COUNT(*) 
-        FROM %DB_TBL% 
+        SELECT COUNT(*)
+        FROM %DB_TBL%
         $where_clause
     ");
     list($num_results) = mysql_fetch_row($qid);
-    
+
     // Set page numbers now we know (needed for next step).
     $page->setTotalItems($num_results);
     $page->calculate();
-    
+
     // Final SQL, with sort and page limiters.
     $sql = "
-        SELECT 
-            %DB_TBL%.*, 
+        SELECT
+            %DB_TBL%.*,
             a1.username AS added_admin_username,
             a2.username AS modified_admin_username
@@ -364,5 +364,5 @@
         " . $page->getLimitSQL() . "
     ";
-    
+
     // A unique key for this query, with the total_items in case db records
     // were added since the last cache. This identifies a unique set of
@@ -375,5 +375,5 @@
         Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
     }
-    
+
     if (SessionCache::isCached($_SERVER['PHP_SELF'])) {
         // Get the cached results.
@@ -386,5 +386,5 @@
             $list[] = $row;
         }
-            
+
         if (isset($list) && !empty($list)) {
             // Cache the results.
@@ -397,5 +397,5 @@
 
 function updateRank($ranks)
-{   
+{
     if (!is_array($ranks)) {
         App::logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__);
@@ -405,8 +405,8 @@
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
     // Count the ranks with invalid numbers
     $unspecified_counter = 0;
-    
+
     // Go through the array of new ranks.
     foreach ($ranks as $id => $new_rank) {
@@ -414,5 +414,5 @@
             // Unspecified entries receive a sort order of 10000.
             $new_rank = 10000;
-            $unspecified_counter++; 
+            $unspecified_counter++;
         }
         DB::query("
@@ -422,5 +422,5 @@
         ");
     }
-    
+
     App::raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__);
     if ($unspecified_counter > 0) {
Index: /trunk/bin/module_maker/skel/public.php
===================================================================
--- /trunk/bin/module_maker/skel/public.php	(revision 41)
+++ /trunk/bin/module_maker/skel/public.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * %PUBLIC_SCRIPT% 
+ * %PUBLIC_SCRIPT%
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  *
@@ -18,5 +18,5 @@
 // Titles and navigation header.
 $nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']);
-$nav->setFeature(array('title'=>true)); 
+$nav->setFeature(array('title'=>true));
 
 // Instantiate page numbers. Total items are set and calculation is done in the getRecordList function.
@@ -32,5 +32,5 @@
 
 if (getFormData('%PRIMARY_KEY%', false)) {
-    
+
     // Get requested record.
     $qid = DB::query("
@@ -52,5 +52,5 @@
         WHERE %PRIMARY_KEY% = '" . addslashes(getFormData('%PRIMARY_KEY%')) . "'
     ");
-        
+
     // Set title and main template.
     $nav->addPage($item['<##>']);
@@ -58,11 +58,11 @@
 
 } else {
-    
+
     // Get the DEFAULT list.
     $%NAME_SINGULAR%_list = array();
     $qid = DB::query("
-        SELECT * 
-        FROM %DB_TBL% 
-        WHERE publish = 'true' 
+        SELECT *
+        FROM %DB_TBL%
+        WHERE publish = 'true'
         " . $so->getSortOrderSQL() . "
         LIMIT 100
@@ -71,15 +71,15 @@
         $%NAME_SINGULAR%_list[] = $row;
     }
-    
+
     // Set page numbers for default list.
     $page->setTotalItems(sizeof($%NAME_SINGULAR%_list));
     $page->calculate();
-    
+
 
     // Get the FEATURED list.
     $featured_list = array();
     $qid = DB::query("
-        SELECT * 
-        FROM %DB_TBL% 
+        SELECT *
+        FROM %DB_TBL%
         WHERE publish = 'true'
         AND featured = 'true'
@@ -89,11 +89,11 @@
         $featured_list[] = $row;
     }
-    
+
     // Get the POPULAR list.
     $popular_list = array();
     $qid = DB::query("
-        SELECT * 
-        FROM %DB_TBL% 
-        WHERE publish = 'true' 
+        SELECT *
+        FROM %DB_TBL%
+        WHERE publish = 'true'
         ORDER BY hit_count DESC LIMIT 10
     ");
@@ -101,11 +101,11 @@
         $popular_list[] = $row;
     }
-    
+
     // Get the RECENT list.
     $recent_list = array();
     $qid = DB::query("
-        SELECT * 
-        FROM %DB_TBL% 
-        WHERE publish = 'true' 
+        SELECT *
+        FROM %DB_TBL%
+        WHERE publish = 'true'
         ORDER BY added_datetime DESC LIMIT 10
     ");
@@ -113,8 +113,8 @@
         $recent_list[] = $row;
     }
-    
+
     // Set main template.
     $main_template = '%PUBLIC_LIST_TEMPLATE%';
-}    
+}
 
 // We have the data, and no errors, so here come the templates.
Index: /trunk/bin/module_maker/skel/public_list.ihtml
===================================================================
--- /trunk/bin/module_maker/skel/public_list.ihtml	(revision 41)
+++ /trunk/bin/module_maker/skel/public_list.ihtml	(revision 42)
@@ -11,10 +11,10 @@
         <p>
         <em><?php echo date(App::getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i]['<##>'])); ?></em> &mdash; <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?>
-            
+
         <?php if (strlen(trim($%NAME_SINGULAR%_list[$i]['content'])) > 0) { // Link only if content is available. ?>
             <br /><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $%NAME_SINGULAR%_list[$i]['%PRIMARY_KEY%']); ?>"><?php echo _("Read more"); ?></a>
         <?php } ?>
         </p>
-        <?php   
+        <?php
     }
     if ($page->total_pages > 1) {
@@ -30,7 +30,7 @@
     ?>
     <h2><?php echo _("Featured %NAME_PLURAL%"); ?></h2>
-    <?php 
+    <?php
     foreach ($featured_list as $item) {
-        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a></h4><?php   
+        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a></h4><?php
     }
 }
@@ -42,7 +42,7 @@
     ?>
     <h2><?php echo _("Popular %NAME_PLURAL%"); ?></h2>
-    <?php 
+    <?php
     foreach ($popular_list as $item) {
-        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php   
+        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php
     }
 }
@@ -54,7 +54,7 @@
     ?>
     <h2><?php echo _("Recent %NAME_PLURAL%"); ?></h2>
-    <?php 
+    <?php
     foreach ($recent_list as $item) {
-        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php   
+        ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php
     }
 }
Index: /trunk/bin/module_maker/sql.cli.php
===================================================================
--- /trunk/bin/module_maker/sql.cli.php	(revision 41)
+++ /trunk/bin/module_maker/sql.cli.php	(revision 42)
@@ -56,12 +56,12 @@
 if (is_array($cols) && !empty($cols)) {
     foreach ($cols as $col) {
-        
+
         // Human readable.
         $field = $col[0];
         $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
         $is_primary_key = ('PRI' == $col[3]);
-        
+
         $sort_columns .= "\$so->setColumn('$field', '$field ASC', '$field DESC');\n";
-        
+
         if ($is_primary_key) {
             // This is the primary key. Deal with separately.
@@ -84,5 +84,5 @@
         }
     }
-    
+
 } else {
     die(basename($_SERVER['argv'][0]) . " Warning: $db_tbl does not have any columns.\n");
Index: /trunk/bin/module_maker/validation.cli.php
===================================================================
--- /trunk/bin/module_maker/validation.cli.php	(revision 41)
+++ /trunk/bin/module_maker/validation.cli.php	(revision 42)
@@ -38,9 +38,9 @@
 // Loop through columns
 if (is_array($cols) && !empty($cols)) {
-    
+
     $o = array();
 
     foreach ($cols as $col) {
-    
+
         // Human readable.
         $field = $col[0];
@@ -49,9 +49,9 @@
         $is_primary_key = ('PRI' == $col[3]);
         $unsigned = preg_match('/\s*unsigned\s*$/i', $col[1]);
-        
+
         if (in_array($field, $exclude)) {
             continue;
         }
-        
+
         // ----------- isEmpty ------------
         $o[] = "\$fv->isEmpty('$field', _(\"<strong>$title</strong> cannot be blank.\"));";
@@ -68,5 +68,5 @@
             $len_type = 'setenum';
             break;
-            
+
         case 'date' :
         case 'datetime' :
@@ -77,5 +77,5 @@
             $max_length = 127;
             break;
-            
+
         case 'tinytext' :
         case 'tinyblob' :
@@ -85,5 +85,5 @@
             $max_length = 255;
             break;
-            
+
         case 'text' :
         case 'blob' :
@@ -91,5 +91,5 @@
             $max_length = 65535;
             break;
-            
+
         case 'mediumtext' :
         case 'mediumblob' :
@@ -97,5 +97,5 @@
             $max_length = 16777215;
             break;
-            
+
         case 'longtext' :
         case 'longblob' :
@@ -103,5 +103,5 @@
             $max_length = 4294967295;
             break;
-            
+
         case 'tinyint' :
         case 'bit' :
@@ -116,5 +116,5 @@
             }
             break;
-            
+
         case 'smallint' :
             $len_type = 'num';
@@ -127,5 +127,5 @@
             }
             break;
-            
+
         case 'mediumint' :
             $len_type = 'num';
@@ -138,5 +138,5 @@
             }
             break;
-            
+
         case 'int' :
         case 'integer' :
@@ -150,5 +150,5 @@
             }
             break;
-            
+
         case 'bigint' :
             $len_type = 'num';
@@ -161,5 +161,5 @@
             }
             break;
-            
+
         case 'float' :
             $len_type = 'num';
@@ -167,5 +167,5 @@
             $max = 3.40282E+38;
             break;
-            
+
         case 'double' :
         case 'double precision' :
@@ -178,5 +178,5 @@
             $max = 1.79769E+308;
             break;
-            
+
         default :
             $len_type = null;
@@ -192,16 +192,16 @@
             $o[] = "\$fv->numericRange('$field', $min, $max, _(\"<strong>$title</strong> must be a valid number between $min and $max.\"));";
         }
-        
+
         // ----------- type check ------------
         switch ($type) {
 
         case 'enum' :
-        
+
         case 'set' :
             break;
-        
+
         case 'char' :
         case 'varchar' :
-        
+
         case 'tinytext' :
         case 'text' :
@@ -214,5 +214,5 @@
 //             $o[] = "\$fv->isString('$field', _(\"<strong>$title</strong> must be a string.\"));"; // Pretty useless
             break;
-        
+
         case 'tinyint' :
         case 'bit' :
@@ -226,5 +226,5 @@
             $o[] = "\$fv->isInteger('$field', _(\"<strong>$title</strong> must be an integer.\")$negative_ok);";
             break;
-        
+
         case 'float' :
         case 'float' :
@@ -238,5 +238,5 @@
             $o[] = "\$fv->isFloat('$field', _(\"<strong>$title</strong> must be a valid number.\")$negative_ok);";
             break;
-        
+
         case 'date' :
         case 'datetime' :
@@ -244,21 +244,21 @@
             $o[] = "\$fv->checkRegex('$field', '/^\d{4}-\d{2}-\d{2}$/', true, _(\"<strong>$title</strong> must be a valid date in YYYY-MM-DD format.\"));";
             break;
-            
+
         case 'timestamp' :
             $o[] = "\$fv->checkRegex('$field', '/^\d{14}$/', true, _(\"<strong>$title</strong> must be a valid mysql timestamp in YYYYMMDDhhmmss format.\"));";
             break;
-            
+
         case 'time' :
             $o[] = "\$fv->checkRegex('$field', '/^\d{1,3}:\d{2}:\d{2}$/', true, _(\"<strong>$title</strong> must be a valid time in hh:mm:ss format.\"));";
             break;
-        
+
         case 'year' :
             $o[] = "\$fv->checkRegex('$field', '/^\d{4}$/', true, _(\"<strong>$title</strong> must be a valid year in YYYY format.\"));";
             break;
-        
+
         default :
             break;
         }
-        
+
         if (preg_match('/email/', $field)) {
             $o[] = "\$fv->validateEmail('$field');";
@@ -266,5 +266,5 @@
             $o[] = "\$fv->validatePhone('$field');";
         }
-        
+
         // Blank between cols?
         $o[] = '';
@@ -278,5 +278,5 @@
 
 echo "function validateInput()
-{    
+{
     global \$fv;
 
Index: /trunk/docs/coding_standards.txt
===================================================================
--- /trunk/docs/coding_standards.txt	(revision 41)
+++ /trunk/docs/coding_standards.txt	(revision 42)
@@ -7,5 +7,5 @@
 ======================================================================
 
-We're following the PEAR coding standards, with minor modifications. 
+We're following the PEAR coding standards, with minor modifications.
 
 This is essential reading:
@@ -20,5 +20,5 @@
 
 Auth_SQL.inc.php        One PHP Class to be included. The filename is the
-                        type of class, underscore, name. Or if in subdirs, 
+                        type of class, underscore, name. Or if in subdirs,
                         this could be /Auth/SQL.inc.php while the class name
                         remains "Auth_SQL"
@@ -29,5 +29,5 @@
                         directly in the web root.
 
-script.cli.php          A command-line executable script, possibly executed 
+script.cli.php          A command-line executable script, possibly executed
                         with CRON, usually outputs TEXT, not HTML.
 
@@ -43,5 +43,5 @@
 
 Use an indent of 4 spaces, with no tabs. Code and especially comments should
-be wrapped <= 80 characters. Exceptions are made in the case where code 
+be wrapped <= 80 characters. Exceptions are made in the case where code
 readability is significantly improved with longer lines.
 
@@ -80,13 +80,13 @@
         action1;
         break;
-    
+
     case 2:
         action2;
         break;
-    
+
     default:
         defaultaction;
         break;
-    
+
     }
 
@@ -137,5 +137,5 @@
 ======================================================================
 
-When functions return boolean values, use 'return false;' or 'return true;' 
+When functions return boolean values, use 'return false;' or 'return true;'
 as opposed to 'return 0;' or 'return 1;' or 'return(-1);'.
 
@@ -149,7 +149,7 @@
 
     $something = $blah . funky() . ".\".=" . $blab;
-    
+
 is better than:
-    
+
     $something = $blah.funky().".\".=".$blab;
 
@@ -159,7 +159,7 @@
 ======================================================================
 
-Use the single quote marks ' to enclose simple strings whenever possible. 
-Double quote marks " require extra parsing and thus slow things down, but 
-are necessary if entities there must be swapped-out such as variables or 
+Use the single quote marks ' to enclose simple strings whenever possible.
+Double quote marks " require extra parsing and thus slow things down, but
+are necessary if entities there must be swapped-out such as variables or
 control characters.
 
@@ -196,8 +196,8 @@
 ======================================================================
 
-Function comments should follow the Javadoc standard, with detailed 
+Function comments should follow the Javadoc standard, with detailed
 function comments and one-line pointers along the way:
 http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html
- 
+
     <?php
     /**
@@ -215,5 +215,5 @@
     {
         $qid = DB::query("SHOW COLUMNS FROM $db_table LIKE '$db_col'",false);
-            
+
         $row = mysql_fetch_row($qid);
         if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $match)) {
@@ -283,5 +283,5 @@
 ======================================================================
 
-All HTML should be valid XHTML 1.0 verfied with the 
+All HTML should be valid XHTML 1.0 verfied with the
 W3C Markup Validation Service: http://validator.w3.org/
 
@@ -302,5 +302,5 @@
     <td nowrap="nowrap">Example</td>
 
-All tags must be properly closed. Tags without a closing part must follow the 
+All tags must be properly closed. Tags without a closing part must follow the
 XHTML convention and end with a space and a slash:
 
Index: /trunk/docs/example_config.inc.php
===================================================================
--- /trunk/docs/example_config.inc.php	(revision 41)
+++ /trunk/docs/example_config.inc.php	(revision 42)
@@ -12,5 +12,5 @@
 // To work around a PHP bug always include this config file with: require_once dirname(__FILE__) . '/_config.inc.php';
 if (!preg_match('!^(/|[A-Z]:)!', __FILE__)) {
-	trigger_error('_config.inc.php include must be specified with an absolute file path (eg: "require_once dirname(__FILE__) . \'/_config.inc.php\';"', E_USER_ERROR);
+    trigger_error('_config.inc.php include must be specified with an absolute file path (eg: "require_once dirname(__FILE__) . \'/_config.inc.php\';"', E_USER_ERROR);
 }
 
@@ -19,5 +19,5 @@
 define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
 
-// The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the 
+// The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the
 // latter does not change when using the apache Alias directive or URL Rewriting to define a site.
 define('SITE_BASE', dirname(__FILE__));
Index: /trunk/docs/file_layout.txt
===================================================================
--- /trunk/docs/file_layout.txt	(revision 41)
+++ /trunk/docs/file_layout.txt	(revision 42)
@@ -5,6 +5,6 @@
 ======================================================================================
 
-codebase/ 
-    bin/ 
+codebase/
+    bin/
         (generic command-line scripts and applications)
         file_importer.php
@@ -16,5 +16,5 @@
             list_template.cli.php
             module.cli.php
-            skel/ 
+            skel/
                 (templates for generating modules)
                 adm_form.ihtml
@@ -32,5 +32,5 @@
         file_layout.txt
         software_licence.txt
-        todo.txt    
+        todo.txt
     lib/
         App.inc.php (functions dealing with sessions, href/url/IP manipulation, directories.)
@@ -61,5 +61,5 @@
         Upload.inc.php (class that manages uploading of files.)
         Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc.)
-    services/ 
+    services/
         (codebase scripts that are only useful when web accessible, i.e. to be used in a doc root)
         admins.php
@@ -79,17 +79,17 @@
 ======================================================================================
 
-global/ 
+global/
     (global level configuration and libraries for a group of sites/apps)
     config.inc.php (system-wide configuration)
     db_auth.inc.php (db-authentication for CLI scripts. chown'ed by user executing cron, NOT apache).
 
-docs/ 
+docs/
     (documents specific to a group of sites/apps)
     tei_db.mysql (db schema)
-    
-bin/ 
+
+bin/
     (global level command-line scripts)
-    
-admin/ 
+
+admin/
     (DocumentRoot for the admin application)
     _config.inc.php
@@ -107,5 +107,5 @@
     versions.php (manage db record versions)
 
-html/ 
+html/
     (DocumentRoot of main site application)
     _config.inc.php (configuration options and defaults specific to this site. included first in each script.)
Index: /trunk/docs/revision_history.txt
===================================================================
--- /trunk/docs/revision_history.txt	(revision 41)
+++ /trunk/docs/revision_history.txt	(revision 42)
@@ -10,9 +10,9 @@
     - will still run if info missing: db creds, log dir, session info.
     - can be located in /usr/local/lib/php if necessary, so accessible by all sites.
-    
+
 remove interdependencies:
     - App() is the only dependency for other classes. It includes Utilities.inc.php silently.
     - Update libs requiring external files, such as html templates and email templates, classes now self-contained.
-    
+
 Things with modified interfaces:
     - App
@@ -41,13 +41,13 @@
         - lang
     - $dbh database handler
-    
+
 App object:
     - object belongs to a realm, keeping messages and session data within specific site/app.
     - uses the singleton pattern so only one instance of App exists for each app.
     - app object can be accessed globally without reference to object name by calling methods statically, e.g. App:logMsg()
-    - seperate application and codebase parameters from site configuration variables. 
+    - seperate application and codebase parameters from site configuration variables.
       Use $app->getParam('var') or App::getParam('var') to get app params.
       F or site configurations do whatever you want (I'm using $cfg['node']['features'] format for configurations)
-    
+
 App configuration parameters
     - defaults part of the app class
Index: /trunk/lib/App.inc.php
===================================================================
--- /trunk/lib/App.inc.php	(revision 41)
+++ /trunk/lib/App.inc.php	(revision 42)
@@ -9,5 +9,5 @@
  * @version 1.0
  */
- 
+
 // Message Types.
 define('MSG_ERR', 1);
@@ -20,5 +20,5 @@
 
 class App {
-    
+
     // Name of this application.
     var $app = '_app_';
@@ -29,5 +29,5 @@
     // Instance of database object.
     var $db;
-    
+
     // Array of query arguments will be carried persistently between requests.
     var $_carry_queries = array();
@@ -46,9 +46,9 @@
         // The location the user will go if the system doesn't knew where else to send them.
         'redirect_home_url' => '/',
-        
+
         // SSL URL used when redirecting with App::sslOn().
         'ssl_domain' => null,
         'ssl_enabled' => false,
-    
+
         // Character set for page output. Used in the Content-Type header and the HTML <meta content-type> tag.
         'character_set' => 'utf-8',
@@ -63,5 +63,5 @@
         'session_name' => 'Strangecode',
         'session_use_cookies' => true,
-    
+
         // Use database?
         'enable_db' => false,
@@ -69,5 +69,5 @@
         // Use db-based sessions?
         'enable_db_session_handler' => false,
-    
+
         // DB passwords should be set as apache environment variables in httpd.conf, readable only by root.
         'db_server' => 'localhost',
@@ -80,5 +80,5 @@
         'db_debug' => false, // TRUE = display db errors.
         'db_die_on_failure' => false, // TRUE = script stops on db error.
-        
+
         // For classes that require db tables, do we check that a table exists and create if missing?
         'db_create_tables' => true,
@@ -89,5 +89,5 @@
         // Don't display errors by default; it is preferable to log them to a file.
         'display_errors' => false,
-    
+
         // Directory in which to store log files.
         'log_directory' => '',
@@ -112,15 +112,15 @@
         'log_sms_priority' => false,
         'log_screen_priority' => false,
-    
+
         // Email address to receive log event emails.
         'log_to_email_address' => null,
-        
+
         // SMS Email address to receive log event SMS messages.
         'log_to_sms_address' => null,
-        
+
         // A key for calculating simple cryptographic signatures. Set using as an environment variables in the httpd.conf with 'SetEnv SIGNING_KEY <key>'.
         'signing_key' => 'aae6abd6209d82a691a9f96384a7634a',
     );
-    
+
     /**
      * This method enforces the singleton pattern for this class. Only one application is running at a time.
@@ -140,5 +140,5 @@
         return $instance;
     }
-    
+
     /**
      * Constructor.
@@ -149,5 +149,5 @@
             $this->app .= $app;
         }
-        
+
         // Initialize default parameters.
         $this->_params = array_merge($this->_params, $this->_param_defaults);
@@ -184,5 +184,5 @@
             $this =& App::getInstance();
         }
-        
+
         if ($param === null) {
             return $this->_params;
@@ -194,5 +194,5 @@
         }
     }
-    
+
     /**
      * Begin running this application.
@@ -207,5 +207,5 @@
             return false;
         }
-        
+
         // Error reporting.
         ini_set('error_reporting', $this->getParam('error_reporting'));
@@ -215,12 +215,12 @@
             ini_set('error_log', $this->getParam('log_directory') . '/' . $this->getParam('php_error_log'));
         }
-        
-        
+
+
         /**
          * 1. Start Database.
          */
-        
+
         if ($this->getParam('enable_db')) {
-        
+
             // DB connection parameters taken from environment variables in the httpd.conf file, readable only by root.
             if (!empty($_SERVER['DB_SERVER'])) {
@@ -236,10 +236,10 @@
                 $this->setParam(array('db_pass' => $_SERVER['DB_PASS']));
             }
-            
+
             // The only instance of the DB object.
             require_once dirname(__FILE__) . '/DB.inc.php';
-            
+
             $this->db =& DB::getInstance();
-            
+
             $this->db->setParam(array(
                 'db_server' => $this->getParam('db_server'),
@@ -255,17 +255,17 @@
             $this->db->connect();
         }
-        
-        
+
+
         /**
          * 2. Start PHP session.
          */
-    
+
         // Skip session for some user agents.
         if (preg_match('/Atomz|ApacheBench|Wget/i', getenv('HTTP_USER_AGENT'))) {
             $this->setParam(array('enable_session' => false));
         }
-        
+
         if (true === $this->getParam('enable_session')) {
-        
+
             // Set the session ID to one provided in GET/POST. This is necessary for linking
             // between domains and keeping the same session.
@@ -273,5 +273,5 @@
                 session_id($ses);
             }
-        
+
             if (true === $this->getParam('enable_db_session_handler') && true === $this->getParam('enable_db')) {
                 // Database session handling.
@@ -282,5 +282,5 @@
                 ));
             }
-            
+
             // Session parameters.
             ini_set('session.use_cookies', $this->getParam('session_use_cookies'));
@@ -289,8 +289,8 @@
             ini_set('session.entropy_length', '512');
             session_name($this->getParam('session_name'));
-            
+
             // Start the session.
             session_start();
-            
+
             if (!isset($_SESSION[$this->app])) {
                 // Access session data using: $_SESSION['...'].
@@ -302,6 +302,6 @@
             }
         }
-        
-        
+
+
         /**
          * 3. Misc setup.
@@ -319,11 +319,11 @@
             $this->setParam(array('signing_key' => $_SERVER['SIGNING_KEY']));
         }
-        
+
         // Character set. This should also be printed in the html header template.
         header('Content-type: text/html; charset=' . $this->getParam('character_set'));
-        
+
         $this->running = true;
     }
-    
+
     /**
      * Stop running this application.
@@ -340,6 +340,6 @@
         $this->running = false;
     }
-    
-    
+
+
     /**
      * Add a message to the string globalmessage, which is printed in the header.
@@ -359,5 +359,5 @@
             $this =& App::getInstance();
         }
-        
+
         $message = trim($message);
 
@@ -365,18 +365,18 @@
             return false;
         }
-        
+
         // Save message in session under unique key to avoid duplicate messages.
         $_SESSION[$this->app]['messages'][md5($type . $message . $file . $line)] = array(
-            'type'    => $type, 
+            'type'    => $type,
             'message' => $message,
             'file'    => $file,
             'line'    => $line
         );
-        
+
         if (!in_array($type, array(MSG_NOTICE, MSG_SUCCESS, MSG_WARNING, MSG_ERR))) {
-        	$this->logMsg(sprintf('Invalid MSG_* type: %s', $type), LOG_DEBUG, __FILE__, __LINE__);
-        }
-    }
-    
+            $this->logMsg(sprintf('Invalid MSG_* type: %s', $type), LOG_DEBUG, __FILE__, __LINE__);
+        }
+    }
+
     /**
      * Prints the HTML for displaying raised messages.
@@ -405,23 +405,23 @@
                 echo '<div class="error">' . $message['message'] . '</div>';
                 break;
-    
+
             case MSG_WARNING:
                 echo '<div class="warning">' . $message['message'] . '</div>';
                 break;
-    
+
             case MSG_SUCCESS:
                 echo '<div class="success">' . $message['message'] . '</div>';
                 break;
-    
+
             case MSG_NOTICE:
             default:
                 echo '<div class="notice">' . $message['message'] . '</div>';
                 break;
-    
+
             }
             ?></div><?php
         }
     }
-    
+
     /**
      * Logs a message to a user defined log file. Additional actions to take for
@@ -448,5 +448,5 @@
             $this =& App::getInstance();
         }
-        
+
         // If priority is not specified, assume the worst.
         if (!$this->logPriorityToString($priority)) {
@@ -454,5 +454,5 @@
             $priority = LOG_EMERG;
         }
-    
+
         // If log file is not specified, don't log to a file.
         if (!$this->getParam('log_directory') || !$this->getParam('log_filename') || !is_dir($this->getParam('log_directory')) || !is_writable($this->getParam('log_directory'))) {
@@ -461,9 +461,9 @@
             trigger_error(sprintf('Codebase error: log directory (%s) not found or writable.', $this->getParam('log_directory')), E_USER_NOTICE);
         }
-        
+
         // Make sure to log in the system's locale.
         $locale = setlocale(LC_TIME, 0);
         setlocale(LC_TIME, 'C');
-        
+
         // Data to be stored for a log event.
         $event = array();
@@ -478,10 +478,10 @@
         $event['message'] = strip_tags(preg_replace('/\s+/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null));
         $event_str = '[' . join('] [', $event) . ']';
-        
+
         // FILE ACTION
         if ($this->getParam('log_file_priority') && $priority <= $this->getParam('log_file_priority')) {
             error_log($event_str . "\n", 3, $this->getParam('log_directory') . '/' . $this->getParam('log_filename'));
         }
-    
+
         // EMAIL ACTION
         if ($this->getParam('log_email_priority') && $priority <= $this->getParam('log_email_priority')) {
@@ -494,5 +494,5 @@
             mail($this->getParam('log_to_email_address'), $subject, $email_msg, $headers, '-f codebase@strangecode.com');
         }
-        
+
         // SMS ACTION
         if ($this->getParam('log_sms_priority') && $priority <= $this->getParam('log_sms_priority')) {
@@ -502,14 +502,14 @@
             mail($this->getParam('log_to_sms_address'), $subject, $sms_msg, $headers, '-f codebase@strangecode.com');
         }
-    
+
         // SCREEN ACTION
         if ($this->getParam('log_screen_priority') && $priority <= $this->getParam('log_screen_priority')) {
             echo "[{$event['date']}] [{$event['type']}] [{$event['file:line']}] [{$event['message']}]\n";
         }
-    
+
         // Restore original locale.
         setlocale(LC_TIME, $locale);
     }
-    
+
     /**
      * Returns the string representation of a LOG_* integer constant.
@@ -536,12 +536,12 @@
         }
     }
-    
+
     /**
      * Sets which query arguments will be carried persistently between requests.
-     * Values in the _carry_queries array will be copied to URLs (via App::url()) and 
+     * Values in the _carry_queries array will be copied to URLs (via App::url()) and
      * to hidden input values (via printHiddenSession()).
      *
      * @access  public
-     * @param   string  $query_key  The key of the query argument to save.  
+     * @param   string  $query_key  The key of the query argument to save.
      * @author  Quinn Comendant <quinn@strangecode.com>
      * @since   14 Nov 2005 19:24:52
@@ -552,15 +552,15 @@
             $this =& App::getInstance();
         }
-        
+
         // If not already set, and there is a non-empty value provided in the request...
         if (!isset($this->_carry_queries[$query_key]) && getFormData($query_key, false)) {
             // Copy the value of the specified query argument into the _carry_queries array.
-        	$this->_carry_queries[$query_key] = getFormData($query_key);
-        }
-    }
-    
+            $this->_carry_queries[$query_key] = getFormData($query_key);
+        }
+    }
+
     /**
      * Outputs a fully qualified URL with a query of all the used (ie: not empty)
-     * keys and values, including optional queries. This allows mindless retention 
+     * keys and values, including optional queries. This allows mindless retention
      * of query arguments across page requests. If cookies are not
      * used, the session id will be propogated in the URL.
@@ -588,5 +588,5 @@
             return false;
         }
-    
+
         // Get any provided query arguments to include in the final URL.
         // If FALSE is a provided here, DO NOT carry the queries.
@@ -611,9 +611,9 @@
             }
         }
-        
+
         // Get the first delimiter that is needed in the url.
         $delim = strpos($url, '?') !== false ? ini_get('arg_separator.output') : '?';
 
-        
+
         $q = '';
         if ($do_carry_queries) {
@@ -628,5 +628,5 @@
             }
         }
-    
+
         // Include the necessary SID if the following is true:
         // - no cookie in http request OR cookies disabled in App
@@ -634,5 +634,5 @@
         // - the link stays on our site
         // - transparent SID propogation with session.use_trans_sid is not being used OR url begins with protocol (using_trans_sid has no effect here)
-        // OR 
+        // OR
         // - we must include the SID because we say so (it's used in a context where cookies will not be effective, ie. moving from http to https)
         // AND
@@ -642,15 +642,15 @@
                 (
                     (
-                        !isset($_COOKIE[session_name()]) 
+                        !isset($_COOKIE[session_name()])
                         || !$this->getParam('session_use_cookies')
-                    ) 
+                    )
                     && $this->getParam('enable_session')
-                    && isMyDomain($url) 
-                    && 
+                    && isMyDomain($url)
+                    &&
                     (
                         !ini_get('session.use_trans_sid')
                         || preg_match('!^(http|https)://!i', $url)
                     )
-                ) 
+                )
                 || $always_include_sid
             )
@@ -679,16 +679,16 @@
             $this =& App::getInstance();
         }
-        
+
         $url = $this->url($url, $carry_args, $always_include_sid);
-        
+
         // Replace any & not followed by an html or unicode entity with it's &amp; equivalent.
         $url = preg_replace('/&(?![\w\d#]{1,10};)/', '&amp;', $url);
-        
+
         return $url;
     }
-    
+
     /**
      * Prints a hidden form element with the PHPSESSID when cookies are not used, as well
-     * as hidden form elements for GET_VARS that might be in use. 
+     * as hidden form elements for GET_VARS that might be in use.
      *
      * @param  mixed  $carry_args        Additional url arguments to carry in the query,
@@ -707,5 +707,5 @@
             return false;
         }
-    
+
         // Get any provided query arguments to include in the final hidden form data.
         // If FALSE is a provided here, DO NOT carry the queries.
@@ -730,5 +730,5 @@
             }
         }
-        
+
         // For each existing POST value, we create a hidden input to carry it through a form.
         if ($do_carry_queries) {
@@ -740,5 +740,5 @@
             }
         }
-        
+
         // Include the SID if cookies are disabled.
         if (!isset($_COOKIE[session_name()]) && !ini_get('session.use_trans_sid')) {
@@ -746,5 +746,5 @@
         }
     }
-    
+
     /**
      * Uses an http header to redirect the client to the given $url. If sessions are not used
@@ -769,10 +769,10 @@
             return false;
         }
-        
+
         if ('' == $url) {
             // If URL is not specified, use the redirect_home_url.
             $url = $this->getParam('redirect_home_url');
         }
-    
+
         if (preg_match('!^/!', $url)) {
             // If relative URL is given, prepend correct local hostname.
@@ -783,8 +783,8 @@
 
         $url = $this->url($url, $carry_args, $always_include_sid);
-        
+
         header(sprintf('Location: %s', $url));
         $this->logMsg(sprintf('dieURL: %s', $url), LOG_DEBUG, __FILE__, __LINE__);
-        
+
         // End this application.
         // Recommended, although I'm not sure it's necessary: http://cn2.php.net/session_write_close
@@ -792,5 +792,5 @@
         die;
     }
-    
+
     /**
      * Redirects a user by calling the App::dieURL(). It will use:
@@ -808,5 +808,5 @@
             return false;
         }
-        
+
         // Get URL from stored boomerang. Allow non specific URL if ID not valid.
         if ($this->validBoomerangURL($id, true)) {
@@ -829,6 +829,6 @@
             $this->logMsg(sprintf('dieBoomerangURL(%s) not found, using redirect_home_url: %s', $id, $url), LOG_DEBUG, __FILE__, __LINE__);
         }
-    
-            
+
+
         // A redirection will never happen immediatly twice.
         // Set the time so ensure this doesn't happen.
@@ -836,5 +836,5 @@
         $this->dieURL($url, $carry_args);
     }
-    
+
     /**
      * Set the URL to return to when App::dieBoomerangURL() is called.
@@ -855,9 +855,9 @@
         // A redirection will never happen immediatly after setting the boomerangURL.
         // Set the time so ensure this doesn't happen. See App::validBoomerangURL for more.
-    
+
         if ('' != $url && is_string($url)) {
             // Delete any boomerang request keys in the query string.
             $url = preg_replace('/boomerang=[\w]+/', '', $url);
-            
+
             if (isset($_SESSION[$this->app]['boomerang']['url']) && is_array($_SESSION[$this->app]['boomerang']['url']) && !empty($_SESSION[$this->app]['boomerang']['url'])) {
                 // If the URL currently exists in the boomerang array, delete.
@@ -866,5 +866,5 @@
                 }
             }
-            
+
             if (isset($id)) {
                 $_SESSION[$this->app]['boomerang']['url'][$id] = $url;
@@ -879,5 +879,5 @@
         }
     }
-    
+
     /**
      * Return the URL set for the specified $id.
@@ -894,5 +894,5 @@
             return false;
         }
-        
+
         if (isset($id)) {
             if (isset($_SESSION[$this->app]['boomerang']['url'][$id])) {
@@ -907,5 +907,5 @@
         }
     }
-    
+
     /**
      * Delete the URL set for the specified $id.
@@ -922,5 +922,5 @@
             return false;
         }
-        
+
         $this->logMsg(sprintf('deleteBoomerangURL(%s): %s', $id, $this->getBoomerangURL($id)), LOG_DEBUG, __FILE__, __LINE__);
 
@@ -931,5 +931,5 @@
         }
     }
-    
+
     /**
      * Check if a valid boomerang URL value has been set.
@@ -947,14 +947,14 @@
             return false;
         }
-        
+
         if (!isset($_SESSION[$this->app]['boomerang']['url'])) {
             return false;
         }
-    
+
         // Time is the timestamp of a boomerangURL redirection, or setting of a boomerangURL.
         // a boomerang redirection will always occur at least several seconds after the last boomerang redirect
         // or a boomerang being set.
         $boomerang_time = isset($_SESSION[$this->app]['boomerang']['time']) ? $_SESSION[$this->app]['boomerang']['time'] : 0;
-        
+
         $url = '';
         if (isset($id) && isset($_SESSION[$this->app]['boomerang']['url'][$id])) {
@@ -964,5 +964,5 @@
             $url = end($_SESSION[$this->app]['boomerang']['url']);
         }
-    
+
         $this->logMsg(sprintf('validBoomerangURL(%s) testing: %s', $id, $url), LOG_DEBUG, __FILE__, __LINE__);
 
@@ -981,5 +981,5 @@
             return false;
         }
-        
+
         $this->logMsg(sprintf('validBoomerangURL(%s) is valid: %s', $id, $url), LOG_DEBUG, __FILE__, __LINE__);
         return true;
@@ -995,12 +995,12 @@
             $this =& App::getInstance();
         }
-        
+
         if (function_exists('apache_get_modules')) {
-        	$modules = apache_get_modules();
+            $modules = apache_get_modules();
         } else {
             // It's safe to assume we have mod_ssl if we can't determine otherwise.
             $modules = array('mod_ssl');
         }
-        
+
         if ('on' != getenv('HTTPS') && $this->getParam('ssl_enabled') && in_array('mod_ssl', $modules)) {
             $this->raiseMsg(sprintf(_("Secure SSL connection made to %s"), $this->getParam('ssl_domain')), MSG_NOTICE, __FILE__, __LINE__);
@@ -1009,6 +1009,6 @@
         }
     }
-        
-    
+
+
     /**
      * to enforce the user to connect via http (port 80) by redirecting them to
@@ -1022,5 +1022,5 @@
     }
 
-    
+
 } // End.
 
Index: /trunk/lib/Auth_File.inc.php
===================================================================
--- /trunk/lib/Auth_File.inc.php	(revision 41)
+++ /trunk/lib/Auth_File.inc.php	(revision 42)
@@ -86,5 +86,5 @@
     {
         $user_id = trim($user_id);
-        
+
         $this->clearAuth();
 
@@ -189,5 +189,5 @@
             }
             break;
-        default : 
+        default :
             App::logMsg('Encryption type not found.', LOG_ERR, __FILE__, __LINE__);
         }
@@ -209,5 +209,5 @@
             }
             break;
-        default : 
+        default :
             App::logMsg('Encryption type not found.', LOG_ERR, __FILE__, __LINE__);
         }
Index: /trunk/lib/Auth_SQL.inc.php
===================================================================
--- /trunk/lib/Auth_SQL.inc.php	(revision 41)
+++ /trunk/lib/Auth_SQL.inc.php	(revision 42)
@@ -8,8 +8,8 @@
 
 // Available encryption types for class Auth_SQL.
-define('AUTH_ENCRYPT_MD5', 'md5'); 
-define('AUTH_ENCRYPT_CRYPT', 'crypt'); 
-define('AUTH_ENCRYPT_SHA1', 'sha1'); 
-define('AUTH_ENCRYPT_PLAINTEXT', 'plaintext'); 
+define('AUTH_ENCRYPT_MD5', 'md5');
+define('AUTH_ENCRYPT_CRYPT', 'crypt');
+define('AUTH_ENCRYPT_SHA1', 'sha1');
+define('AUTH_ENCRYPT_PLAINTEXT', 'plaintext');
 
 class Auth_SQL {
@@ -22,23 +22,23 @@
     // Default param values.
     var $_default_params = array(
-    
+
         // Message displayed by requireLogin().
         'login_required_message' => 'Please login',
-        
+
         // Automatically create table and verify columns. Better set to false after site launch.
         'create_table' => true,
-        
+
         // The database table containing users to authenticate.
         'db_table' => 'user_tbl',
-        
+
         // The name of the primary key for the db_table.
         'db_primary_key' => 'user_id',
-        
+
         // The name of the username key for the db_table.
         'db_username_column' => 'username',
-        
+
         // If using the db_login_table feature, specify the db_login_table. The primary key must match the primary key for the db_table.
         'db_login_table' => 'user_login_tbl',
-        
+
         // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above.
         'encryption_type' => AUTH_ENCRYPT_MD5,
@@ -50,5 +50,5 @@
         // This applies to admins and users. In seconds. 21600 seconds = 6 hours.
         'login_timeout' => 21600,
-        
+
         // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire.
         // This applies to admins and users. In seconds. 3600 seconds = 1 hour.
@@ -65,14 +65,14 @@
         'login_abuse_max_ips' => 5,
 
-        // The IP address subnet size threshold. Uses a CIDR notation network mask (see CIDR cheatsheet at bottom). 
-        // Any integar between 0 and 32 is permitted. Setting this to '24' permits any address in a 
+        // The IP address subnet size threshold. Uses a CIDR notation network mask (see CIDR cheatsheet at bottom).
+        // Any integar between 0 and 32 is permitted. Setting this to '24' permits any address in a
         // class C network (255.255.255.0) to be considered the same. Setting to '32' compares each IP absolutely.
         // Setting to '0' ignores all IPs, thus disabling login_abuse checking.
         'login_abuse_ip_bitmask' => 32,
 
-        // Specify usernames to exclude from the account abuse detection system. This is specified as a hardcoded array provided at 
+        // Specify usernames to exclude from the account abuse detection system. This is specified as a hardcoded array provided at
         // class instantiation time, or can be saved in the db_table under the login_abuse_exempt field.
         'login_abuse_exempt_usernames' => array(),
-        
+
         // An array of IP blocks that are bypass the remote_addr comparison check. Useful for dynamic IPs or those behind proxy servers.
         'trusted_networks' => array(),
@@ -80,5 +80,5 @@
         // Allow user accounts to be blocked? Requires the user table to have the columns 'blocked' and 'blocked_reason'
         'blocking' => false,
-    
+
         // Use a db_login_table to detect excessive logins. This requires blocking to be enabled.
         'abuse_detection' => false,
@@ -106,5 +106,5 @@
         }
     }
-    
+
     /**
      * Setup the database tables for this class.
@@ -117,7 +117,7 @@
     {
         static $_db_tested = false;
-    
+
         if ($recreate_db || !$_db_tested && $this->getParam('create_table')) {
-        
+
             // User table.
             if ($recreate_db) {
@@ -154,28 +154,28 @@
 
             if (!DB::columnExists($this->getParam('db_table'), array(
-				$this->getParam('db_primary_key'),
-				$this->getParam('db_username_column'),
-				'userpass',
-				'first_name',
-				'last_name',
-				'email',
-				'user_type',
-				'login_abuse_exempt',
-				'blocked',
-				'blocked_reason',
-				'abuse_warning_level',
-				'seconds_online',
-				'last_login_datetime',
-				'last_access_datetime',
-				'last_login_ip',
-				'added_by_user_id',
-				'modified_by_user_id',
-				'added_datetime',
-				'modified_datetime',
+                $this->getParam('db_primary_key'),
+                $this->getParam('db_username_column'),
+                'userpass',
+                'first_name',
+                'last_name',
+                'email',
+                'user_type',
+                'login_abuse_exempt',
+                'blocked',
+                'blocked_reason',
+                'abuse_warning_level',
+                'seconds_online',
+                'last_login_datetime',
+                'last_access_datetime',
+                'last_login_ip',
+                'added_by_user_id',
+                'modified_by_user_id',
+                'added_datetime',
+                'modified_datetime',
             ), false, false)) {
                 App::logMsg(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), LOG_ALERT, __FILE__, __LINE__);
                 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), E_USER_ERROR);
             }
-            
+
             // Login table is used for abuse_detection features.
             if ($this->getParam('abuse_detection')) {
@@ -192,5 +192,5 @@
                     KEY remote_ip_binary (remote_ip_binary)
                 )");
-                
+
                 if (!DB::columnExists($this->getParam('db_login_table'), array(
                     $this->getParam('db_primary_key'),
@@ -202,5 +202,5 @@
                 }
             }
-        }    
+        }
         $_db_tested = true;
     }
@@ -239,5 +239,5 @@
         }
     }
-    
+
     /**
      * Set the params of an auth object.
@@ -279,7 +279,7 @@
     {
         $this->initDB();
-        
+
         DB::query("
-            UPDATE " . $this->_params['db_table'] . " SET 
+            UPDATE " . $this->_params['db_table'] . " SET
             seconds_online = seconds_online + (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_access_datetime)),
             last_login_datetime = '0000-00-00 00:00:00'
@@ -301,13 +301,13 @@
     {
         $this->initDB();
-        
+
         // Query DB for user matching credentials.
         $qid = DB::query("
-            SELECT *, " . $this->_params['db_primary_key'] . " AS user_id 
+            SELECT *, " . $this->_params['db_primary_key'] . " AS user_id
             FROM " . $this->_params['db_table'] . "
             WHERE " . $this->_params['db_username_column'] . " = '" . addslashes($username) . "'
             AND BINARY userpass = '" . addslashes($this->encryptPassword($password)) . "'
         ");
-        
+
         // Return user data if found.
         if ($user_data = mysql_fetch_assoc($qid)) {
@@ -331,5 +331,5 @@
     {
         $this->initDB();
-        
+
         $this->clearAuth();
 
@@ -351,5 +351,5 @@
             'user_data'             => $user_data
         );
-        
+
         /**
          * Check if the account is blocked, respond in context to reason. Cancel the login if blocked.
@@ -357,7 +357,7 @@
         if ($this->getParam('blocking')) {
             if (!empty($user_data['blocked'])) {
-                
+
                 App::logMsg(sprintf('%s %s (%s) login failed due to blocked account: %s', ucfirst($this->_auth), $this->getVal('user_id'), $this->getVal('username'), $this->getVal('blocked_reason')), LOG_NOTICE, __FILE__, __LINE__);
-                
+
                 switch ($user_data['blocked_reason']) {
                     case 'account abuse' :
@@ -368,5 +368,5 @@
                         break;
                 }
-                
+
                 // No login: user is blocked!
                 $this->clearAuth();
@@ -374,5 +374,5 @@
             }
         }
-        
+
         /**
          * Check the db_login_table for too many logins under this account.
@@ -412,6 +412,6 @@
             DB::query("
                 INSERT INTO " . $this->_params['db_login_table'] . " (
-                    " . $this->_params['db_primary_key'] . ", 
-                    login_datetime, 
+                    " . $this->_params['db_primary_key'] . ",
+                    login_datetime,
                     remote_ip_binary
                 ) VALUES (
@@ -422,5 +422,5 @@
             ");
         }
-        
+
         // Update user table with this login.
         DB::query("
@@ -431,5 +431,5 @@
             WHERE " . $this->_params['db_primary_key'] . " = '" . $this->getVal('user_id') . "'
         ");
-        
+
         // We're logged-in!
         return true;
@@ -449,5 +449,5 @@
     {
         $this->initDB();
-        
+
         if (isset($user_id)) {
             // Check the login status of a specific user.
@@ -465,5 +465,5 @@
             return $_SESSION[$this->_sess]['authenticated'];
         }
-        
+
         // Tesing login should occur once. This is the first time. Set flag.
         $this->_authentication_tested = true;
@@ -472,6 +472,6 @@
         if ($trusted_net = ipInRange(getRemoteAddr(), $this->_params['trusted_networks'])) {
             $user_in_trusted_network = true;
-            App::logMsg(sprintf('%s%s accessing from trusted network %s', 
-                ucfirst($this->_auth), 
+            App::logMsg(sprintf('%s%s accessing from trusted network %s',
+                ucfirst($this->_auth),
                 ($this->getVal('user_id') ? ' ' . $this->getVal('user_id') . ' (' .  $this->getVal('username') . ')' : ''),
                 $trusted_net
@@ -479,6 +479,6 @@
         } else if (preg_match('/proxy.aol.com$/i', getRemoteAddr(true))) {
             $user_in_trusted_network = true;
-            App::logMsg(sprintf('%s%s accessing from trusted network proxy.aol.com', 
-                ucfirst($this->_auth), 
+            App::logMsg(sprintf('%s%s accessing from trusted network proxy.aol.com',
+                ucfirst($this->_auth),
                 ($this->getVal('user_id') ? ' ' . $this->getVal('user_id') . ' (' .  $this->getVal('username') . ')' : '')
             ), LOG_INFO, __FILE__, __LINE__);
@@ -486,5 +486,5 @@
             $user_in_trusted_network = false;
         }
-        
+
         // Test login with information stored in session. Skip IP matching for users from trusted networks.
         if (isset($_SESSION[$this->_sess])
@@ -500,5 +500,5 @@
             // Update the DB with the last_access_datetime and increment the seconds_online.
             DB::query("
-                UPDATE " . $this->_params['db_table'] . " SET 
+                UPDATE " . $this->_params['db_table'] . " SET
                 seconds_online = seconds_online + (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_access_datetime)) + 1,
                 last_access_datetime = '" . $this->getVal('last_access_datetime') . "'
@@ -517,5 +517,5 @@
                 App::raiseMsg(sprintf(_("Your %s session has closed. You need to log-in again."), strtolower($this->_auth)), MSG_NOTICE, __FILE__, __LINE__);
             }
-            
+
             // Log the reason for login expiration.
             $expire_reasons = array();
@@ -565,5 +565,5 @@
      * This sets the 'blocked' field for a user in the db_table, and also
      * adds an optional reason
-     * 
+     *
      * @param  string   $reason      The reason for blocking the account.
      */
@@ -571,5 +571,5 @@
     {
         $this->initDB();
-        
+
         if ($this->getParam('blocking')) {
             if (strlen(addslashes($reason)) > 255) {
@@ -577,5 +577,5 @@
                 App::logMsg(sprintf('Blocked reason provided is greater than 255 characters: %s', $reason), LOG_WARNING, __FILE__, __LINE__);
             }
-            
+
             // Get user_id if specified.
             $user_id = isset($user_id) ? $user_id : $this->getVal('user_id');
@@ -590,10 +590,10 @@
 
     /**
-     * Unblocks a user in the db_table, and clears any blocked_reason. 
+     * Unblocks a user in the db_table, and clears any blocked_reason.
      */
     function unblockAccount($user_id=null)
     {
         $this->initDB();
-        
+
         if ($this->getParam('blocking')) {
             // Get user_id if specified.
@@ -615,9 +615,9 @@
      */
     function usernameExists($username)
-    {   
-        $this->initDB();
-        
+    {
+        $this->initDB();
+
         $qid = DB::query("
-            SELECT 1 
+            SELECT 1
             FROM " . $this->_params['db_table'] . "
             WHERE " . $this->_params['db_username_column'] . " = '" . addslashes($username) . "'
@@ -633,7 +633,7 @@
      */
     function getUsername($user_id)
-    {   
-        $this->initDB();
-        
+    {
+        $this->initDB();
+
         $qid = DB::query("
             SELECT " . $this->_params['db_username_column'] . "
@@ -679,5 +679,5 @@
         return $str;
     }
-    
+
     /**
      *
@@ -689,13 +689,13 @@
             return $password;
             break;
-            
+
         case AUTH_ENCRYPT_CRYPT :
             return crypt($password, crypt($password));
             break;
-            
+
         case AUTH_ENCRYPT_SHA1 :
             return sha1($password);
             break;
-            
+
         case AUTH_ENCRYPT_MD5 :
         default :
@@ -706,16 +706,16 @@
 
     /**
-     * 
+     *
      */
     function setPassword($user_id=null, $password)
-    {   
-        $this->initDB();
-             
+    {
+        $this->initDB();
+
         // Get user_id if specified.
         $user_id = isset($user_id) ? $user_id : $this->getVal('user_id');
-        
+
         // Issue the password change query.
         DB::query("
-            UPDATE " . $this->_params['db_table'] . " 
+            UPDATE " . $this->_params['db_table'] . "
             SET userpass = '" . addslashes($this->encryptPassword($password)) . "'
             WHERE " . $this->_params['db_primary_key'] . " = '" . addslashes($user_id) . "'
@@ -733,8 +733,8 @@
     {
         $this->initDB();
-        
+
         // Get user_id if specified.
         $user_id = isset($user_id) ? $user_id : $this->getVal('user_id');
-        
+
         // Reset password of a specific user.
         $qid = DB::query("
@@ -746,5 +746,5 @@
             return false;
         }
-        
+
         // Make sure user has an email on record.
         if (!isset($user_data['email']) || '' == trim($user_data['email'])) {
@@ -754,5 +754,5 @@
         // Get new password.
         $password = $this->generatePassword();
-        
+
         // Update password query.
         $this->setPassword($user_id, $password);
@@ -791,14 +791,14 @@
         ));
         $email->send();
-    
+
         return array(
-            'username' => $user_data[$this->_params['db_username_column']], 
+            'username' => $user_data[$this->_params['db_username_column']],
             'userpass' => $password
         );
     }
-    
+
     /**
      * If the current user has access to the specified $security_zone, return true.
-     * If the optional $priv is supplied, test that against the zone. 
+     * If the optional $priv is supplied, test that against the zone.
      *
      * @param  constant $security_zone   string of comma delimited priviliges for the zone
@@ -811,6 +811,6 @@
         $zone_members = preg_split('/,\s*/', $security_zone);
         $priv = empty($priv) ? $this->getVal('priv') : $priv;
-        
-        // If the current user's privilege level is NOT in that array or if the 
+
+        // If the current user's privilege level is NOT in that array or if the
         // user has no privilege, return false. Otherwise the user is clear.
         if (!in_array($priv, $zone_members) || empty($priv)) {
@@ -820,8 +820,8 @@
         }
     }
-    
+
     /**
      * This function tests a list of arguments $security_zone against the priv that the current user has.
-     * If the user doesn't have one of the supplied privs, die. 
+     * If the user doesn't have one of the supplied privs, die.
      *
      * @param  constant $security_zone   string of comma delimited priviliges for the zone
@@ -831,6 +831,6 @@
         return true;
         $zone_members = preg_split('/,\s*/', $security_zone);
-    
-        /* If the current user's privilege level is NOT in that array or if the 
+
+        /* If the current user's privilege level is NOT in that array or if the
          * user has no privilege, DIE with a message. */
         if (!in_array($this->getVal('priv'), $zone_members) || !$this->getVal('priv')) {
@@ -845,5 +845,5 @@
 // CIDR cheatsheet
 //
-// Netmask              Netmask (binary)                 CIDR     Notes    
+// Netmask              Netmask (binary)                 CIDR     Notes
 // _____________________________________________________________________________
 // 255.255.255.255  11111111.11111111.11111111.11111111  /32  Host (single addr)
@@ -856,5 +856,5 @@
 // 255.255.255.128  11111111.11111111.11111111.10000000  /25  126  useable
 // 255.255.255.0    11111111.11111111.11111111.00000000  /24 "Class C" 254 useable
-// 
+//
 // 255.255.254.0    11111111.11111111.11111110.00000000  /23    2  Class C's
 // 255.255.252.0    11111111.11111111.11111100.00000000  /22    4  Class C's
@@ -865,5 +865,5 @@
 // 255.255.128.0    11111111.11111111.10000000.00000000  /17  128  Class C's
 // 255.255.0.0      11111111.11111111.00000000.00000000  /16  "Class B"
-//      
+//
 // 255.254.0.0      11111111.11111110.00000000.00000000  /15    2  Class B's
 // 255.252.0.0      11111111.11111100.00000000.00000000  /14    4  Class B's
@@ -874,5 +874,5 @@
 // 255.128.0.0      11111111.10000000.00000000.00000000  /9   128  Class B's
 // 255.0.0.0        11111111.00000000.00000000.00000000  /8   "Class A"
-//   
+//
 // 254.0.0.0        11111110.00000000.00000000.00000000  /7
 // 252.0.0.0        11111100.00000000.00000000.00000000  /6
Index: /trunk/lib/AuthorizeNet.inc.php
===================================================================
--- /trunk/lib/AuthorizeNet.inc.php	(revision 41)
+++ /trunk/lib/AuthorizeNet.inc.php	(revision 42)
@@ -37,5 +37,5 @@
 
 require_once dirname(__FILE__) . '/Utilities.inc.php';
- 
+
 class AuthorizeNet
 {
@@ -232,7 +232,7 @@
         return (
             strtolower($this->getResult('x_md5_hash')) == strtolower(md5(
-                $this->md5_hash_value . 
-                $this->getParam('x_login') . 
-                $this->getResult('x_trans_id') . 
+                $this->md5_hash_value .
+                $this->getParam('x_login') .
+                $this->getResult('x_trans_id') .
                 $this->getResult('x_amount')
             ))
Index: /trunk/lib/CSS.inc.php
===================================================================
--- /trunk/lib/CSS.inc.php	(revision 41)
+++ /trunk/lib/CSS.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * CSS.inc.css 
+ * CSS.inc.css
  * code by strangecode :: www.strangecode.com :: this document contains copyrighted information
  *
@@ -13,5 +13,5 @@
     // Include these style sheets.
     var $_css_files = array('default' => array());
-    
+
     // Cache style sheets?
     var $_params = array(
@@ -19,5 +19,5 @@
         'character_set' => 'utf-8',
     );
-    
+
     /**
      * Set (or overwrite existing) parameters by passing an array of new parameters.
@@ -52,5 +52,5 @@
         }
     }
-    
+
     /**
      * Add a file-path to the array of files to include as CSS.
@@ -64,5 +64,5 @@
     {
         if (!is_array($apps)) {
-        	$apps = array($apps);
+            $apps = array($apps);
         }
 
@@ -103,5 +103,5 @@
         sort($files_mtime, SORT_NUMERIC);
         $latest_mtime = array_pop($files_mtime);
-        
+
         if ($this->_params['cache_css']) {
             header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $latest_mtime) . ' GMT');
@@ -114,5 +114,5 @@
         header('Content-Type: text/css; charset=' . $this->_params['character_set']);
     }
-    
+
     /**
      * Include CSS files specified by setFile().
@@ -130,10 +130,10 @@
             return false;
         }
-        
+
         foreach ($this->_css_files[$app] as $file) {
             include $file;
         }
     }
-    
+
 }
 ?>
Index: /trunk/lib/Captcha.inc.php
===================================================================
--- /trunk/lib/Captcha.inc.php	(revision 41)
+++ /trunk/lib/Captcha.inc.php	(revision 42)
@@ -1,3 +1,3 @@
-<?php 
+<?php
 /**
  * Captcha.inc.php
@@ -10,5 +10,5 @@
  */
 class Captcha {
-    
+
     var $secret_key = 'some random seed text for the md5';
     var $ascii_numbers = array(
@@ -95,5 +95,5 @@
         )
     );
-    
+
     /**
      * Print ASCII number.
@@ -109,7 +109,7 @@
         if (preg_match('/[^\d]/', $num)) {
             App::logMsg(sprintf('Bad number: %s', $num), LOG_ERR, __FILE__, __LINE__);
-        	return false;
+            return false;
         }
-        
+
         // Number must be an array of strings.
         $num = preg_split('// ', strval($num), -1, PREG_SPLIT_NO_EMPTY);
@@ -124,8 +124,8 @@
             $output .= "\n";
         }
-        
+
         return $output;
     }
-    
+
     /**
      * Prints a form to enter captcha, including the required hidden hash form.
@@ -148,7 +148,7 @@
         <?php
     }
-    
-    /**
-     * Validate submitted number against ascii captcha. 
+
+    /**
+     * Validate submitted number against ascii captcha.
      * Regenerate md5 hash from submitted captcha number and compare with posted hash.
      *
@@ -164,5 +164,5 @@
 
         if ('' == $number . $hash) {
-        	return false;
+            return false;
         }
 
@@ -182,5 +182,5 @@
         return rand(1000, 9999);
     }
-        
+
     /**
      * Generate md5 hash of number using secret key.
@@ -196,5 +196,5 @@
         return md5($this->secret_key . $input);
     }
-    
+
 }
 
Index: /trunk/lib/DB.inc.php
===================================================================
--- /trunk/lib/DB.inc.php	(revision 41)
+++ /trunk/lib/DB.inc.php	(revision 42)
@@ -9,5 +9,5 @@
  * @version 1.0.1
  */
- 
+
 class DB {
 
@@ -35,5 +35,5 @@
         'db_die_on_failure' => false, // TRUE = script stops on db error.
     );
-    
+
     // Translate between HTML and MySQL character set names.
     var $mysql_character_sets = array(
@@ -41,9 +41,9 @@
         'iso-8859-1' => 'latin1',
     );
-    
+
     // Caches.
     var $existing_tables;
     var $table_columns;
-    
+
     /**
      * This method enforces the singleton pattern for this class.
@@ -63,5 +63,5 @@
         return $instance;
     }
-    
+
     /**
      * Constructor.
@@ -119,5 +119,5 @@
         }
     }
-    
+
     /**
      * Connect to database with credentials in params.
@@ -132,16 +132,16 @@
             $this =& DB::getInstance();
         }
-        
+
         if (!$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass')) {
             App::logMsg('Database credentials missing.', LOG_EMERG, __FILE__, __LINE__);
             return false;
         }
-        
+
         // Connect to database. Always create a new link to the server.
-        if ($this->dbh = mysql_connect($this->getParam('db_server'), $this->getParam('db_user'), $this->getParam('db_pass'), true)) {    
+        if ($this->dbh = mysql_connect($this->getParam('db_server'), $this->getParam('db_user'), $this->getParam('db_pass'), true)) {
             // Select database
             mysql_select_db($this->getParam('db_name'), $this->dbh);
         }
-        
+
         // Test for connection errors.
         if (!$this->dbh || mysql_error($this->dbh)) {
@@ -164,5 +164,5 @@
             }
         }
-        
+
         // DB connection success!
         $this->_connected = true;
@@ -173,5 +173,5 @@
         return true;
     }
-    
+
     /**
      * Close db connection.
@@ -186,12 +186,12 @@
             $this =& DB::getInstance();
         }
-        
-        if (!$this->_connected) {
-            return false;
-        }
-
-        mysql_close($this->dbh);        
-    }
-    
+
+        if (!$this->_connected) {
+            return false;
+        }
+
+        mysql_close($this->dbh);
+    }
+
     /**
      * Return the current database handler.
@@ -207,5 +207,5 @@
             $this =& DB::getInstance();
         }
-        
+
         if (!$this->_connected) {
             return false;
@@ -214,5 +214,5 @@
         return $this->dbh;
     }
-    
+
     /**
      * Returns connection status
@@ -226,5 +226,5 @@
         return $this->_connected;
     }
-    
+
     /**
      * A wrapper for mysql_query. Allows us to set the database link_identifier,
@@ -238,9 +238,9 @@
     {
         static $_query_count = 0;
-        
-        if (!isset($this) || !is_a($this, 'DB')) {
-            $this =& DB::getInstance();
-        }
-        
+
+        if (!isset($this) || !is_a($this, 'DB')) {
+            $this =& DB::getInstance();
+        }
+
         if (!$this->_connected) {
            return false;
@@ -252,8 +252,8 @@
             echo "<!-- ----------------- Query $_query_count ---------------------\n$debugqry\n-->\n";
         }
-        
+
         // Execute!
         $qid = mysql_query($query, $this->dbh);
-    
+
         // Error checking.
         if (!$qid || mysql_error($this->dbh)) {
@@ -269,12 +269,12 @@
             }
         }
-    
+
         return $qid;
     }
 
     /**
-     * Loads a list of tables in the current database into an array, and returns 
+     * Loads a list of tables in the current database into an array, and returns
      * true if the requested table is found. Use this function to enable/disable
-     * funtionality based upon the current available db tables or to dynamically 
+     * funtionality based upon the current available db tables or to dynamically
      * create tables if missing.
      *
@@ -284,9 +284,9 @@
      */
     function tableExists($table, $use_cached_results=true)
-    {   
-        if (!isset($this) || !is_a($this, 'DB')) {
-            $this =& DB::getInstance();
-        }
-        
+    {
+        if (!isset($this) || !is_a($this, 'DB')) {
+            $this =& DB::getInstance();
+        }
+
         if (!$this->_connected) {
             return false;
@@ -307,5 +307,5 @@
         }
     }
-    
+
     /**
      * Tests if the given array of columns exists in the specified table.
@@ -318,9 +318,9 @@
      */
     function columnExists($table, $columns, $strict=true, $use_cached_results=true)
-    {   
-        if (!isset($this) || !is_a($this, 'DB')) {
-            $this =& DB::getInstance();
-        }
-        
+    {
+        if (!isset($this) || !is_a($this, 'DB')) {
+            $this =& DB::getInstance();
+        }
+
         if (!$this->_connected) {
             return false;
@@ -331,10 +331,10 @@
             return false;
         }
-        
+
         // For single-value columns.
         if (!is_array($columns)) {
             $columns = array($columns);
         }
-        
+
         if (!isset($this->table_columns[$table]) || !$use_cached_results) {
             // Populate and cache array of current columns for this table.
@@ -345,5 +345,5 @@
             }
         }
-    
+
         if ($strict) {
             // Do an exact comparison of table schemas.
@@ -359,5 +359,5 @@
         }
     }
-    
+
     /**
      * Reset cached items.
@@ -372,5 +372,5 @@
         $this->table_columns = null;
     }
-    
+
 } // End.
 
Index: /trunk/lib/DBSessionHandler.inc.php
===================================================================
--- /trunk/lib/DBSessionHandler.inc.php	(revision 41)
+++ /trunk/lib/DBSessionHandler.inc.php	(revision 42)
@@ -9,5 +9,5 @@
 
 class DBSessionHandler {
-    
+
     var $db; // DB object.
 
@@ -20,11 +20,11 @@
         'create_table' => true, // Automatically create table and verify columns. Better set to false after site launch.
     );
-    
+
     /**
      * Constructor
      *
      * @access  public
-     * @param   
-     * @return  
+     * @param
+     * @return
      * @author  Quinn Comendant <quinn@strangecode.com>
      * @since   18 Jul 2005 11:02:50
@@ -33,13 +33,13 @@
     {
         $this->_params = array_merge($this->_params, $params);
-        
+
         if (isset($db)) {
             if (is_a($db, 'DB')) {
-            	if ($db->isConnected()) {
+                if ($db->isConnected()) {
                     // Use existing db connection.
                     $this->db =& $db;
-            	} else {
+                } else {
                     App::logMsg(sprintf('Provided DB object is not connected. %s', mysql_error($db->dbh)), LOG_ERR, __FILE__, __LINE__);
-            	}
+                }
             } else {
                 App::logMsg(sprintf('Provided DB object is not valid. %s', gettype($db)), LOG_ERR, __FILE__, __LINE__);
@@ -48,5 +48,5 @@
             // Create our own new db connection.
             require_once dirname(__FILE__) . '/DB.inc.php';
-            
+
             $this->db =& new DB();
             $this->db->setParam(array(
@@ -59,5 +59,5 @@
                 'db_die_on_failure' => $this->_params['db_die_on_failure'],
             ));
-            
+
             // Connect to database.
             $this->db->connect();
@@ -67,13 +67,13 @@
             trigger_error('Invalid DB object or unable to connect to database.', E_USER_ERROR);
         }
-        
+
         // Get create tables config from global context.
         if (!is_null(App::getParam('db_create_tables'))) {
             $this->_params['create_table'] = App::getParam('db_create_tables');
         }
-        
+
         // Ensure db table is fit.
         $this->initDB();
-        
+
         ini_set('session.save_handler', 'user');
         session_set_save_handler(
@@ -97,5 +97,5 @@
     {
         static $_db_tested = false;
-    
+
         if ($recreate_db || !$_db_tested && $this->_params['create_table']) {
             if ($recreate_db) {
@@ -110,10 +110,10 @@
                 KEY last_access (last_access)
             )");
-            
+
             if (!$this->db->columnExists($this->_params['db_table'], array('session_id', 'session_data', 'last_access'))) {
                 App::logMsg(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->_params['db_table']), LOG_ALERT, __FILE__, __LINE__);
                 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->_params['db_table']), E_USER_ERROR);
             }
-        }    
+        }
         $_db_tested = true;
     }
@@ -121,17 +121,17 @@
     function dbSessionOpen($save_path, $sess_name)
     {
-        return true; 
+        return true;
     }
-    
+
     function dbSessionClose()
     {
         return true;
     }
-    
+
     function dbSessionRead($session_id)
     {
-        // Select the data belonging to session $session_id from the session table    
+        // Select the data belonging to session $session_id from the session table
         $qid = $this->db->query("SELECT session_data FROM " . $this->_params['db_table'] . " WHERE session_id = '" . addslashes($session_id) . "'");
-        
+
         // Return the session data that was found
         if (mysql_num_rows($qid) == 1) {
@@ -139,31 +139,31 @@
             return $row[0];
         }
-        
+
         // NOTICE: Output is expected to be an empty string always rather than 'false'.
         return '';
     }
-    
+
     function dbSessionWrite($session_id, $session_data)
-    {   
+    {
         // Write the serialized session data ($session_data) to the session table
         $this->db->query("REPLACE INTO " . $this->_params['db_table'] . "(session_id, session_data, last_access) VALUES ('" . addslashes($session_id) . "', '" . addslashes($session_data) . "', null)");
-            
-        return true;     
+
+        return true;
     }
-    
+
     function dbSessionDestroy($session_id)
     {
         // Delete from the table all data for the session $session_id
         $this->db->query("DELETE FROM " . $this->_params['db_table'] . " WHERE session_id = '" . addslashes($session_id) . "'");
-    
-        return true;     
+
+        return true;
     }
-    
+
     function dbSessionGarbage($max_lifetime=4000)
     {
         // Delete old values from the session table
         $qid = $this->db->query("DELETE FROM " . $this->_params['db_table'] . " WHERE UNIX_TIMESTAMP(last_access) < " . (time() - $max_lifetime));
-            
-        return true;     
+
+        return true;
     }
 }
Index: /trunk/lib/Email.inc.php
===================================================================
--- /trunk/lib/Email.inc.php	(revision 41)
+++ /trunk/lib/Email.inc.php	(revision 42)
@@ -40,8 +40,8 @@
         'regex' => null
     );
-    
+
     // String that contains the email body.
     var $_template;
-    
+
     // String that contains the email body after replacements.
     var $_template_replaced;
@@ -58,10 +58,10 @@
     {
         // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatination . dot.
-        // This matches an email address as complex as: 
+        // This matches an email address as complex as:
         //      Bob Smith <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
         // ...and something as simple as:
         //      x@x.com
         $this->setParam(array('regex' => '/^(?:[^,@]*\s+|[^,@]*(<)|)'   // Display name
-        . '((?:[^.<>\s@\",\[\]]+[^<>\s@\",\[\]])*[^.<>\s@\",\[\]]+)'    // Local-part 
+        . '((?:[^.<>\s@\",\[\]]+[^<>\s@\",\[\]])*[^.<>\s@\",\[\]]+)'    // Local-part
         . '@'                                                           // @
         . '((?:(\[)|[A-Z0-9]?)'                                         // Domain, first char
@@ -165,5 +165,5 @@
         }
     }
-    
+
     /**
      * Replace variables in template with argument data.
@@ -179,13 +179,13 @@
         if (!isset($this->_template)) {
             App::logMsg(sprintf('Cannot replace variables, no template defined.', null), LOG_ERR, __FILE__, __LINE__);
-        	return false;
-        }
-        
+            return false;
+        }
+
         // Ensure replacements argument is an array.
         if (!is_array($replacements)) {
             App::logMsg(sprintf('Cannot replace variables, invalid replacements.', null), LOG_ERR, __FILE__, __LINE__);
-        	return false;
-        }
-        
+            return false;
+        }
+
         // Apply regex pattern to search elements.
         $search = array_keys($replacements);
@@ -194,5 +194,5 @@
         // Replacement values.
         $replace = array_values($replacements);
-        
+
         // Search and replace all values at once.
         $this->_template_replaced = preg_replace($search, $replace, $this->_template);
@@ -213,28 +213,28 @@
         // Use arguments if provided.
         if (isset($to)) {
-        	 $this->setParam(array('to' => $to));
+             $this->setParam(array('to' => $to));
         }
         if (isset($from)) {
-        	 $this->setParam(array('from' => $from));
+             $this->setParam(array('from' => $from));
         }
         if (isset($subject)) {
-        	 $this->setParam(array('subject' => $subject));
+             $this->setParam(array('subject' => $subject));
         }
         if (isset($headers)) {
-        	 $this->setParam(array('headers' => $headers));
+             $this->setParam(array('headers' => $headers));
         }
 
         // Ensure required values exist.
         if (!isset($this->_template)) {
-        	App::logMsg(sprintf('Cannot send email. Template not set.', null), LOG_ERR, __FILE__, __LINE__);
+            App::logMsg(sprintf('Cannot send email. Template not set.', null), LOG_ERR, __FILE__, __LINE__);
             return false;
         } else if (!isset($this->_params['to'])) {
-        	App::logMsg(sprintf('Cannot send email. TO not defined.', null), LOG_ERR, __FILE__, __LINE__);
+            App::logMsg(sprintf('Cannot send email. TO not defined.', null), LOG_ERR, __FILE__, __LINE__);
             return false;
         } else if (!isset($this->_params['from'])) {
-        	App::logMsg(sprintf('Cannot send email. FROM not defined.', null), LOG_ERR, __FILE__, __LINE__);
+            App::logMsg(sprintf('Cannot send email. FROM not defined.', null), LOG_ERR, __FILE__, __LINE__);
             return false;
         } else if (!isset($this->_params['subject'])) {
-        	App::logMsg(sprintf('Cannot send email. SUBJECT not defined.', null), LOG_ERR, __FILE__, __LINE__);
+            App::logMsg(sprintf('Cannot send email. SUBJECT not defined.', null), LOG_ERR, __FILE__, __LINE__);
             return false;
         }
@@ -245,11 +245,11 @@
         // Ensure all placeholders have been replaced. Find anything with {...} characters.
         if (preg_match('/({[^}]+})/', $final_body, $unreplaced_match)) {
-        	App::logMsg(sprintf('Cannot send email. Variables left unreplaced in template: %s', (isset($unreplaced_match[1]) ? $unreplaced_match[1] : '')), LOG_ERR, __FILE__, __LINE__);
-            return false;
-        }
-        
+            App::logMsg(sprintf('Cannot send email. Variables left unreplaced in template: %s', (isset($unreplaced_match[1]) ? $unreplaced_match[1] : '')), LOG_ERR, __FILE__, __LINE__);
+            return false;
+        }
+
         // Final "to" header can have multiple addresses if in an array.
         $final_to = is_array($this->_params['to']) ? join(', ', $this->_params['to']) : $this->_params['to'];
-        
+
         // From headers are custom headers.
         $headers = array('From' => $this->_params['from']);
@@ -259,5 +259,5 @@
             $headers = array_merge($this->_params['headers'], $headers);
         }
-        
+
         // Process headers.
         $final_headers = array();
@@ -266,13 +266,13 @@
         }
         $final_headers = join("\r\n", $final_headers);
-        
+
         // This is the address where delivery problems are sent to. We must strip off everything except the local@domain part.
         $envelope_sender_header = sprintf('-f %s', preg_replace('/^.*<?([^\s@\[\]<>()]+\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5})>?$/iU', '$1', $this->_params['from']));
-        
+
         // Check for mail header injection attacks.
         $full_mail_content = join("\n", array($final_to, $this->_params['subject'], $final_body, $final_headers, $envelope_sender_header));
         if (preg_match("/(Content-Type:|MIME-Version:|Content-Transfer-Encoding:|[\n\r]Bcc:|[\n\r]Cc:)/i", $full_mail_content)) {
-        	App::logMsg(sprintf('Mail header injection attack in content: %s', $full_mail_content), LOG_WARNING, __FILE__, __LINE__);
-        	sleep(3);
+            App::logMsg(sprintf('Mail header injection attack in content: %s', $full_mail_content), LOG_WARNING, __FILE__, __LINE__);
+            sleep(3);
             return false;
         }
@@ -283,11 +283,11 @@
             return false;
         }
-        
+
         return true;
     }
-    
+
     /**
      * Validates an email address based on the recommendations in RFC 3696.
-     * Is more loose than restrictive, to allow the many valid variants of 
+     * Is more loose than restrictive, to allow the many valid variants of
      * email addresses while catching the most common mistakes. Checks an array too.
      * http://www.faqs.org/rfcs/rfc822.html
Index: /trunk/lib/FormValidator.inc.php
===================================================================
--- /trunk/lib/FormValidator.inc.php	(revision 41)
+++ /trunk/lib/FormValidator.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * FormValidator.inc.php 
+ * FormValidator.inc.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  *
@@ -25,5 +25,5 @@
 class FormValidator
 {
-    
+
     /**
      * Array filling with errors. The key will be the name of the form where
@@ -31,5 +31,5 @@
      */
     var $errors = array();
-    
+
     /**
      * Return the current list of errors.
@@ -43,5 +43,5 @@
         return $this->errors;
     }
-    
+
     /**
      * Add an error to the errors stack.
@@ -64,5 +64,5 @@
         );
     }
-    
+
     /**
      * Check whether any errors have been triggered.
@@ -70,5 +70,5 @@
      * @param  string $form_name the name of the incoming form variable
      *
-     * @return bool   true if any errors were found, or if found for 
+     * @return bool   true if any errors were found, or if found for
      *                a variable of $form_name, false otherwise
      */
@@ -78,5 +78,5 @@
             foreach ($this->errors as $err) {
                 if ($err['name'] == $form_name) {
-                    return true;   
+                    return true;
                 }
             }
@@ -115,13 +115,13 @@
                         echo '<div class="error">' . $err['message'] . '</div>';
                         break;
-            
+
                     case MSG_WARNING:
                         echo '<div class="warning">' . $err['message'] . '</div>';
                         break;
-            
+
                     case MSG_SUCCESS:
                         echo '<div class="success">' . $err['message'] . '</div>';
                         break;
-            
+
                     case MSG_NOTICE:
                     default:
@@ -134,5 +134,5 @@
         }
     }
-    
+
     /**
      * If this form has an error, print an error marker like "<<".
@@ -164,5 +164,5 @@
     function notEmpty($form_name, $msg='')
     {
-    
+
         $val = trim(getFormData($form_name));
         if ($val != '') {
@@ -184,5 +184,5 @@
     function isEmpty($form_name, $msg='')
     {
-    
+
         $val = trim(getFormData($form_name));
         if ($val == '') {
@@ -255,5 +255,5 @@
     /**
      * Check whether input is a float. Don't just use is_float() because the
-     * data coming from the user is *really* a string. Integers will also 
+     * data coming from the user is *really* a string. Integers will also
      * pass this test.
      *
@@ -293,8 +293,8 @@
         }
     }
-    
+
     /**
      * Check whether input matches the specified perl regular expression
-     * pattern. 
+     * pattern.
      *
      * @param  string $form_name the name of the incoming form variable
@@ -325,5 +325,5 @@
         }
     }
-    
+
     /**
      * Tests if the string length is between specified values. Whitespace excluded for min.
@@ -339,5 +339,5 @@
     {
         $val = getFormData($form_name);
-        
+
         if (strlen(trim($val)) < $min || strlen($val) > $max) {
             $this->addError($form_name, $msg);
@@ -375,5 +375,5 @@
     /**
      * Validates an email address based on the recommendations in RFC 3696.
-     * Is more loose than restrictive, to allow the many valid variants of 
+     * Is more loose than restrictive, to allow the many valid variants of
      * email addresses while catching the most common mistakes.
      * http://www.faqs.org/rfcs/rfc822.html
@@ -403,5 +403,5 @@
             return false;
         }
-        
+
         // We have a match! Here are the captured subpatterns, on which further tests are run.
         $local = $e_parts[2];
@@ -415,5 +415,5 @@
             return false;
         }
-        
+
         // Check domain exists: It's a domain if ip2long fails; Checkdnsrr ensures a MX record exists; Gethostbyname() ensures the domain exists.
         if (ip2long($domain) == '-1' && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) {
@@ -422,5 +422,5 @@
             return false;
         }
-        
+
         return true;
     }
@@ -431,5 +431,5 @@
 //             return false;
 //         }
-//         
+//
 //         // Test email address format.
 //         if ($allow_fullname) {
@@ -444,5 +444,5 @@
 //             }
 //         }
-//         
+//
 //         // Test length.
 //         if (!$this->stringLength($form_name, 0, 255, sprintf(_("<strong>Email address</strong> must contain less than 256 characters."), $email))) {
@@ -450,5 +450,5 @@
 //             return false;
 //         }
-//         
+//
 //         // Check domain exists and has valid MX record.
 //         preg_match('/^[^<>@]*<?[^\s@\[\]<>()]+\@([A-Za-z0-9.-]+\.[A-Za-z]{2,5})>?$/i', $email, $matches);
@@ -460,5 +460,5 @@
 //             }
 //         }
-//         
+//
 //         return true;
 //     }
@@ -476,5 +476,5 @@
     {
         $phone = getFormData($form_name);
-        
+
         return $this->checkRegex($form_name, '/^[0-9 +().-]*$/', true, sprintf(_("The phone number <strong>%s</strong> is not valid."), $phone))
         && $this->stringLength($form_name, 0, 25, sprintf(_("The phone number <strong>%s</strong> is too long"), $phone));
@@ -499,6 +499,6 @@
         }
     }
-    
-    
+
+
     /**
      * Verifies credit card number.
@@ -515,15 +515,15 @@
             $cc_num = getFormData($form_name);
         }
-        
+
         if ('' == $cc_num) {
             return false;
         }
-        
+
         // Innocent until proven guilty
         $card_is_valid = true;
-    
+
         // Get rid of any non-digits
         $cc_num = preg_replace('/[^\d]/', '', $cc_num);
-    
+
         // Perform card-specific checks, if applicable
         switch (strtolower($cc_type)) {
@@ -558,8 +558,8 @@
                 break;
         }
-    
+
         // The Luhn formula works right to left, so reverse the number.
         $cc_num = strrev($cc_num);
-        
+
         $luhn_total = 0;
 
@@ -573,14 +573,14 @@
                 $digit *= 2;
             }
-    
+
             //  If the result is two digits, add them.
             if (strlen($digit) == 2) {
                 $digit = substr($digit,0,1) + substr($digit,1,1);
             }
-    
+
             //  Add the current digit to the $luhn_total.
             $luhn_total += $digit;
         }
-    
+
         // If it passed (or bypassed) the card-specific check and the Total is evenly divisible by 10, it's cool!
         if ($card_is_valid && $luhn_total % 10 == 0) {
@@ -609,5 +609,5 @@
         }
     }
-    
+
 } // THE END
 
Index: /trunk/lib/Google_API.inc.php
===================================================================
--- /trunk/lib/Google_API.inc.php	(revision 41)
+++ /trunk/lib/Google_API.inc.php	(revision 42)
@@ -9,5 +9,5 @@
 
 // Example of use:
-// 
+//
 // require_once 'Google_API.php';
 // $google = new Google_API('your license key');
@@ -40,5 +40,5 @@
      */
     var $_licenseKey = '';
-    
+
     /**
      * @var    object
@@ -46,5 +46,5 @@
      */
     var $_soapClient = NULL;
-    
+
     /**
      * Constructor.
@@ -60,5 +60,5 @@
         );
     }
-    
+
     /**
      * Retrieves a page by URL from the Google Cache.
@@ -82,5 +82,5 @@
         return $result;
     }
-    
+
     /**
      * Retrieves a spelling suggestion for a phrase.
@@ -100,5 +100,5 @@
         );
     }
-    
+
     /**
      * Performs a web search.
@@ -129,5 +129,5 @@
         );
     }
-    
+
     /**
      * @param  string
@@ -149,5 +149,5 @@
         }
     }
-    
+
     /**
      * getFault
@@ -155,5 +155,5 @@
      * returns a simple native php array containing the fault data
      *
-     * @return array 
+     * @return array
      * @access public
      */
Index: /trunk/lib/ImageThumb.inc.php
===================================================================
--- /trunk/lib/ImageThumb.inc.php	(revision 41)
+++ /trunk/lib/ImageThumb.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * ImageThumb.inc.php 
+ * ImageThumb.inc.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -20,18 +20,18 @@
 
 class ImageThumb {
-    
+
     // The location for images to create thumbnails from.
     var $source_dir = null;
-    
+
     // Specifications for thumbnail images.
-    var $spec; 
-    
+    var $spec;
+
     // Array of acceptable file extensions (lowercase).
     var $valid_file_extensions = array('jpg', 'jpeg', 'gif', 'png');
-    
-    // The uploaded files will be owned by user 'apache'. Set world-read/write 
+
+    // The uploaded files will be owned by user 'apache'. Set world-read/write
     // if the website admin needs to read/delete these files. Must be at least 0400 with owner=apache.
     var $dest_file_perms = 0644;
-    
+
     // Must be at least 0700 with owner=apache.
     var $dest_dir_perms = 0777;
@@ -42,5 +42,5 @@
     var $cjpeg_binary = '/usr/bin/cjpeg';
     var $_valid_binaries = true;
-    
+
     // Display messages raised in this object?
     var $display_messages = true;
@@ -76,8 +76,8 @@
     function setSourceDirectory($source_dir)
     {
-        
+
         // Set the source directory path, stripping any extra slashes if needed.
         $this->source_dir = preg_replace('!/+$!', '', $source_dir);
-        
+
         if (!is_dir($this->source_dir)) {
             App::logMsg(sprintf('ImageThumb error: source directory not found: %s', $this->source_dir), LOG_ERR, __FILE__, __LINE__);
@@ -108,5 +108,5 @@
         $allow_upscaling = isset($spec['allow_upscaling']) ? $spec['allow_upscaling'] : false;
         $keep_filesize   = isset($spec['keep_filesize']) ? $spec['keep_filesize'] : null;
-    
+
         // Define pnmscale arguments.
         switch ($scaling_type) {
@@ -144,9 +144,9 @@
             break;
         }
-        
+
         // Define cjpeg arguments.
         $cjpeg_args = sprintf(' -optimize -quality %s ', escapeshellcmd($quality));
         $cjpeg_args .= (true === $progressive) ? ' -progressive ' : '';
-        
+
         $this->spec[] = array(
             'dest_dir' => $dest_dir,
@@ -185,5 +185,5 @@
             }
         }
-                
+
         // If > 0, there was a problem creating dest dirs.
         return (0 == $return_val);
@@ -203,5 +203,5 @@
             return false;
         }
-        
+
         // Ensure we have a source.
         if (!isset($this->source_dir)) {
@@ -209,11 +209,11 @@
             return false;
         }
-        
+
         // To keep this script running even if user tries to stop browser.
-        ignore_user_abort(true); 
-        if (!ini_get('safe_mode')) { 
-            set_time_limit(300); 
-        }
-        
+        ignore_user_abort(true);
+        if (!ini_get('safe_mode')) {
+            set_time_limit(300);
+        }
+
         // Confirm source image exists.
         if (!file_exists($this->source_dir . '/' . $file_name)) {
@@ -222,5 +222,5 @@
             return false;
         }
-        
+
         // Confirm source image is readable.
         if (!is_readable($this->source_dir . '/' . $file_name)) {
@@ -229,5 +229,5 @@
             return false;
         }
-        
+
         // Confirm source image contains data.
         if (filesize($this->source_dir . '/' . $file_name) < 1) {
@@ -236,5 +236,5 @@
             return false;
         }
-        
+
         // Confirm source image has a valid file extension.
         if (!$this->validFileExtension($file_name)) {
@@ -243,5 +243,5 @@
             return false;
         }
-        
+
         // Output file will be a jpg. Set file extension.
         $file_name = substr($file_name, 0, strrpos($file_name, '.')) . '.jpg';
@@ -249,7 +249,7 @@
         // This remains zero until something goes wrong.
         $final_return_val = 0;
-        
+
         foreach ($this->spec as $s) {
-        
+
             // Skip existing thumbnails with file size below $s['keep_filesize'].
             if (file_exists(realpath($this->source_dir . '/' . $s['dest_dir'] . '/' . $file_name)) && isset($s['keep_filesize'])) {
@@ -260,5 +260,5 @@
                 }
             }
-            
+
             // Determine if original file size is smaller than specified thumbnail size. Do not scale-up if allow_upscaling config is set to false.
             $image_size = getimagesize(realpath($this->source_dir . '/' . $file_name));
@@ -269,5 +269,5 @@
                 $pnmscale_args = $s['pnmscale_args'];
             }
-            
+
             // Execute the command that creates the thumbnail.
             $command = sprintf('%s %s/%s | %s %s | %s %s > %s/%s',
@@ -278,5 +278,5 @@
                 escapeshellcmd($pnmscale_args),
                 escapeshellcmd($this->cjpeg_binary),
-                escapeshellcmd($s['cjpeg_args']), 
+                escapeshellcmd($s['cjpeg_args']),
                 escapeshellcmd(realpath($this->source_dir . '/' . $s['dest_dir'])),
                 escapeshellcmd($file_name)
@@ -292,9 +292,9 @@
                 App::logMsg(sprintf('Image %s failed resizing with return value: %s%s', $s['dest_dir'] . '/' . $file_name, $return_val, empty($output) ? '' : ' (' . getDump($output) . ')'), LOG_ERR, __FILE__, __LINE__);
             }
-            
+
             // Return from the command will be > 0 if there was an error.
             $final_return_val += $return_val;
         }
-        
+
         // If > 0, there was a problem thumbnailing.
         return (0 == $final_return_val);
@@ -314,5 +314,5 @@
             return false;
         }
-        
+
         // Get all files in source directory.
         $dir_handle = opendir($this->source_dir);
@@ -323,5 +323,5 @@
             }
         }
-        
+
         // Process each found file.
         if (is_array($files) && !empty($files)) {
@@ -350,5 +350,5 @@
             return false;
         }
-        
+
         $ret = 0;
         foreach ($this->spec as $s) {
@@ -379,5 +379,5 @@
             return false;
         }
-        
+
         $file_path_name = $this->source_dir . '/' . $file_name;
         if (!unlink($file_path_name)) {
@@ -388,5 +388,5 @@
         return true;
     }
-    
+
     /**
      * Returns true if file exists.
@@ -403,8 +403,8 @@
             return false;
         }
-        
+
         return file_exists($this->source_dir . '/' . $file_name);
     }
-    
+
     /**
      * Tests if extention of $file_name is in the array valid_file_extensions.
@@ -419,5 +419,5 @@
         return in_array(strtolower($ext[1]), $this->valid_file_extensions);
     }
-    
+
     /**
      * An alias for App::raiseMsg that only sends messages if display_messages is true.
Index: /trunk/lib/MCVE.inc.php
===================================================================
--- /trunk/lib/MCVE.inc.php	(revision 41)
+++ /trunk/lib/MCVE.inc.php	(revision 42)
@@ -19,5 +19,5 @@
     var $connected = false;
     var $conn;
-    
+
     function MCVE($username, $password)
     {
@@ -28,5 +28,5 @@
         }
         if ('' == $username || '' == $password) {
-        	App::logMsg(sprintf('Empty username or password provided.', null), LOG_ERR, __FILE__, __LINE__);
+            App::logMsg(sprintf('Empty username or password provided.', null), LOG_ERR, __FILE__, __LINE__);
         }
         $this->username = $username;
@@ -39,11 +39,11 @@
             return true;
         }
-        
+
         // Initialize SSL structures and definitions.
         MCVE_InitEngine($ca_bundle_file);
-        
+
         // Allocate Connection Structures
         $this->conn = MCVE_InitConn();
-        
+
         // Set Connection Method and Locations
         switch ($this->connect_method) {
@@ -69,5 +69,5 @@
             App::logMsg('Connection method not defined.', LOG_ERR, __FILE__, __LINE__);
         }
-        
+
         // Put connection into non-blocking mode, meaning that the client must
         // loop waiting for the transaction to complete. You should always specify
@@ -78,5 +78,5 @@
             return false;
         }
-        
+
         // Maximum of 30s per transaction allowed. Timeout occurs on server-end, not client-end
         if (!MCVE_SetTimeout($this->conn, $this->timeout)) {
@@ -84,5 +84,5 @@
             return false;
         }
-        
+
         // Connect to MCVE, if there's an error, print the exact reason for connection failure
         if (!MCVE_Connect($this->conn)) {
@@ -91,8 +91,8 @@
             return false;
         }
-        
+
         $this->connected = true;
     }
-    
+
     function beginTrans()
     {
@@ -103,5 +103,5 @@
         return $tid;
     }
-    
+
     function transParam($tid, $key, $var1, $var2=null)
     {
@@ -111,7 +111,7 @@
             return MCVE_TransParam($this->conn, $tid, $key, $var1, $var2);
         }
-        
+
     }
-    
+
     function sendTrans($tid, $type='', $hide_msg=false)
     {
@@ -121,6 +121,6 @@
             return false;
         }
-        
-        // Perform actual communication with MCVE engine. 
+
+        // Perform actual communication with MCVE engine.
         // If blocking method is used, loop until transaction is complete
         if ($this->blocking != 1) {
@@ -130,10 +130,10 @@
             }
         }
-        
+
         $ret_status = MCVE_ReturnStatus($this->conn, $tid);
         $ret_code = MCVE_ReturnCode($this->conn, $tid);
         $ret_text = mcve_text_code($ret_code);
         $verbiage = MCVE_TransactionText($this->conn, $tid);
-    
+
         // Check to see if transaction was successful or not using a strict success/fail function
         if ($ret_status == MCVE_FAIL) {
@@ -144,5 +144,5 @@
                 App::raiseMsg(sprintf(_("MCVE %s success: %s %s"), $type, $ret_text, ('' == $verbiage ? '' : '(' . trim($verbiage) . ')')), MSG_SUCCESS, __FILE__, __LINE__);
             }
-            App::logMsg(sprintf(_("MCVE success details. Auth: %s; Batch: %s; Item: %s; TTID: %s; AVS: %s; CV: %s."), 
+            App::logMsg(sprintf(_("MCVE success details. Auth: %s; Batch: %s; Item: %s; TTID: %s; AVS: %s; CV: %s."),
                 MCVE_TransactionAuth($this->conn, $tid),
                 MCVE_TransactionBatch($this->conn, $tid),
@@ -158,5 +158,5 @@
         }
     }
-    
+
     function disconnect($tid)
     {
@@ -165,9 +165,9 @@
             // MCVE_DestroyConn though
             MCVE_DeleteTrans($this->conn, $tid);
-            
+
             // Clean up and close MCVE.
             MCVE_DestroyConn($this->conn);
             MCVE_DestroyEngine();
-            
+
             $this->connected = false;
         }
Index: /trunk/lib/Nav.inc.php
===================================================================
--- /trunk/lib/Nav.inc.php	(revision 41)
+++ /trunk/lib/Nav.inc.php	(revision 42)
@@ -3,5 +3,5 @@
  * The Nav:: class provides a system for working with navigation elements.
  * Currently it supports storing page titles and URLs for printing breadcrumbs
- * and titles, as well as setting page features such as hiding the page title on 
+ * and titles, as well as setting page features such as hiding the page title on
  * some pages but not others.
  *
@@ -60,5 +60,5 @@
         );
     }
-    
+
     /**
      * Set the features of the current page. Future versions of this class
@@ -73,5 +73,5 @@
     {
         $page_id = $this->_calculatePageID($page_id);
-        
+
         if (isset($features) && is_array($features) && isset($this->pages[sizeof($this->pages)-1]['features']) && is_array($this->pages[sizeof($this->pages)-1]['features'])) {
             // Set features for specified page.
@@ -96,5 +96,5 @@
  * OUTPUT
  *****************************************************************************/
- 
+
     /**
      * Get the value of a feature for specified page_id or current page if page_id not specified (future use).
@@ -108,5 +108,5 @@
     {
         $page_id = $this->_calculatePageID($page_id);
-        
+
         if (isset($this->pages[$page_id]['features'][$feature])) {
             switch ($feature) {
@@ -123,5 +123,5 @@
     }
 
-        
+
     /**
      * Returns the title of current page.
@@ -134,5 +134,5 @@
     {
         $page_id = $this->_calculatePageID($page_id);
-        
+
         if ($this->getFeature('title', $page_id)) {
             return oTxt($this->pages[$page_id]['title'], true);
@@ -163,5 +163,5 @@
     {
         $page_id = $this->_calculatePageID($page_id);
-        
+
         if ($this->getFeature('path', $page_id)) {
             $path = '';
@@ -202,5 +202,5 @@
     {
         $page_id = $this->_calculatePageID($page_id);
-        
+
         if ($this->getFeature('breadcrumbs')) {
             $breadcrumbs = '';
@@ -232,5 +232,5 @@
                 $pathmark = $this->path_delimiter;
                 $crumb_count--;
-                
+
                 if ($curr_id === $page_id) {
                     // Reached requested page.
@@ -253,5 +253,5 @@
         echo $this->getBreadcrumbs($page_id);
     }
-    
+
     /**
      * Returns a string if the queried page is the current page. One use is to print
@@ -272,5 +272,5 @@
         }
     }
-    
+
     /**
      * Returns the ID of the current page, or the adjusted ID for a given page ID.
@@ -289,6 +289,6 @@
         }
     }
-    
-} 
+
+}
 // End of class.
 
Index: /trunk/lib/NodeHeirarchy.inc.php
===================================================================
--- /trunk/lib/NodeHeirarchy.inc.php	(revision 41)
+++ /trunk/lib/NodeHeirarchy.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * NodeHeirarchy.inc.php 
+ * NodeHeirarchy.inc.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -23,5 +23,5 @@
  * @version   1.0
  */
- 
+
 class NodeHeirarchy {
 
@@ -50,10 +50,10 @@
 
     /**
-     * Boolean indicating whether or not we've set 
+     * Boolean indicating whether or not we've set
      * the 'active' node type and id.
      * @var bool $node_init
      */
     var $node_init = false;
-    
+
     /**
      * Constructor
@@ -66,5 +66,5 @@
         $this->params = $params;
     }
-    
+
     /**
      * Defines the default child_type and child_id for this object.
@@ -85,5 +85,5 @@
         return $this->toStringID($old_type, $old_id);
     }
-    
+
     /**
      * Takes a node type and id and returns them as a serialized identifier like
@@ -121,5 +121,5 @@
         }
     }
-    
+
     /**
      * Takes a singlar node identifier and returns it as components of an array.
@@ -156,5 +156,5 @@
             }
         }
-        
+
         // Make sure this is not empty and an array, even if it has only one value.
         if ('' == $parents) {
@@ -165,8 +165,8 @@
             $parents = array($parents);
         }
-        
+
         // Remove duplicates.
         $parents = array_unique($parents);
-                
+
         // Test that this node does not already exist and that the new parents
         // do exist before we continue.
@@ -182,7 +182,7 @@
                 App::logMsg(sprintf(_("Cannot add node <strong>%s %s</strong> to nonexistent parent <strong>%s %s</strong>."), $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_ERR, __FILE__, __LINE__);
                 return false;
-            }   
-        }
-        
+            }
+        }
+
         // Insert new nodes with the new parents.
         foreach ($parents as $parent_string) {
@@ -190,15 +190,15 @@
             DB::query("
                 INSERT INTO node_tbl (
-                    parent_type, 
-                    parent_id, 
-                    child_type, 
-                    child_id, 
+                    parent_type,
+                    parent_id,
+                    child_type,
+                    child_id,
                     relationship_type,
                     title
                 ) VALUES (
-                    '" . addslashes($parent['node_type']) . "', 
-                    '" . addslashes($parent['node_id']) . "', 
-                    '" . addslashes($child_type) . "', 
-                    '" . addslashes($child_id) . "', 
+                    '" . addslashes($parent['node_type']) . "',
+                    '" . addslashes($parent['node_id']) . "',
+                    '" . addslashes($child_type) . "',
+                    '" . addslashes($child_id) . "',
                     " . (is_null($relationship_type) ? "NULL" : "'" . addslashes($relationship_type) . "'") . ",
                     '" . addslashes($title) . "'
@@ -267,5 +267,5 @@
      *
      * @return bool      false on error, true otherwise.
-     */     
+     */
     function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     {
@@ -279,5 +279,5 @@
             }
         }
-        
+
         // Make sure this is not empty and an array, even if it has only one value.
         if (empty($new_parents)) {
@@ -288,5 +288,5 @@
             $new_parents = array($new_parents);
         }
-        
+
         // Remove duplicates.
         $new_parents = array_unique($new_parents);
@@ -299,12 +299,12 @@
                 App::logMsg(sprintf(_("Cannot move node <strong>%s %s</strong> to nonexistent parent <strong>%s %s</strong>."), $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_ERR, __FILE__, __LINE__);
                 return false;
-            }   
+            }
             if ($this->isAncestor($child_type, $child_id, $parent['node_type'], $parent['node_id'])) {
                 App::raiseMsg(sprintf(_("Cannot move node <strong>%s %s</strong> to parent <strong>%s %s</strong> because a node cannot have itself as a parent."), $child_type, $child_id, $parent['node_type'], $parent['node_id']), MSG_ERR, __FILE__, __LINE__);
                 App::logMsg(sprintf(_("Cannot move node <strong>%s %s</strong> to parent <strong>%s %s</strong> because a node cannot have itself as a parent."), $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_ERR, __FILE__, __LINE__);
                 return false;
-            }   
-        }
-        
+            }
+        }
+
         if (empty($title)) {
             // Select the title of the node we are moving, so we can add it again with the same info.
@@ -317,5 +317,5 @@
             list($title) = mysql_fetch_row($qid);
         }
-        
+
         // Delete the nodes with the old parents.
         DB::query("
@@ -326,8 +326,8 @@
         ");
         App::logMsg(sprintf('moveNode: Deleted node %s %s.', $child_type, $child_id), LOG_DEBUG, __FILE__, __LINE__);
-        
+
         // Insert new nodes with the new parents.
         $this->insertNode($new_parents, $child_type, $child_id, $relationship_type, $title);
-        
+
         return true;
     }
@@ -356,9 +356,9 @@
         $qid = DB::query("
             SELECT parent_type, parent_id
-            FROM node_tbl 
+            FROM node_tbl
             WHERE child_type = '" . addslashes($child_type) . "'
-            AND child_id = '" . addslashes($child_id) . "' 
+            AND child_id = '" . addslashes($child_id) . "'
         ");
-        
+
         $parents = array();
         while ($row = mysql_fetch_assoc($qid)) {
@@ -391,12 +391,12 @@
             }
         }
-        
+
         $qid = DB::query("
             SELECT child_type, child_id, title, subnode_quantity
-            FROM node_tbl 
+            FROM node_tbl
             WHERE child_type = '" . addslashes($child_type) . "'
             AND child_id = '" . addslashes($child_id) . "'
         ");
-        
+
         $children = array();
         while ($row = mysql_fetch_assoc($qid)) {
@@ -432,5 +432,5 @@
             }
         }
-        
+
         $in_clause = '';
         if (isset($type_constraint)) {
@@ -440,8 +440,8 @@
             $in_clause = "AND child_type IN ('" . join("','", array_map('addslashes', $type_constraint)) . "')";
         }
-        
+
         $qid = DB::query("
             SELECT *
-            FROM node_tbl 
+            FROM node_tbl
             WHERE parent_type = '" . addslashes($child_type) . "'
             AND parent_id = '" . addslashes($child_id) . "'
@@ -449,5 +449,5 @@
             " . addslashes($order) . "
         ");
-        
+
         $children = array();
         while ($row = mysql_fetch_assoc($qid)) {
@@ -464,5 +464,5 @@
      * Give the number of children a category has. We are talking about the
      * direct children, on the next level.
-     * 
+     *
      * @param string optional $parent The name of the parent from where we begin.
      * @param string $type_constraint  An array of node types to restrict the search to.
@@ -481,5 +481,5 @@
             }
         }
-        
+
         $in_clause = '';
         if (isset($type_constraint)) {
@@ -492,5 +492,5 @@
         $qid = DB::query("
             SELECT COUNT(*)
-            FROM node_tbl 
+            FROM node_tbl
             WHERE parent_type = '" . addslashes($child_type) . "'
             AND parent_id = '" . addslashes($child_id) . "'
@@ -519,5 +519,5 @@
             }
         }
-        
+
         if ($this->getNumberChildren($child_type, $child_id) <= 0) {
             return true;
@@ -544,5 +544,5 @@
         $family_tree = $this->getAllAncestors($considered_parent_type, $considered_parent_id);
         $family_tree = $this->toStringID($family_tree, -1);
-        
+
         if (in_array($this->toStringID($child_type, $child_id), $family_tree)) {
             return true;
@@ -571,5 +571,5 @@
         static $output = array();
         static $return_flag;
-        
+
         $qid = DB::query("
             SELECT parent_type, parent_id, child_type, child_id, title, subnode_quantity
@@ -583,5 +583,5 @@
                 continue;
             }
-            
+
             // Build a linear path to root...no wormholes.
             if ($enough_already && $go_linear) {
@@ -589,5 +589,5 @@
             }
             $enough_already = true;
-            
+
             // To prevent duplicates, only add the new found node
             // if not already in the array of ancestors.
@@ -596,5 +596,5 @@
                 $output[] = $row;
             }
-            
+
             $this->getAllAncestors($row['parent_type'], $row['parent_id'], $go_linear, false);
         }
@@ -630,5 +630,5 @@
             }
         }
-        
+
         if (isset($parent_type) && isset($parent_id)) {
             $qid = DB::query("
@@ -665,5 +665,5 @@
      * @param  string  $order            SQL to append to the query of the getChildren
      *                                   call. Ex: 'ORDER BY child_id DESC'
-     * @return array  Details of from the node table of all nodes below the 
+     * @return array  Details of from the node table of all nodes below the
      *                specified node: (type, id, title, indent level, selected status)
      */
@@ -672,5 +672,5 @@
         static $output = array();
         static $is_a_leaf = array();
-        
+
         if (!isset($child_type) || !isset($child_id)) {
             if ($this->node_init) {
@@ -682,9 +682,9 @@
             }
         }
-        
+
         if (!is_array($preselected)) {
             $preselected = array($preselected);
         }
-        
+
         if ($_return_flag && $include_curr) {
             $my_children = $this->getNode($child_type, $child_id);
@@ -709,5 +709,5 @@
                 $output[] = $row;
                 unset($row);
-                
+
                 // This is so we test if each node is a string only once. We store the result in the is_a_leaf array statically.
                 if (!isset($is_a_leaf[$this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])])) {
@@ -731,6 +731,6 @@
 
     }
-    
-    
+
+
     /**
      * Counts the number of items linked to each parent node
@@ -744,8 +744,8 @@
         // Reset all the category counters to zero.
         DB::query("UPDATE node_tbl SET subnode_quantity = 0");
-        
+
         // Get all the nodes.
         $qid = DB::query("SELECT DISTINCT child_type, child_id FROM node_tbl");
-        
+
         // For each node count the number of children...
         while (list($child_type, $child_id) = mysql_fetch_row($qid)) {
@@ -757,5 +757,5 @@
         }
     }
-    
+
     /**
      * Used internally by setSubnodeQty to add the quantity of subnodes to
@@ -772,7 +772,7 @@
         $qid = DB::query("
             SELECT parent_type, parent_id
-            FROM node_tbl 
+            FROM node_tbl
             WHERE child_type = '" . addslashes($child_type) . "'
-            AND child_id = '" . addslashes($child_id) . "' 
+            AND child_id = '" . addslashes($child_id) . "'
         ",false);
         while ((list($parent_type, $parent_id) = mysql_fetch_row($qid)) && $parent_id > 0) {
Index: /trunk/lib/PEdit.inc.php
===================================================================
--- /trunk/lib/PEdit.inc.php	(revision 41)
+++ /trunk/lib/PEdit.inc.php	(revision 42)
@@ -2,5 +2,5 @@
 /**
  * PEdit:: provides a mechanism to store text in php variables
- * which will be printed to the client browser under normal 
+ * which will be printed to the client browser under normal
  * circumstances, but an authenticated user can 'edit' the document--
  * data stored in vars will be shown in html form elements to be editied
@@ -16,27 +16,27 @@
  *  require_once 'codebase/lib/PEdit.inc.php';
  *  $p = new PEdit($auth->hasClearance('pedit'));
- *  
+ *
  *  $title = <<<P_E_D_I_T_title
  *  Using Burritos to Improve Student Learnin'
  *  P_E_D_I_T_title;
  *  $p->set($title, 'title', 'textbox');
- *  
+ *
  *  // Begin content. Include a header or something right here.
  *  $p->printContent('title');
- *  
+ *
  *  // Prints beginning form tags and special hidden forms. (Only happens if page is NOT a archived version.)
  *  $p->formBegin();
- *  
+ *
  *  // Print editing form elements. (Only happens if op == Edit.)
  *  $p->printForm('title');
- *  
+ *
  *  // Print versions list. (Only happens if op == Versions.)
  *  $p->printVersions();
- *  
+ *
  *  // Prints ending form tags and command buttons.(Only happens if page is NOT a archived version.)
  *  $p->formEnd();
  *
- * @author  Quinn Comendant <quinn@strangecode.com> 
- * @concept Beau Smith <beau@beausmith.com> 
+ * @author  Quinn Comendant <quinn@strangecode.com>
+ * @concept Beau Smith <beau@beausmith.com>
  * @version 1.1
  */
@@ -51,17 +51,17 @@
     // Tags that are not stripped from the POSTed data.
     var $allowed_tags = '<p><h1><h2><h3><h4><h5><h6><div><br><hr><a><img><i><em><b><strong><small><blockquote><ul><ol><li><dl><dt><dd><map><area><table><tr><td>';
-    
-    
-    /** 
+
+
+    /**
      * Constructs a new PEdit object. Initializes what file is being operated on
-     * (SCRIPT_FILENAME) and what that operation is. The two 
+     * (SCRIPT_FILENAME) and what that operation is. The two
      * operations that actually modify data (save, restore) are treated differently
      * than view operations (versions, '' - default). They die redirect so you see
      * the page you just modified.
-     * 
-     * @access public 
-     * 
-     * @param optional array $params  A hash containing connection parameters. 
-     */ 
+     *
+     * @access public
+     *
+     * @param optional array $params  A hash containing connection parameters.
+     */
     function PEdit($authorized=false)
     {
@@ -69,5 +69,5 @@
             $this->_authorized = true;
         }
-        
+
         $this->_filename = $_SERVER['SCRIPT_FILENAME'];
         if (empty($this->_filename)) {
@@ -75,7 +75,7 @@
             die;
         }
-        
+
         $this->op = getFormData('op');
-        
+
         switch ($this->op) {
         case 'Save' :
@@ -91,32 +91,32 @@
         }
     }
-    
+
     /**
      * Stores a variable in the pedit data array with the content name, and type of form.
-     * 
-     * @access public 
-     * 
+     *
+     * @access public
+     *
      * @param string $content         The variable containing the text to store.
-     * @param string $name            The name of the variable. 
-     * @param string $type            The type of form element to use. 
-     * @param optional int $form_size The size of the form element. 
+     * @param string $name            The name of the variable.
+     * @param string $type            The type of form element to use.
+     * @param optional int $form_size The size of the form element.
      */
     function set($content, $name, $type, $form_size=null)
     {
         $this->_data[$name] = array(
-            'type' => $type, 
-            'content' => $content, 
+            'type' => $type,
+            'content' => $content,
             'form_size' => $form_size
         );
     }
-    
+
     /**
      * Stores a checkbox variable in the pedit data array with the content name, and type of form.
-     * 
-     * @access public 
-     * 
+     *
+     * @access public
+     *
      * @param string $content            The variable containing the text to store.
-     * @param string $name               The name of the variable. 
-     * @param string $corresponding_text The text that corresponds to this checkbox. 
+     * @param string $name               The name of the variable.
+     * @param string $corresponding_text The text that corresponds to this checkbox.
      */
     function setCheckbox($content, $name, $corresponding_text)
@@ -124,6 +124,6 @@
         if (isset($content) && isset($name) && isset($corresponding_text)) {
             $this->_data[$name] = array(
-                'type' => 'checkbox', 
-                'content' => $content, 
+                'type' => 'checkbox',
+                'content' => $content,
                 'corresponding_text' => $corresponding_text
             );
@@ -131,11 +131,11 @@
     }
 
-    /** 
+    /**
      * Tests if we are should display page contents.
-     * 
-     * @access public 
+     *
+     * @access public
      *
      * @return bool        true if we are displaying page normally, false if editing page, or viewing versions.
-     */ 
+     */
     function displayMode()
     {
@@ -144,12 +144,12 @@
         }
     }
-    
-
-    /** 
+
+
+    /**
      * Prints an HTML list of versions of current file, with the filesize
-     * and links to view and restore the file. 
-     * 
-     * @access public 
-     */ 
+     * and links to view and restore the file.
+     *
+     * @access public
+     */
     function printVersions()
     {
@@ -168,5 +168,5 @@
                     <td nowrap="nowrap"><p>&nbsp;&nbsp;&nbsp;[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=Restore&with_file=' . $v['filename'] . '&file_hash=' . md5('frog_guts' . $this->_filename)); ?>"><?php echo _("restore"); ?></a>]</p></td>
                     </tr>
-                    <?php   
+                    <?php
                 }
                 ?></table><?php
@@ -176,13 +176,13 @@
     }
 
-    /** 
+    /**
      * Returns the contents of a data variable. The variable must first be 'set'.
-     * 
-     * @access public 
-     * 
-     * @param string $name   The name of the variable to return. 
+     *
+     * @access public
+     *
+     * @param string $name   The name of the variable to return.
      *
      * @return string        The trimmed content of the named data.
-     */ 
+     */
     function getContent($name, $preserve_html=true)
     {
@@ -198,24 +198,24 @@
     }
 
-    /** 
+    /**
      * Prints the contents of a data variable. The variable must first be 'set'.
-     * 
-     * @access public 
-     * 
-     * @param string $name      The name of the variable to print. 
-     */ 
+     *
+     * @access public
+     *
+     * @param string $name      The name of the variable to print.
+     */
     function printContent($name, $preserve_html=true)
     {
         echo $this->getContent($name, $preserve_html);
     }
-    
-    /** 
-     * Prints the HTML forms corresponding to pedit variables. Each variable 
+
+    /**
+     * Prints the HTML forms corresponding to pedit variables. Each variable
      * must first be 'set'.
-     * 
-     * @access public 
-     * 
-     * @param string $name      The name of the variable. 
-     */ 
+     *
+     * @access public
+     *
+     * @param string $name      The name of the variable.
+     */
     function printForm($name)
     {
@@ -245,11 +245,11 @@
         }
     }
-    
-    /** 
+
+    /**
      * Loops through the PEdit data array and prints all the HTML forms corresponding
      * to all pedit variables, in the order in which they were 'set'.
-     * 
-     * @access public 
-     */ 
+     *
+     * @access public
+     */
     function printAllForms()
     {
@@ -260,10 +260,10 @@
         }
     }
-    
-    /** 
-     * Prints the beginning <form> HTML tag, as well as hidden input forms. 
-     * 
-     * @return bool  False if unauthorized or current page is a version. 
-     */ 
+
+    /**
+     * Prints the beginning <form> HTML tag, as well as hidden input forms.
+     *
+     * @return bool  False if unauthorized or current page is a version.
+     */
     function formBegin()
     {
@@ -289,11 +289,11 @@
         }
     }
-    
-    /** 
+
+    /**
      * Prints the endig </form> HTML tag, as well as buttons used during
-     * different operations. 
-     * 
-     * @return bool  False if unauthorized or current page is a version. 
-     */ 
+     * different operations.
+     *
+     * @return bool  False if unauthorized or current page is a version.
+     */
     function formEnd()
     {
@@ -330,13 +330,13 @@
         }
     }
-    
-    /** 
+
+    /**
      * Saves the POSTed data by overwriting the pedit variables in the
-     * current file. 
-     * 
-     * @access private 
-     * 
-     * @return bool  False if unauthorized or on failure. True on success. 
-     */ 
+     * current file.
+     *
+     * @access private
+     *
+     * @return bool  False if unauthorized or on failure. True on success.
+     */
     function _writeData()
     {
@@ -368,5 +368,5 @@
                 }
             }
-            
+
             // Search and replace all blocks.
             $whole_file = preg_replace($search, $replace, $whole_file);
@@ -383,5 +383,5 @@
                 return false;
             }
-            
+
             // Open file for writing and truncate to zero length.
             if (is_writable($this->_filename) && $fp = fopen($this->_filename, 'w')) {
@@ -402,16 +402,16 @@
         }
     }
-    
-    /** 
-     * Makes a copy of the current file with the unix timestamp appended to the 
+
+    /**
+     * Makes a copy of the current file with the unix timestamp appended to the
      * filename. Deletes old versions based on threshold of age and qty.
-     * 
-     * @access private 
-     * 
+     *
+     * @access private
+     *
      * @param optional boolean $do_cleanup    Set to false to turn off the
      *                                        cleanup routine.
-     * 
-     * @return bool  False if unauthorized or on failure. True on success. 
-     */ 
+     *
+     * @return bool  False if unauthorized or on failure. True on success.
+     */
     function _createVersion($do_cleanup=true)
     {
@@ -425,5 +425,5 @@
         }
         $versions = $this->_getVersions();
-        
+
         // Clean up old versions.
         if (is_array($versions) && sizeof($versions) > $this->versions_min_qty && $do_cleanup) {
@@ -431,6 +431,6 @@
             $oldest = array_pop($versions);
             // Loop while minimum X qty && minimum X days worth but never more than 100 qty.
-            while ((sizeof($versions) > $this->versions_min_qty 
-            && $oldest['unixtime'] < mktime(date('H'),date('i'),date('s'),date('m'),date('d')-$this->versions_min_days,date('Y'))) 
+            while ((sizeof($versions) > $this->versions_min_qty
+            && $oldest['unixtime'] < mktime(date('H'),date('i'),date('s'),date('m'),date('d')-$this->versions_min_days,date('Y')))
             || sizeof($versions) > 100) {
                 unlink(dirname($this->_filename) . '/' . $oldest['filename']);
@@ -444,16 +444,16 @@
             return false;
         }
-        
+
         return true;
     }
-    
-    /** 
-     * Returns an array of all archived versions of the current file, 
+
+    /**
+     * Returns an array of all archived versions of the current file,
      * sorted with newest versions at the top of the array.
-     * 
+     *
      * @access private
      *
-     * @return array  Array of versions. 
-     */ 
+     * @return array  Array of versions.
+     */
     function _getVersions()
     {
@@ -464,6 +464,6 @@
                 preg_match('/.+__(\d+)\.php/', $version, $time);
                 $versions[] = array(
-                    'filename' => $version, 
-                    'unixtime' => $time[1], 
+                    'filename' => $version,
+                    'unixtime' => $time[1],
                     'filesize' => filesize(dirname($this->_filename) . '/' . $version)
                 );
@@ -478,15 +478,15 @@
         }
     }
-    
-    /** 
+
+    /**
      * Makes a version backup of the current file, then copies the specified
-     * archived version over the current file. 
-     * 
-     * @access private 
-     * 
+     * archived version over the current file.
+     *
+     * @access private
+     *
      * @param string $with_file    Filename of archived version to restore.
      *
-     * @return bool  False if unauthorized. True on success. 
-     */ 
+     * @return bool  False if unauthorized. True on success.
+     */
     function _restoreVersion($with_file)
     {
@@ -494,5 +494,5 @@
             return false;
         }
-            
+
         if (is_writable($this->_filename)) {
             // Make certain a version is created.
@@ -501,11 +501,11 @@
                 return false;
             }
-        
-            // Do the actual copy. 
+
+            // Do the actual copy.
             if (!copy(dirname($this->_filename) . '/' . $with_file, $this->_filename)) {
                 App::logMsg(sprintf('PEdit error: failed copying old version: %s', $with_file), LOG_NOTICE, __FILE__, __LINE__);
                 return false;
             }
-            
+
             // Success!
             return true;
@@ -515,5 +515,5 @@
         }
     }
-    
+
 } // End class.
 
Index: /trunk/lib/PageNumbers.inc.php
===================================================================
--- /trunk/lib/PageNumbers.inc.php	(revision 41)
+++ /trunk/lib/PageNumbers.inc.php	(revision 42)
@@ -14,9 +14,9 @@
  * @version   1.61
  */
- 
+
 require_once dirname(__FILE__) . '/Prefs.inc.php';
 
 class PageNumbers {
-    
+
     var $total_items;       // Total quantity of items.
     var $total_pages;       // The total number of pages.
@@ -32,5 +32,5 @@
     var $set_page_number_initialized = false;
     var $set_total_items_initialized = false;
-    
+
     // These are initialized in the constructor.
     var $per_page_options;
@@ -43,5 +43,5 @@
     var $right_dbl_arrow;
     var $right_dbl_arrow_disabled;
-        
+
     /**
      * PageNumbers constructor. All arguments are depreciated. Use set* functions instead.
@@ -51,5 +51,5 @@
         // Default options for the quantity per page links.
         $this->per_page_options = array(25, 50, 100, 200);
-        
+
         // Default options for the page number links.
         $this->left_arrow = _("back");
@@ -61,10 +61,10 @@
         $this->right_dbl_arrow = '<strong>&raquo;</strong>';
         $this->right_dbl_arrow_disabled = '<span style="color: #aaaaaa;"><strong>&raquo;</strong></span>';
-        
-        // Default url base. This will be set manually after instantiation 
+
+        // Default url base. This will be set manually after instantiation
         // in special cases like using a /my/page/# scheme.
         $this->url_base = $_SERVER['PHP_SELF'] . '?page_number=';
     }
-    
+
     /**
      * Set the number of items per page.
@@ -88,5 +88,5 @@
         $this->set_per_page_initialized = true;
     }
-    
+
     /**
      * Set the current page number.
@@ -112,5 +112,5 @@
         $this->set_page_number_initialized = true;
     }
-    
+
     /**
      * Set the total number of items.
@@ -119,14 +119,14 @@
     {
         if (is_numeric($total_items) && $total_items > 0) {
-            $this->total_items = $total_items;        
-        } else {
-            $this->total_items = 0;        
+            $this->total_items = $total_items;
+        } else {
+            $this->total_items = 0;
         }
         $this->set_total_items_initialized = true;
     }
-    
+
     /**
      * After $total_items or other options are set, this function calculates
-     * all the other numbers needed. If you set any variables manually, 
+     * all the other numbers needed. If you set any variables manually,
      * for example if $page_number comes from
      * some place other than the GET or POST array, you should call this
@@ -146,13 +146,13 @@
             App::logMsg(sprintf('set_total_items not initialized'), LOG_ERR, __FILE__, __LINE__);
         }
-    
+
         // If the specified page exceedes total pages or is less than 1, set the page to 1.
         if ($this->_per_page * $this->current_page >= $this->total_items + $this->_per_page || $this->_per_page * $this->current_page < 1) {
             $this->current_page = 1;
         }
-        
+
         // The first item to be shown on this page.
         $this->first_item = ($this->current_page - 1) * $this->_per_page;
-        
+
         // The last item to be shown on this page.
         if ($this->total_items < $this->current_page * $this->_per_page) {
@@ -161,5 +161,5 @@
             $this->last_item = $this->current_page * $this->_per_page - 1;
         }
-        
+
         // Zeroing. Just in case. Paranoia. Yeah, negative numbers perturb me.
         if ($this->first_item < 1) {
@@ -172,8 +172,8 @@
             $this->total_items = 0;
         }
-                
+
         // The total number of pages.
         $this->total_pages = ceil($this->total_items / $this->_per_page);
-        
+
         // Figure out how many page number links to print.
         if ($this->total_pages >= $this->max_num_links) {
@@ -183,5 +183,5 @@
         }
     }
-    
+
     /**
      * Returns the SQL code to limit query to items that are on current page.
@@ -195,5 +195,5 @@
             return '';
         }
-    } 
+    }
 
     /**
@@ -221,5 +221,5 @@
     /**
      * Outputs an App::oHREF compatible url that goes to the page $page_number.
-     * Depends on $this->base_url to build the url onto. This is used in the 
+     * Depends on $this->base_url to build the url onto. This is used in the
      * page_number.ihtml template.
      *
@@ -247,5 +247,5 @@
     {
         $page_numbers = array();
-        
+
         for ($i = 1; $i < $this->total_pages; $i++) {
             $page_numbers[] = array(
@@ -255,5 +255,5 @@
             );
         }
-        
+
         return $page_numbers;
     }
@@ -267,5 +267,5 @@
     {
         $page_numbers_string = '';
-        
+
         if ($this->current_page > $this->total_pages - floor($this->_num_links / 2)) {
             $high_num = $this->total_pages;
@@ -278,5 +278,5 @@
             $high_num = $low_num + $this->_num_links - 1;
         }
-        
+
         if ($this->current_page != 1) {
             // Print "first" and "previous" page links.
@@ -299,10 +299,10 @@
             }
         }
-        
+
         if ($this->_num_links > 0) {
             // Print the current page number.
             $page_numbers_string .= sprintf('<strong>%s</strong>&nbsp;', $this->current_page);
         }
-        
+
         if ($this->current_page < $this->total_pages) {
             // Print links to specific page numbers after the current page.
@@ -325,13 +325,13 @@
             }
         }
-        
+
         return $page_numbers_string;
     }
-    
+
     function printPageNumbers($carry_args=null)
     {
         echo $this->getPageNumbers($carry_args);
     }
-    
+
 }
 
Index: /trunk/lib/PageSequence.inc.php
===================================================================
--- /trunk/lib/PageSequence.inc.php	(revision 41)
+++ /trunk/lib/PageSequence.inc.php	(revision 42)
@@ -10,5 +10,5 @@
  * @version   1.01
  */
- 
+
 require_once dirname(__FILE__) . '/Prefs.inc.php';
 
@@ -19,6 +19,6 @@
     var $sequence_title = '';
     var $seq = '_sequence_';
-    var $idle_timeout; 
-    
+    var $idle_timeout;
+
     /**
      * Constructor. Sets the title of this sequence and initializes session variables.
@@ -33,11 +33,11 @@
             $this->seq .= $params['sequence_title'];
         }
-        
+
         // How long before resetting session? 60 minutes.
         $this->idle_timeout = isset($params['idle_timeout']) ? $params['idle_timeout'] : 3600;
-        
+
         // Where is user to be redirected after startOver function call?
         $this->start_url = isset($params['start_url']) ? $params['start_url'] : $_SERVER['PHP_SELF'];
-        
+
         // Initialize vars if not set.
         if (!isset($_SESSION[$this->seq]['steps'])) {
@@ -50,11 +50,11 @@
             $_SESSION[$this->seq]['defaults'] = array();
         }
-        
+
         // Manage timeout.
         $this->_auto_timeout();
     }
-    
-    /**
-     * Create a new step at the end (or specified position) of the $steps array. 
+
+    /**
+     * Create a new step at the end (or specified position) of the $steps array.
      *
      * @param  string $step_id      Uniqie identifyer for this step.
@@ -85,5 +85,5 @@
         );
     }
-    
+
     /**
      * Set the features of a step. Current step if step_id not specified.
@@ -123,5 +123,5 @@
         }
     }
-        
+
     /**
      * Set the current step id. Which step are we on?
@@ -142,5 +142,5 @@
         }
     }
-    
+
     /**
      * Get the current step id.
@@ -157,5 +157,5 @@
         }
     }
-    
+
     /**
      * Get the current step number.
@@ -179,5 +179,5 @@
             foreach ($_SESSION[$this->seq]['steps'] as $pos=>$step) {
                 if ($step['id'] == $step_id) {
-                    return $pos;   
+                    return $pos;
                 }
             }
@@ -186,8 +186,8 @@
         }
     }
-    
+
     /**
      * Returns the ID of the step with required=true and completed=false
-     * and active=true that falls before specified step_id. 
+     * and active=true that falls before specified step_id.
      *
      * @param  string $curr_step_id ID or number of current step.
@@ -212,5 +212,5 @@
         return $curr_step_id;
     }
-    
+
     /**
      * Returns the next step in the steps array or the first active required
@@ -235,5 +235,5 @@
         return null;
     }
-    
+
     /**
      * To set a set as 'completed'.
@@ -246,5 +246,5 @@
         $_SESSION[$this->seq]['steps'][$pos]['completed'] = true;
     }
-    
+
     /**
      * Prints the a link that returns to the form for a step.
@@ -262,5 +262,5 @@
         }
     }
-    
+
     /**
      * Saves given $step_data (usually coming from $_POST) into $_SESSION
@@ -279,5 +279,5 @@
         }
     }
-    
+
     /**
      * Returns the value saved in $_SESSION for a specific data key.
@@ -297,5 +297,5 @@
         }
     }
-    
+
     /**
      * Deletes all data saved in $_SESSION.
@@ -330,5 +330,5 @@
         }
     }
-    
+
     /**
      * Saves given array (usually coming from $_POST) into $_SESSION
@@ -341,5 +341,5 @@
         $_SESSION[$this->seq]['data'] = array_merge($_SESSION[$this->seq]['data'], $step_data);
     }
-    
+
     /**
      * Reset all vars.
@@ -354,5 +354,5 @@
         $_SESSION[$this->seq]['last_access_time'] = time();
     }
-    
+
     /**
      * Template function to be extended with custom SQL code.
@@ -365,5 +365,5 @@
         return false;
     }
-    
+
     /**
      * Template function to be extended with custom SQL code.
@@ -376,6 +376,6 @@
         return false;
     }
-    
-    
+
+
 } // END CLASS
 
Index: /trunk/lib/PayPal.inc.php
===================================================================
--- /trunk/lib/PayPal.inc.php	(revision 41)
+++ /trunk/lib/PayPal.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * The PayPal:: class provides functions for creating PayPal buttons and for 
+ * The PayPal:: class provides functions for creating PayPal buttons and for
  * receiving PayPal's Instant Payment Notification (IPN) service.
  *
@@ -8,5 +8,5 @@
  */
 class PayPal {
-    
+
     // General object parameters.
     var $_params = array(
@@ -14,14 +14,14 @@
         'test_mode' => false,
     );
-    
-    // Options used for specific buttons and links. 
+
+    // Options used for specific buttons and links.
     var $_default_button_options = array();
-    
+
     // Array of buttons created by newButton().
     var $_buttons = array();
-    
+
     // Store the response from the last IPN.
     var $_ipn_response;
-    
+
     /**
      * Constructor.
@@ -38,5 +38,5 @@
             $url = 'www.paypal.com';
         }
-        
+
         $this->_default_button_options = array(
             '_global' => array(
@@ -59,12 +59,12 @@
         );
     }
-    
-    /**
-     * Updates the _default_button_options array with options used for 
+
+    /**
+     * Updates the _default_button_options array with options used for
      * specific buttons, or all buttons if $type is null.
      *
      * @access  public
      *
-     * @param   mixed   $type       The type of button to set defaults. If null, 
+     * @param   mixed   $type       The type of button to set defaults. If null,
      *                              sets the global button types.
      * @param   array   $options    Options to set for button.
@@ -78,5 +78,5 @@
             return false;
         }
-        
+
         if (is_null($type) || '_global' == $type) {
             $this->_default_button_options['_global'] = array_merge($this->_default_button_options['_global'], $options);
@@ -85,9 +85,9 @@
             return false;
         }
-        
+
         $this->_default_button_options[$type] = array_merge($this->_default_button_options[$type], $options);
         return true;
     }
-    
+
     /**
      * Creates a new element in the _buttons array. Uses _default_button_options
@@ -108,14 +108,14 @@
             return false;
         }
-        
+
         if (!is_array($options) || empty($options)) {
             App::logMsg(sprintf('Invalid options: %s', getDump($options)), LOG_WARNING, __FILE__, __LINE__);
             return false;
         }
-        
+
         if (isset($this->_buttons[$name])) {
             App::logMsg(sprintf('Overwriting existing button name: %s', getDump($this->_buttons[$name])), LOG_DEBUG, __FILE__, __LINE__);
         }
-        
+
         $this->_buttons[$name] = array(
             'type' => $type,
@@ -141,5 +141,5 @@
             return false;
         }
-        
+
         $query_string = '';
         $delim = '';
@@ -156,5 +156,5 @@
         $search = array('/%2F/');
         $replace = array('/');
-        
+
         return $this->_buttons[$name]['options']['link_url'] . preg_replace($search, $replace, $query_string);
     }
@@ -183,5 +183,5 @@
         ?>
         <form action="<?php echo $this->_buttons[$name]['options']['button_url']; ?>" method="post">
-        <?php 
+        <?php
         if (is_array($this->_buttons[$name]['options']) && !empty($this->_buttons[$name]['options'])) {
             foreach ($this->_buttons[$name]['options'] as $key=>$val) {
@@ -192,5 +192,5 @@
                 }
             }
-        } 
+        }
         ?>
         <input type="image" src="<?php echo $this->_buttons[$name]['options']['submit_img']; ?>" border="0" name="submit" alt="<?php echo $this->_buttons[$name]['options']['submit_text']; ?>" />
@@ -241,5 +241,5 @@
     function incomingIPNRequest()
     {
-        if ($_SERVER['REQUEST_METHOD'] == 'POST' 
+        if ($_SERVER['REQUEST_METHOD'] == 'POST'
         && $_SERVER['CONTENT_TYPE'] == 'application/x-www-form-urlencoded'
         && !empty($_POST)) {
@@ -258,5 +258,5 @@
      */
     function processIPN()
-    {        
+    {
         if (getPost('test_ipn') == '1' || $this->getParam('test_mode')) {
             App::logMsg(sprintf('Processing PayPal IPN in test mode: %s', getDump(getFormData())), LOG_DEBUG, __FILE__, __LINE__);
@@ -266,5 +266,5 @@
             $url = parse_url($this->getParam('paypal_url'));
         }
-        
+
         // Read POST request and add 'cmd'.
         $received_data = getPost();
@@ -273,7 +273,7 @@
             $return_data .= '&' . $post_key . '=' . urlencode($post_val);
         }
-        
+
         // Set the port number based on the scheme.
-        if ($url['scheme'] == "https") { 
+        if ($url['scheme'] == "https") {
             $url['port'] = 443;
             $ssl = 'ssl://';
@@ -282,7 +282,7 @@
             $ssl = '';
         }
-            
+
         // Open connection to PayPal server.
-        $fp = fsockopen($ssl . $url['host'], $url['port'], $errnum, $errstr, 30); 
+        $fp = fsockopen($ssl . $url['host'], $url['port'], $errnum, $errstr, 30);
 
         if (!$fp) {
@@ -290,11 +290,11 @@
             return false;
         } else {
-            fputs($fp, "POST {$url['path']} HTTP/1.1\r\n"); 
-            fputs($fp, "Host: {$url['host']}\r\n"); 
-            fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); 
-            fputs($fp, "Content-length: " . strlen($return_data) . "\r\n"); 
-            fputs($fp, "Connection: close\r\n\r\n"); 
-            fputs($fp, $return_data . "\r\n\r\n"); 
-                            
+            fputs($fp, "POST {$url['path']} HTTP/1.1\r\n");
+            fputs($fp, "Host: {$url['host']}\r\n");
+            fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
+            fputs($fp, "Content-length: " . strlen($return_data) . "\r\n");
+            fputs($fp, "Connection: close\r\n\r\n");
+            fputs($fp, $return_data . "\r\n\r\n");
+
             // Loop through the response lines from the server.
             $this->_ipn_response = '';
@@ -303,10 +303,10 @@
             }
             fclose($fp);
-            
+
             App::logMsg(sprintf('IPN response received: %s', $this->_ipn_response), LOG_NOTICE, __FILE__, __LINE__);
             return true;
         }
     }
-    
+
     /**
      * Checks the response received from PayPal's IPN upon calling processIPN().
@@ -322,10 +322,10 @@
             return false;
         }
-        
+
         if (empty($this->_ipn_response)) {
             App::logMsg(sprintf('Cannot verify IPN, response empty.', null), LOG_WARNING, __FILE__, __LINE__);
             return false;
         }
-        
+
         if (preg_match('/VERIFIED/', $this->_ipn_response)) {
             App::logMsg(sprintf('IPN verified!', null), LOG_DEBUG, __FILE__, __LINE__);
@@ -339,6 +339,6 @@
         }
     }
-    
-    
+
+
 } // End of class.
 
Index: /trunk/lib/Prefs.inc.php
===================================================================
--- /trunk/lib/Prefs.inc.php	(revision 41)
+++ /trunk/lib/Prefs.inc.php	(revision 42)
@@ -30,6 +30,6 @@
      */
     var $params = array();
-    
-    
+
+
     /**
      * Prefs constructor.
@@ -43,5 +43,5 @@
     /**
      * Sets the default value of a preference. The pref will be set only if
-     * is not set already. 
+     * is not set already.
      *
      * @param  string $pref      The name of the preference to modify.
@@ -56,15 +56,15 @@
             $scope =& $this->scope;
         }
-        
+
         // No empty values allowed.
         if ('' == $pref || '' == $val || '' == $scope) {
             return false;
         }
-        
+
         // Initialized the prefs array.
         if (!isset($_SESSION['_prefs'])) {
             $_SESSION['_prefs'] = array();
         }
-        
+
         // In case boolean or null values are passed as a string.
         if ($val == 'true') {
@@ -84,5 +84,5 @@
 
     /**
-     * Sets the given preferences to the specific value, 
+     * Sets the given preferences to the specific value,
      *
      * @param  string $pref      The name of the preference to modify.
@@ -97,15 +97,15 @@
             $scope =& $this->scope;
         }
-        
+
         // No empty values allowed.
         if ('' == $pref || '' == $val || '' == $scope) {
             return false;
         }
-        
+
         // Initialized the prefs array.
         if (!isset($_SESSION['_prefs'])) {
             $_SESSION['_prefs'] = array();
         }
-        
+
         // In case boolean or null values are passed as a string.
         if ($val == 'true') {
@@ -120,5 +120,5 @@
         return true;
     }
-    
+
     /**
      * Returns the value of the requested preference.
@@ -134,8 +134,8 @@
             $scope =& $this->scope;
         }
-        
+
         return (isset($_SESSION['_prefs'][$scope][$pref])) ? $_SESSION['_prefs'][$scope][$pref] : null;
     }
-    
+
     /**
      * To see if a preference has been set.
@@ -152,8 +152,8 @@
             $scope =& $this->scope;
         }
-        
+
         return isset($_SESSION['_prefs'][$scope][$pref]);
     }
-    
+
     /**
      * Clear a set preference value.
@@ -167,5 +167,5 @@
             $scope =& $this->scope;
         }
-        
+
         if (isset($_SESSION['_prefs'][$scope][$pref])) {
             unset($_SESSION['_prefs'][$scope][$pref]);
@@ -181,5 +181,5 @@
      *                     preferences listed in the $prefs hash.
      *
-     * @return mixed       True on success or a PEAR_Error object on failure. 
+     * @return mixed       True on success or a PEAR_Error object on failure.
      */
     function retrieve()
@@ -192,5 +192,5 @@
         // FIXME: Database query goes here....
         return false;
-        
+
         $_SESSION['_prefs']['loaded'] = true;
     }
@@ -211,5 +211,5 @@
             return true;
         }
-        
+
         /*
          * If a list of preferences to store hasn't been provided in
@@ -221,10 +221,10 @@
             $prefs = array_merge($_SESSION['_prefs'], $prefs);
         }
-        
+
         if (!is_array($prefs) || empty($prefs)) {
             App::raiseMsg(_("No preferences are available."), MSG_ERR, __FILE__, __LINE__);
             App::dieBoomerangURL();
         }
-        
+
         // FIXME: Database query goes here....
         return false;
Index: /trunk/lib/RecordLock.inc.php
===================================================================
--- /trunk/lib/RecordLock.inc.php	(revision 41)
+++ /trunk/lib/RecordLock.inc.php	(revision 42)
@@ -33,5 +33,5 @@
     {
         static $instances = array();
-                
+
         if (!isset($instances[$auth_object->getVal('auth_name')])) {
             $instances[$auth_object->getVal('auth_name')] = new RecordLock($auth_object);
@@ -53,5 +53,5 @@
 
         $this->_auth = $auth_object;
-        
+
         // Get create tables config from global context.
         if (!is_null(App::getParam('db_create_tables'))) {
@@ -70,5 +70,5 @@
     {
         static $_db_tested = false;
-    
+
         if ($recreate_db || !$_db_tested && $this->getParam('create_table')) {
             if ($recreate_db) {
@@ -89,18 +89,18 @@
                 KEY record_val (record_val)
             )");
-            
+
             if (!DB::columnExists($this->getParam('db_table'), array(
-				'lock_id',
-				'record_table',
-				'record_key',
-				'record_val',
-				'title',
-				'set_by_admin_id',
-				'lock_datetime',
+                'lock_id',
+                'record_table',
+                'record_key',
+                'record_val',
+                'title',
+                'set_by_admin_id',
+                'lock_datetime',
             ), false, false)) {
                 App::logMsg(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), LOG_ALERT, __FILE__, __LINE__);
                 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), E_USER_ERROR);
             }
-        }    
+        }
         $_db_tested = true;
     }
@@ -151,9 +151,9 @@
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         if (is_numeric($record_table_or_lock_id) && !isset($record_key) && !isset($record_val)) {
             // Get lock data by lock_id.
             $qid = DB::query("
-                SELECT * FROM " . $this->getParam('db_table') . " 
+                SELECT * FROM " . $this->getParam('db_table') . "
                 WHERE lock_id = '" . addslashes($record_table_or_lock_id) . "'
             ");
@@ -161,5 +161,5 @@
             // Get lock data by record specs
             $qid = DB::query("
-                SELECT * FROM " . $this->getParam('db_table') . " 
+                SELECT * FROM " . $this->getParam('db_table') . "
                 WHERE record_table = '" . addslashes($record_table_or_lock_id) . "'
                 AND record_key = '" . addslashes($record_key) . "'
@@ -189,5 +189,5 @@
 
     /**
-     * Returns the status of who set the lock. Use this to ignore locks set by 
+     * Returns the status of who set the lock. Use this to ignore locks set by
      * the current user.
      *
@@ -197,5 +197,5 @@
     {
         $this->initDB();
-        
+
         if (isset($this->data['lock_id'])) {
             $qid = DB::query("SELECT * FROM " . $this->getParam('db_table') . " WHERE lock_id = '" . addslashes($this->data['lock_id']) . "'");
@@ -221,18 +221,18 @@
      */
     function set($record_table, $record_key, $record_val, $title='')
-    {       
+    {
         $this->initDB();
 
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         // Remove previous locks if exist. Is this better than using a REPLACE INTO?
         DB::query("
-            DELETE FROM " . $this->getParam('db_table') . " 
+            DELETE FROM " . $this->getParam('db_table') . "
             WHERE record_table = '" . addslashes($record_table) . "'
             AND record_key = '" . addslashes($record_key) . "'
             AND record_val = '" . addslashes($record_val) . "'
         ");
-        
+
         // Set new lock.
         DB::query("
@@ -254,8 +254,8 @@
         ");
         $lock_id = mysql_insert_id(DB::getDBH());
-        
+
         // Must register this locked record as the current.
         $this->select($lock_id);
-        
+
         return $lock_id;
     }
@@ -270,11 +270,11 @@
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         // Delete a specific lock.
         DB::query("
-            DELETE FROM " . $this->getParam('db_table') . " 
+            DELETE FROM " . $this->getParam('db_table') . "
             WHERE lock_id = '" . addslashes($this->data['lock_id']) . "'
         ");
-        
+
         App::logMsg(sprintf('Removing lock: %s', $this->data['lock_id']), LOG_DEBUG, __FILE__, __LINE__);
     }
@@ -284,10 +284,10 @@
      */
     function removeAll($user_id=null)
-    {        
+    {
         $this->initDB();
 
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         if (isset($user_id)) {
             // Delete specific user's locks.
@@ -309,9 +309,9 @@
 
         $this->initDB();
-        
+
         if (!$_timeout_run) {
             // Delete all old locks.
             DB::query("
-                DELETE FROM " . $this->getParam('db_table') . " 
+                DELETE FROM " . $this->getParam('db_table') . "
                 WHERE DATE_ADD(lock_datetime, INTERVAL '" . $this->getParam('auto_timeout') . "' SECOND) < NOW()
             ");
@@ -337,18 +337,18 @@
         <?php App::printHiddenSession() ?>
         <input type="hidden" name="lock_id" value="<?php echo $this->getID(); ?>" />
-        
+
         <p><?php
-        printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."), 
-            $this->getTitle(), 
-            $this->getEditor(), 
+        printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."),
+            $this->getTitle(),
+            $this->getEditor(),
             date('i', $this->getSecondsElapsed() + 60)
         );
         ?></p>
-        
+
         <?php if ($this->getSecondsElapsed() > $this->getParam('timeout')) { ?>
         <p><?php printf(_("You can forcibly unlock the record if you believe the editing session has expired. You might want to confirm with %s before doing this."), $this->getEditor()) ?></p>
         <input type="submit" name="unlock" value="<?php echo _("Unlock"); ?>" />
         <?php } ?>
-        
+
         <input type="submit" name="cancel" value="<?php echo _("Cancel"); ?>" />
         </form>
Index: /trunk/lib/RecordVersion.inc.php
===================================================================
--- /trunk/lib/RecordVersion.inc.php	(revision 41)
+++ /trunk/lib/RecordVersion.inc.php	(revision 42)
@@ -1,10 +1,10 @@
 <?php
 /**
- * The RecordVersion:: class provides a system for saving, reviewing, and 
+ * The RecordVersion:: class provides a system for saving, reviewing, and
  * restoring versions of a record of any DB table. All the data in the record is
  * serialized, compressed, and saved in a blob in the version_tbl. Restoring a
  * version simply does a REPLACE INTO of the data. It is very simple, and works
  * with multiple database tables, but the drawback is that relationships for
- * a record cannot be retained. For example, an article from an article_tbl can 
+ * a record cannot be retained. For example, an article from an article_tbl can
  * be saved, but not categories associated to the record in a category_article_tbl.
  * The restored article will simple retain the relationships that the previous
@@ -40,5 +40,5 @@
     {
         static $instances = array();
-                
+
         if (!isset($instances[$auth_object->getVal('auth_name')])) {
             $instances[$auth_object->getVal('auth_name')] = new RecordVersion($auth_object);
@@ -58,7 +58,7 @@
             trigger_error('Constructor not provided a valid Auth_SQL object.', E_USER_ERROR);
         }
-        
+
         $this->_auth = $auth_object;
-        
+
         // Get create tables config from global context.
         if (!is_null(App::getParam('db_create_tables'))) {
@@ -66,5 +66,5 @@
         }
     }
-    
+
     /**
      * Setup the database table for this class.
@@ -77,5 +77,5 @@
     {
         static $_db_tested = false;
-    
+
         if ($recreate_db || !$_db_tested && $this->getParam('create_table')) {
             if ($recreate_db) {
@@ -98,5 +98,5 @@
                 KEY record_val (record_val)
             )");
-            
+
             if (!DB::columnExists($this->getParam('db_table'), array(
                 'version_id',
@@ -113,5 +113,5 @@
                 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), E_USER_ERROR);
             }
-        }    
+        }
         $_db_tested = true;
     }
@@ -160,5 +160,5 @@
     {
         $this->initDB();
-    
+
         // Get current record.
         if (!$record = $this->getCurrent($record_table, $record_key, $record_val)) {
@@ -166,8 +166,8 @@
             return false;
         }
-                
+
         // Clean-up old versions.
         $this->deleteOld($record_table, $record_key, $record_val);
-        
+
         // Save as new version.
         DB::query("
@@ -206,8 +206,8 @@
     {
         $this->initDB();
-    
+
         // Get version data.
         $qid = DB::query("
-            SELECT * FROM " . $this->getParam('db_table') . " 
+            SELECT * FROM " . $this->getParam('db_table') . "
             WHERE version_id = '" . addslashes($version_id) . "'
         ");
@@ -228,5 +228,5 @@
         // SQLize the keys of the specified versioned record.
         $replace_keys = join(",\n", array_map('addslashes', array_keys($data)));
-        
+
         // SQLize the keys of the values of the specified versioned record. (These are more complex because we need to account for SQL null values.)
         $replace_values = '';
@@ -236,5 +236,5 @@
             $comma = ',';
         }
-        
+
         // Replace current record with specified versioned record.
         DB::query("
@@ -245,5 +245,5 @@
             )
         ");
-        
+
         return $record;
     }
@@ -252,5 +252,5 @@
      * Version garbage collection. Deletes versions older than min_days
      * when quantity of versions exceeds min_qty. If quantity
-     * exceeds 100 within min_days, the oldest are deleted to bring the 
+     * exceeds 100 within min_days, the oldest are deleted to bring the
      * quantity back down to min_qty.
      *
@@ -264,5 +264,5 @@
     {
         $this->initDB();
-    
+
         // Get total number of versions for this record.
         $qid = DB::query("
@@ -273,5 +273,5 @@
         ");
         list($v_count) = mysql_fetch_row($qid);
-        
+
         if ($v_count > $this->getParam('min_qty')) {
             if ($v_count > $this->getParam('max_qty')) {
@@ -329,5 +329,5 @@
     {
         $this->initDB();
-    
+
         // Get versions of this record.
         $qid = DB::query("
@@ -358,8 +358,8 @@
     {
         $this->initDB();
-    
+
         // Get version data.
         $qid = DB::query("
-            SELECT * FROM " . $this->getParam('db_table') . " 
+            SELECT * FROM " . $this->getParam('db_table') . "
             WHERE version_id = '" . addslashes($version_id) . "'
         ");
@@ -377,8 +377,8 @@
     {
         $this->initDB();
-    
+
         // Get version data.
         $qid = DB::query("
-            SELECT * FROM " . $this->getParam('db_table') . " 
+            SELECT * FROM " . $this->getParam('db_table') . "
             WHERE version_id = '" . addslashes($version_id) . "'
         ");
@@ -401,5 +401,5 @@
     {
         $this->initDB();
-    
+
         $qid = DB::query("
             SELECT * FROM " . addslashes($record_table) . "
Index: /trunk/lib/ScriptTimer.inc.php
===================================================================
--- /trunk/lib/ScriptTimer.inc.php	(revision 41)
+++ /trunk/lib/ScriptTimer.inc.php	(revision 42)
@@ -1,8 +1,8 @@
 <?php
 /**
- * ScriptTimer.inc.php 
+ * ScriptTimer.inc.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
- 
+
 class ScriptTimer {
 
@@ -10,15 +10,15 @@
     var $_timing_start_times;
     var $_timing_stop_times;
-    
+
     function start($name='default')
     {
         $this->_timing_start_times[$name] = explode(' ', microtime());
     }
-    
+
     function stop($name='default')
     {
         $this->_timing_stop_times[$name] = explode(' ', microtime());
     }
-    
+
     function getTime($name='default')
     {
@@ -26,5 +26,5 @@
             return 0;
         }
-        
+
         if (!isset($this->_timing_stop_times[$name])) {
             $stop_time = explode(' ', microtime());
@@ -32,9 +32,9 @@
             $stop_time = $this->_timing_stop_times[$name];
         }
-        
+
         // Do the big numbers first so the small ones aren't lost.
         $current = $stop_time[1] - $this->_timing_start_times[$name][1];
         $current += $stop_time[0] - $this->_timing_start_times[$name][0];
-        
+
         return sprintf($this->time_format, $current);
     }
Index: /trunk/lib/SessionCache.inc.php
===================================================================
--- /trunk/lib/SessionCache.inc.php	(revision 41)
+++ /trunk/lib/SessionCache.inc.php	(revision 42)
@@ -88,5 +88,5 @@
      * @param str   $var_id       An identifyer for the cached object.
      * @param bool  $force_it_in  If we have something really big that we
-     *                            still want to cache, setting this true 
+     *                            still want to cache, setting this true
      *                            allows this.
      *
@@ -106,10 +106,10 @@
         $serialized_var = serialize($var);
         $serialized_var_len = strlen($serialized_var);
-        
+
         if ($serialized_var_len >= $this->getParam('soft_limit') && !$force_it_in) {
             App::logMsg(sprintf('Serialized variable (%s bytes) more than soft_limit (%s bytes).', $serialized_var_len, $this->getParam('soft_limit')), LOG_NOTICE, __FILE__, __LINE__);
             return false;
         }
-        
+
         if ($serialized_var_len >= $this->getParam('hard_limit')) {
             App::logMsg(sprintf('Serialized variable (%s bytes) more than hard_limit (%s bytes).', $serialized_var_len, $this->getParam('hard_limit')), LOG_NOTICE, __FILE__, __LINE__);
@@ -122,5 +122,5 @@
             unset($_SESSION['_session_cache'][$var_id]);
             // Continue to prune the cache if it's length is too long for the new variable to fit, but keep at least MIN_ITEMS at least.
-            while (strlen(serialize($_SESSION['_session_cache'])) + $serialized_var_len >= $this->getParam('soft_limit') 
+            while (strlen(serialize($_SESSION['_session_cache'])) + $serialized_var_len >= $this->getParam('soft_limit')
             && sizeof($_SESSION['_session_cache']) >= $this->getParam('min_items')) {
                 array_shift($_SESSION['_session_cache']);
@@ -128,14 +128,14 @@
         }
         $_SESSION['_session_cache'][$var_id] =& $serialized_var;
-        
+
         if ($serialized_var_len >= 1024000) {
             App::logMsg(sprintf('Successfully cached oversized variable (%s bytes).', $serialized_var_len), LOG_DEBUG, __FILE__, __LINE__);
         }
-        
+
         return $var_id;
     }
-    
-    /**
-     * Retrives an object from the session cache and returns it unserialized. 
+
+    /**
+     * Retrives an object from the session cache and returns it unserialized.
      * It also moves it to the top of the stack, which makes it such that the
      * cache flushing mechanism of putCache deletes the oldest referenced items
@@ -155,5 +155,5 @@
             return false;
         }
-        
+
         $var_id = md5($var_id);
         if (isset($_SESSION['_session_cache'][$var_id])) {
@@ -168,5 +168,5 @@
         }
     }
-    
+
     /**
      * Tells you if the object is cached.
@@ -189,5 +189,5 @@
         return isset($_SESSION['_session_cache'][$var_id]);
     }
-    
+
     /**
      * Tells you if the object is cached.
Index: /trunk/lib/SortOrder.inc.php
===================================================================
--- /trunk/lib/SortOrder.inc.php	(revision 41)
+++ /trunk/lib/SortOrder.inc.php	(revision 42)
@@ -13,5 +13,5 @@
  * @requires    This class requires Utilities.inc.php
  * @requires    This class requires Prefs.inc.php
- * 
+ *
  * @author  Quinn Comendant <quinn@strangecode.com>
  * @version 1.6.1
@@ -22,5 +22,5 @@
 
 class SortOrder {
-        
+
     var $_columns;
     var $sort_by;
@@ -30,5 +30,5 @@
     var $default_sort;
     var $default_order;
-    
+
     /**
      * Constructor. Finds the current sort by and order.
@@ -40,13 +40,13 @@
      */
     function SortOrder($default_sort = '', $default_order = '')
-    {        
+    {
         $this->setDefault($default_sort, $default_order);
-    
+
         $this->default_sort = $default_sort;
         $this->default_order = $default_order;
     }
-    
+
     /**
-     * Build an array of valid sort SQL for each DB column. This SQL is reference 
+     * Build an array of valid sort SQL for each DB column. This SQL is reference
      * by the name and 'asc' or 'desc'.
      *
@@ -62,5 +62,5 @@
         );
     }
-    
+
     /**
      * Set sort and order values. This is how you set new sort values after
@@ -88,5 +88,5 @@
             $this->sort_by = $default_sort;
         }
-        
+
         // Which sort order to use?
         // (1) By GET or POST specification, if available.
@@ -103,6 +103,6 @@
         }
     }
-    
-    
+
+
     /**
      * Set sort and order values. This is how you set new sort values after
@@ -121,5 +121,5 @@
             Prefs::setValue('sort_by', $this->sort_by, $_SERVER['PHP_SELF']);
         }
-        
+
         // Set new order value.
         if (isset($order)) {
@@ -128,6 +128,6 @@
         }
     }
-    
-    
+
+
     /**
      * Returns the SQL code to sort by set column and set order.
@@ -149,7 +149,7 @@
             return '';
         }
-    } 
-    
-    
+    }
+
+
     /**
      * Prints a link for a column header with URL sort determining logic.
@@ -171,5 +171,5 @@
             ?><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?sort=' . $col . '&order=' . $default_order); ?>" title="<?php echo sprintf(_("Sort by %s"), $col_name); ?>"><?php echo $col_name; ?></a><?php
         }
-    }     
+    }
 
 }
Index: /trunk/lib/SpellCheck.inc.php
===================================================================
--- /trunk/lib/SpellCheck.inc.php	(revision 41)
+++ /trunk/lib/SpellCheck.inc.php	(revision 42)
@@ -9,5 +9,5 @@
  * @version 1.1
  */
- 
+
 /* Implementation example:
 --------------------------------------------------------------------------------
@@ -17,5 +17,5 @@
 // Instantiate with parameters. In this example we'll set the language and the path to the personal wordlist file.
 $spell = new SpellCheck(array(
-    'language' => 'en', 
+    'language' => 'en',
     'personal_wordlist' => '/tmp/my_custom_dict'
 ));
@@ -49,22 +49,22 @@
         'highlight_end' => '</strong>',
     );
-    
+
     var $_pspell_cfg_handle;
     var $_pspell_handle;
     var $_use_personal_wordlist = false;
     var $_errors = array();
-    
+
     /**
      * Constructor.
-	 *
+     *
      * @param  array    $params     Array of parameters (key => val pairs).
      */
     function SpellCheck($params)
     {
-		if (!is_array($params) || empty($params)) {
-			trigger_error('SpellCheck parameters not set properly', E_USER_ERROR);
-		}
-
-		$this->setParam($params);
+        if (!is_array($params) || empty($params)) {
+            trigger_error('SpellCheck parameters not set properly', E_USER_ERROR);
+        }
+
+        $this->setParam($params);
 
         $this->_pspell_cfg_handle = pspell_config_create($this->getParam('language'));
@@ -75,5 +75,5 @@
         if ('' != $this->getParam('personal_wordlist')) {
             if (!is_writable(dirname($this->getParam('personal_wordlist'))) || !is_writable($this->getParam('personal_wordlist'))) {
-            	App::logMsg(sprintf('Personal wordlist file not writable: %s', $this->getParam('personal_wordlist')), LOG_WARNING, __FILE__, __LINE__);
+                App::logMsg(sprintf('Personal wordlist file not writable: %s', $this->getParam('personal_wordlist')), LOG_WARNING, __FILE__, __LINE__);
             } else {
                 pspell_config_personal($this->_pspell_cfg_handle, $this->getParam('personal_wordlist'));
@@ -118,5 +118,5 @@
         }
     }
-    
+
     /**
      * Check whether any errors have been triggered.
@@ -136,5 +136,5 @@
         $this->_errors = array();
     }
-    
+
     /**
      * Check one word.
@@ -156,5 +156,5 @@
         }
     }
-    
+
     /**
      * Suggest the correct spelling for one misspelled word.
@@ -171,5 +171,5 @@
         return pspell_suggest($this->_pspell_handle, $word);
     }
-    
+
     /**
      * Add a word to a personal list.
@@ -186,13 +186,13 @@
         if ($this->_use_personal_wordlist) {
             if (pspell_add_to_personal($this->_pspell_handle, $word)) {
-				App::logMsg(sprintf('Added "%s" to personal wordlist: %s', $word, $this->getParam('personal_wordlist')), LOG_DEBUG, __FILE__, __LINE__);
-				return true;			
-			} else {
-				App::logMsg(sprintf('Failed adding "%s" to personal wordlist: %s', $word, $this->getParam('personal_wordlist')), LOG_WARNING, __FILE__, __LINE__);
-				return false;
-			}
-        }
-    }
-    
+                App::logMsg(sprintf('Added "%s" to personal wordlist: %s', $word, $this->getParam('personal_wordlist')), LOG_DEBUG, __FILE__, __LINE__);
+                return true;
+            } else {
+                App::logMsg(sprintf('Failed adding "%s" to personal wordlist: %s', $word, $this->getParam('personal_wordlist')), LOG_WARNING, __FILE__, __LINE__);
+                return false;
+            }
+        }
+    }
+
     /**
      * Save personal list to file.
@@ -217,5 +217,5 @@
         }
     }
-    
+
     /**
      * Returns an array of suggested words for each mispelled word in the given text.
@@ -252,5 +252,5 @@
         }
     }
-    
+
     /**
      * Checks all words in a given string.
@@ -284,5 +284,5 @@
         }
     }
-    
+
     /**
      * Returns a given string with misspelled words highlighted.
@@ -310,5 +310,5 @@
         return join('', $words);
     }
-    
+
     /**
      * Prints the HTML for correcting all mispellings found in the text of one $_FORM element.
@@ -326,5 +326,5 @@
         <input name="<?php echo $form_name ?>" type="hidden" value="<?php echo getFormData($form_name) ?>" />
         <?php
-        
+
         $form_words = $this->getStringSuggestions(getFormData($form_name));
         if (is_array($form_words) && !empty($form_words)) {
@@ -337,5 +337,5 @@
                 <option value="<?php echo $original_word ?>">(<?php echo $original_word ?>)</option>
                 <?php
-                
+
                 foreach ($words as $suggestion) {
                     ?>
@@ -343,5 +343,5 @@
                     <?php
                 }
-                
+
                 ?>
                 </select>
@@ -356,5 +356,5 @@
         }
     }
-    
+
     /**
      * Tests if any form spelling corrections have been submitted.
@@ -370,5 +370,5 @@
         return (false !== getFormData('spelling_suggestions', false)) || (false !== getFormData('spelling_corrections', false));
     }
-    
+
     /**
      * Replace the misspelled words in the text of a specified form with the corrections.
Index: /trunk/lib/TemplateGlue.inc.php
===================================================================
--- /trunk/lib/TemplateGlue.inc.php	(revision 41)
+++ /trunk/lib/TemplateGlue.inc.php	(revision 42)
@@ -6,5 +6,5 @@
 
 /**
- * Print URL to download file with BBEdit/Interarchy. "USER" must be a pre-set 
+ * Print URL to download file with BBEdit/Interarchy. "USER" must be a pre-set
  * environment variable. Files must reside within and be relative to env "DOCUMENT_ROOT".
  *
@@ -19,5 +19,5 @@
 
 /**
- * Returns an image tag for image specified in $src. 
+ * Returns an image tag for image specified in $src.
  *
  * @param  string $src     File name of the image, including path and file extension.
@@ -28,5 +28,5 @@
 {
     $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src;
-    
+
     if (true === ($gis = @getimagesize($filepath)) && !preg_match('/width|height/', $extra)) {
         $image_size = $gis[3];
@@ -34,5 +34,5 @@
         $image_size = '';
     }
-    
+
     return sprintf('<img src="%s" %s alt="%s" %s />',
         $src,
@@ -44,5 +44,5 @@
 
 /**
- * Prints an image tag for image specified in $src. 
+ * Prints an image tag for image specified in $src.
  *
  * @param  string $src     File name of the image, including path and file extension.
@@ -58,5 +58,5 @@
  * Finds the values of an enumeration or set column of a MySQL database, returning them in an array.
  * Use this to generate a pull-down menu of options or to validate the existance
- * of options. (Quinn 10 Feb 2001) 
+ * of options. (Quinn 10 Feb 2001)
  *
  * @param  string $db_table   database table to lookup
@@ -67,5 +67,5 @@
 {
     $qid = DB::query("SHOW COLUMNS FROM " . addslashes($db_table) . " LIKE '" . addslashes($db_col) . "'",false);
-        
+
     $row = mysql_fetch_row($qid);
     if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $enum)) {
@@ -79,5 +79,5 @@
 /**
  * Prints option fields for a select form. Works only with enum or set
- * data types in table columns. 
+ * data types in table columns.
  *
  * @param  string $db_table   database table to lookup
@@ -134,5 +134,5 @@
 /**
  * Prints checkbox fields. Works only with enum or set
- * data types in table columns. 
+ * data types in table columns.
  *
  * @param  string $db_table      database table to lookup
@@ -143,5 +143,5 @@
  */
 function printSetCheckboxes($db_table, $db_col, $preselected, $columns=1, $flag=null)
-{   
+{
     ?>
     <table>
@@ -152,5 +152,5 @@
         $preselected = explode(',', $preselected);
     }
-    
+
     // Checkbox POST data has the primary data in the keys, and 'on' as the values.
     // Here we assume in all the values of an array are 'on' that we can find the data
@@ -160,8 +160,8 @@
         $preselected = array_keys($preselected);
     }
-    
-    // Retreive values of a Set or ENUM database column. 
+
+    // Retreive values of a Set or ENUM database column.
     $values = getSetEnumFieldValues($db_table, $db_col);
-    
+
     // Initialize the HTML table generation vars.
     $num_cells = sizeof($values) - 1;
@@ -184,5 +184,5 @@
         $curr = $num_rows * $col_cnt + $lastrow_add + $row_cnt;
         $col_cnt++;
-        
+
         // Look for preselected value.
         if (in_array($v, $preselected)) {
@@ -212,5 +212,5 @@
 /**
  * Prints radio select fields. Works only with enum or set
- * data types in table columns. 
+ * data types in table columns.
  *
  * @param  string $db_table      database table to lookup
@@ -221,5 +221,5 @@
  */
 function printSetRadios($db_table, $db_col, $preselected, $columns=1, $flag=null)
-{   
+{
     ?>
     <table>
@@ -230,5 +230,5 @@
         $preselected = explode(',', $preselected);
     }
-    
+
     // Checkbox POST data has the primary data in the keys, and 'on' as the values.
     // Here we assume in all the values of an array are 'on' that we can find the data
@@ -238,8 +238,8 @@
         $preselected = array_keys($preselected);
     }
-    
-    // Retreive values of a Set or ENUM database column. 
+
+    // Retreive values of a Set or ENUM database column.
     $values = getSetEnumFieldValues($db_table, $db_col);
-    
+
     // Initialize the HTML table generation vars.
     $num_cells = sizeof($values) - 1;
@@ -262,5 +262,5 @@
         $curr = $num_rows * $col_cnt + $lastrow_add + $row_cnt;
         $col_cnt++;
-        
+
         // Look for preselected value.
         if (in_array($v, $preselected)) {
@@ -283,5 +283,5 @@
 
 /**
- * Prints a pulldown menu containing the specified values and keys of a table. 
+ * Prints a pulldown menu containing the specified values and keys of a table.
  *
  * @param  string $db_table         database table to lookup
@@ -305,5 +305,5 @@
         <?php
     }
-    
+
     // When the 'blank' value needs a specific key->val pair.
     if (is_array($blank)) {
@@ -323,5 +323,5 @@
 /**
  * Prints checkbox fields. Works only with enum or set
- * data types in table columns. 
+ * data types in table columns.
  *
  * @param  string $db_table         database table to lookup
@@ -339,5 +339,5 @@
         $preselected = explode(',', $preselected);
     }
-    
+
     // Checkbox POST data has the primary data in the keys, and 'on' as the values.
     // Here we assume in all the values of an array are 'on' that we can find the data
@@ -347,10 +347,10 @@
         $preselected = array_keys($preselected);
     }
-    
+
     $qid = DB::query("SELECT $key_column, $val_column FROM $db_table $extra_clause",false);
     while ($row = mysql_fetch_assoc($qid)) {
         $values[] = $row;
     }
-    
+
     // Rearrange array so sort is in vertical columns. FIXME: doesn't work.
 //  if ($vert_columns) {
@@ -378,5 +378,5 @@
         return false;
     }
-    
+
     // Initialize the HTML table generation vars.
     $num_cells = sizeof($values) - 1;
@@ -396,5 +396,5 @@
             $row_cnt++;
         }
-        
+
         if ($col_cnt < $cols_lastrow) {
             $lastrow_add = $col_cnt;
@@ -402,8 +402,8 @@
             $lastrow_add = $cols_lastrow;
         }
-        
+
         $curr = $num_rows * $col_cnt + $lastrow_add + $row_cnt;
         $col_cnt++;
-        
+
         // Look for preselected value.
         if (in_array($box[$val_column], $preselected)) {
@@ -412,5 +412,5 @@
             $checked = '';
         }
-        
+
         // Print a cell with basic named checkboxes.
         $html_name = $val_column . '[' . $box[$val_column] . ']';
@@ -420,5 +420,5 @@
         <?php /// FIXME: class=normal?
     }
-    
+
     if ($col_cnt < $columns) {
         // This last cell must expand to fill the last blank cells.
Index: /trunk/lib/Upload.inc.php
===================================================================
--- /trunk/lib/Upload.inc.php	(revision 41)
+++ /trunk/lib/Upload.inc.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * Upload.inc.php 
+ * Upload.inc.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  *
@@ -22,11 +22,11 @@
 
 class Upload {
-    
+
     // General object parameters.
     var $_params = array(
-    
+
         // Which messages do we pass to raiseMsg?
         'display_messages' => UPLOAD_MSG_ALL,
-        
+
         // Existing files will be overwritten when there is a name conflict?
         'allow_overwriting' => false,
@@ -222,5 +222,5 @@
         'ice'     => 'x-conference/x-cooltalk',
     );
-    
+
     /**
      * Set (or overwrite existing) parameters by passing an array of new parameters.
@@ -232,5 +232,5 @@
     {
         if (isset($params) && is_array($params)) {
-        
+
             // Enforce valid upload_path parameter.
             if (isset($params['upload_path'])) {
@@ -249,5 +249,5 @@
                 $params['upload_path'] = preg_replace('!/+$!', '', $params['upload_path']);
             }
-        
+
             // Merge new parameters with old overriding only those passed.
             $this->_params = array_merge($this->_params, $params);
@@ -276,5 +276,5 @@
     /**
      * Process uploaded files. Processes files existing within the specified $_FILES['form_name'] array.
-     * It tests for errors, cleans the filename, optionally sets custom file names. It will process 
+     * It tests for errors, cleans the filename, optionally sets custom file names. It will process
      * multiple files automatically if the file form element is an array (<input type="file" name="myfiles[]" />).
      *
@@ -296,5 +296,5 @@
             return false;
         }
-        
+
         // Ensure the file form element specified actually exists.
         if (!isset($_FILES[$form_name])) {
@@ -303,5 +303,5 @@
             return false;
         }
-        
+
         if (is_array($_FILES[$form_name]['name'])) {
             $files = $_FILES[$form_name];
@@ -318,5 +318,5 @@
 
         // To keep this script running even if user tries to stop browser.
-        ignore_user_abort(true); 
+        ignore_user_abort(true);
         ini_set('max_execution_time', 300);
         ini_set('max_input_time', 300);
@@ -332,5 +332,5 @@
                 continue;
             }
-            
+
             // Determine final file name.
             if ($num == 1) {
@@ -362,5 +362,5 @@
             // Clean the file name of bad characters.
             $file_name = $this->cleanFileName($file_name);
-            
+
             // If the file name has no extension, use the mime-type extension.
             if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) {
@@ -369,9 +369,9 @@
                 }
             }
-            
+
             // Set the path and file name.
             $file_path_name = $this->getParam('upload_path') . '/' . $file_name;
-            
-            
+
+
             // Check The php upload error messages.
             if (UPLOAD_ERR_INI_SIZE === $files['error'][$i]) {
@@ -407,5 +407,5 @@
                 continue;
             }
-            
+
             // Check to be sure it's an uploaded file.
             if (!is_uploaded_file($files['tmp_name'][$i])) {
@@ -415,5 +415,5 @@
                 continue;
             }
-            
+
             // Check to be sure the file is not empty.
             if ($files['size'][$i] < 1) {
@@ -423,5 +423,5 @@
                 continue;
             }
-            
+
             // Check to be sure the file has a valid file name extension.
             if (!in_array(strtolower($this->getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) {
@@ -431,5 +431,5 @@
                 continue;
             }
-            
+
             // Check to be sure the file has a unique file name.
             if (!$this->getParam('allow_overwriting') && $this->exists($file_name)) {
@@ -439,5 +439,5 @@
                 continue;
             }
-            
+
             // Move the file to the final place.
             if (move_uploaded_file($files['tmp_name'][$i], $file_path_name)) {
@@ -462,9 +462,9 @@
             }
         }
-        
+
         // Return names of files uploaded (or empty array when none processed).
         return $new_file_names;
     }
-    
+
     /**
      * Remove file within upload path.
@@ -481,5 +481,5 @@
             return false;
         }
-        
+
         $file_path_name = $this->getParam('upload_path') . '/' . $file_name;
 
@@ -495,5 +495,5 @@
         }
     }
-    
+
     /**
      * Renames a file within the upload path.
@@ -511,5 +511,5 @@
             return false;
         }
-        
+
         $old_file_path_name = $this->getParam('upload_path') . '/' . $old_name;
         $new_file_path_name = $this->getParam('upload_path') . '/' . $new_name;
@@ -529,5 +529,5 @@
         }
     }
-    
+
     /**
      * Tests if a file exists within the current upload_path.
@@ -544,10 +544,10 @@
             return false;
         }
-        
+
         return file_exists($this->getParam('upload_path') . '/' . $file_name);
     }
 
     /**
-     * Get filename by glob pattern. Searches a directory for an image that matches the 
+     * Get filename by glob pattern. Searches a directory for an image that matches the
      * specified glob pattern and returns the filename of the first file found.
      *
@@ -620,5 +620,5 @@
         return isset($ext[1]) ? $ext[1] : '';
     }
-    
+
     /**
      * An alias for App::raiseMsg that only sends messages configured by display_messages.
Index: /trunk/lib/Utilities.inc.php
===================================================================
--- /trunk/lib/Utilities.inc.php	(revision 41)
+++ /trunk/lib/Utilities.inc.php	(revision 42)
@@ -64,8 +64,8 @@
 
 /**
- * Returns text with appropriate html translations. 
+ * Returns text with appropriate html translations.
  *
  * @param  string $txt              Text to clean.
- * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or ' 
+ * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or '
  *                                  characters into HTML entities. This allows HTML to pass
  *                                  through unmunged.
@@ -85,11 +85,11 @@
         $search['retain_left_angle']       = '/&lt;/';
         $replace['retain_left_angle']      = '<';
-        
+
         $search['retain_right_angle']      = '/&gt;/';
         $replace['retain_right_angle']     = '>';
-        
+
         $search['retain_single_quote']     = '/&#039;/';
         $replace['retain_single_quote']    = "'";
-        
+
         $search['retain_double_quote']     = '/&quot;/';
         $replace['retain_double_quote']    = '"';
@@ -104,5 +104,5 @@
 
 /**
- * Returns text with stylistic modifications. 
+ * Returns text with stylistic modifications.
  *
  * @param  string   $txt  Text to clean.
@@ -125,5 +125,5 @@
     $search['single_quotes']    = '/(^|[^\w=])(?:\'|&#39;|&lsquo;)([^\']+?)(?:\'|&#39;|&rsquo;)([^\w]|$)/';
     $replace['single_quotes']   = '\\1&lsquo;\\2&rsquo;\\3';
-    
+
     // em--dashes  become em&mdash;dashes
     $search['em_dash']          = '/(\s*[^!<-])--([^>-]\s*)/';
@@ -133,5 +133,5 @@
 }
 
-    
+
 /**
  * Generates a hexadecibal html color based on provided word.
@@ -159,5 +159,5 @@
         }
         break;
-        
+
     case 1 :
     default :
@@ -219,5 +219,5 @@
     $units = array('B', 'KB', 'MB', 'GB', 'TB');
     $ii = count($units) - 1;
-  
+
     // Max unit
     $unit = array_search((string) $unit, $units);
@@ -225,5 +225,5 @@
         $unit = $ii;
     }
-  
+
     // Loop
     $i = 0;
@@ -232,5 +232,5 @@
         $i++;
     }
-  
+
     return sprintf($format, $size, $units[$i]);
 }
@@ -264,5 +264,5 @@
  * @param  mixed $var       The variable that is being set.
  * @param  mixed $default   What to set it to if $val is not currently set.
- * @return mixed            The resulting value of $var. 
+ * @return mixed            The resulting value of $var.
  */
 function setDefault(&$var, $default='')
@@ -307,8 +307,8 @@
  */
 function urlEncodeArray($data, $prefix='', $_return=true) {
-   
+
     // Data is stored in static variable.
     static $args;
-    
+
     if (is_array($data)) {
         foreach ($data as $key => $val) {
@@ -323,5 +323,5 @@
         $args[$prefix] = urlencode($data);
     }
-    
+
     if ($_return) {
         // This is not a recursive execution. All recursion is complete.
@@ -343,5 +343,5 @@
  */
 function urlEncodeArrayToString($data, $prefix='') {
-    
+
     $array_args = urlEncodeArray($data, $prefix);
     $url_args = '';
@@ -378,5 +378,5 @@
  * Prints the word "checked" if a variable is set, and optionally matches
  * the desired value, otherwise prints nothing,
- * used for printing the word "checked" in a checkbox form input. 
+ * used for printing the word "checked" in a checkbox form input.
  *
  * @param  mixed $var     the variable to compare
@@ -404,6 +404,6 @@
  * prints the word "selected" if a variable is set, and optionally matches
  * the desired value, otherwise prints nothing,
- * otherwise prints nothing, used for printing the word "checked" in a 
- * select form input 
+ * otherwise prints nothing, used for printing the word "checked" in a
+ * select form input
  *
  * @param  mixed $var     the variable to compare
@@ -450,5 +450,5 @@
  *
  * @param  array $date     String date to convert.
- * @param  array $format   Date format to pass to date(). 
+ * @param  array $format   Date format to pass to date().
  *                         Default produces MySQL datetime: 0000-00-00 00:00:00.
  * @return string          SQL-safe date.
@@ -462,5 +462,5 @@
         $sql_date = date($format, strtotime($date));
     }
-    
+
     return $sql_date;
 }
@@ -477,9 +477,9 @@
 {
     static $magic_quotes_gpc;
-    
+
     if (!isset($magic_quotes_gpc)) {
         $magic_quotes_gpc = get_magic_quotes_gpc();
     }
-    
+
     if ($magic_quotes_gpc) {
         if (!is_array($var)) {
@@ -562,5 +562,5 @@
         App::logMsg(sprintf('Adding signature to empty string.', null), LOG_NOTICE, __FILE__, __LINE__);
     }
-    
+
     if (!isset($seed_key)) {
         $seed_key = App::getParam('signing_key');
@@ -606,5 +606,5 @@
 /**
  * Sends empty output to the browser and flushes the php buffer so the client
- * will see data before the page is finished processing. 
+ * will see data before the page is finished processing.
  */
 function flushBuffer() {
@@ -682,5 +682,5 @@
 {
     static $urls = array();
-    
+
     if (!isset($urls[$url])) {
         if (!preg_match('|\w{1,}\.\w{2,5}/|', $url)) {
@@ -695,5 +695,5 @@
 
 /**
- * Takes a URL and returns it without the query or anchor portion 
+ * Takes a URL and returns it without the query or anchor portion
  *
  * @param  string $url   any kind of URI
@@ -706,5 +706,5 @@
 
 /**
- * Returns the remote IP address, taking into consideration proxy servers. 
+ * Returns the remote IP address, taking into consideration proxy servers.
  *
  * @param  bool $dolookup   If true we resolve to IP to a host name,
@@ -740,5 +740,5 @@
         $networks = array($networks);
     }
-    
+
     $ip_binary = sprintf('%032b', ip2long($ip));
     foreach ($networks as $network) {
@@ -758,10 +758,10 @@
         }
     }
-    
+
     return false;
 }
 
 /**
- * Returns a fully qualified URL to the current script, including the query. 
+ * Returns a fully qualified URL to the current script, including the query.
  *
  * @return string    a full url to the current script
@@ -796,5 +796,5 @@
     /**
     * Translates text
-    * 
+    *
     * @access public
     * @param string $text the text to be translated
@@ -804,8 +804,8 @@
         return $text;
     }
-    
+
     /**
     * Translates text
-    * 
+    *
     * @access public
     * @param string $text the text to be translated
@@ -815,8 +815,8 @@
         return $text;
     }
-    
+
     /**
     * Translates text by domain
-    * 
+    *
     * @access public
     * @param string $domain the language to translate the text into
@@ -827,8 +827,8 @@
         return $text;
     }
-    
+
     /**
     * Translates text by domain and category
-    * 
+    *
     * @access public
     * @param string $domain the language to translate the text into
@@ -840,11 +840,11 @@
         return $text;
     }
-    
+
     /**
     * Binds the text domain
-    * 
+    *
     * @access public
     * @param string $domain the language to translate the text into
-    * @param string 
+    * @param string
     * @return string translated text
     */
@@ -852,8 +852,8 @@
         return $domain;
     }
-    
+
     /**
     * Sets the text domain
-    * 
+    *
     * @access public
     * @param string $domain the language to translate the text into
Index: /trunk/services/admins.php
===================================================================
--- /trunk/services/admins.php	(revision 41)
+++ /trunk/services/admins.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * admins.php 
+ * admins.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -23,8 +23,8 @@
  * CONFIG
  *****************************************************************************/
- 
+
 // Titles and navigation header.
 $nav->addPage(_("Administrators"), $_SERVER['PHP_SELF']);
-    
+
 // The object to validate form input.
 $fv = new FormValidator();
@@ -60,5 +60,5 @@
  * MAIN
  *****************************************************************************/
- 
+
 // We may want to use the add/edit interface from another script, so this
 // allows us to remember which page we came from so we can go back there.
@@ -208,10 +208,10 @@
     $fv->isEmpty('username', _("<strong>Username</strong> cannot be blank."));
     $fv->stringLength('username', 0, 255, _("<strong>Username</strong> must contain less than 256 characters."));
-    
+
     $fv->isEmpty('userpass', _("<strong>Passwords</strong> cannot be blank."));
     $fv->stringLength('userpass', 6, 36, _("<strong>Passwords</strong> must be between 6 and 36 characters long."));
-    
+
     $fv->stringLength('first_name', 0, 255, _("<strong>First name</strong> must contain less than 256 characters."));
-    
+
     $fv->stringLength('last_name', 0, 255, _("<strong>Last name</strong> must contain less than 256 characters."));
 
@@ -219,5 +219,5 @@
     $fv->stringLength('email', 0, 255, _("<strong>Email</strong> must contain less than 256 characters."));
     $fv->validateEmail('email');
-    
+
     $fv->isEmpty('user_type', _("<strong>User type</strong> cannot be blank."));
     $fv->stringLength('user_type', 0, 255, _("<strong>User type</strong> has an invalid selection."));
@@ -265,5 +265,5 @@
     // Get the information for the form.
     $qid = DB::query("
-        SELECT * 
+        SELECT *
         FROM admin_tbl
         WHERE admin_id = '" . addslashes($id) . "'
@@ -274,8 +274,8 @@
         App::dieBoomerangURL();
     }
-    
+
     // Lock this record.
     $lock->set('admin_tbl', 'admin_id', $id, $frm['username']);
-    
+
     // Set misc values for the form.
     $frm = array_merge(array(
@@ -312,5 +312,5 @@
 {
     global $auth, $lock;
-    
+
     $lock->select('admin_tbl', 'admin_id', $id);
     if ($lock->isLocked() && !$lock->isMine()) {
@@ -320,5 +320,5 @@
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
     // Get the information for this object.
     $qid = DB::query("
@@ -331,5 +331,5 @@
         App::dieBoomerangURL();
     }
-    
+
     // Get the information for this object.
     $qid = DB::query("SELECT COUNT(*) from admin_tbl");
@@ -357,8 +357,8 @@
 {
     global $auth;
-    
+
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
     // Insert record data.
     DB::query("
@@ -382,14 +382,14 @@
     ");
     $last_insert_id = mysql_insert_id(DB::getDBH());
-    
+
     // Set admin password.
     $auth->setPassword($last_insert_id, $frm['userpass']);
-    
+
     // Create version.
     $version = RecordVersion::getInstance($GLOBALS['auth']);
     $version->create('admin_tbl', 'admin_id', $last_insert_id, $frm['username']);
-    
+
     App::raiseMsg(sprintf(_("The Admin <strong>%s</strong> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
-    
+
     return $last_insert_id;
 }
@@ -398,5 +398,5 @@
 {
     global $auth, $lock;
-    
+
     $lock->select('admin_tbl', 'admin_id', $frm['admin_id']);
     if ($lock->isLocked() && !$lock->isMine()) {
@@ -406,5 +406,5 @@
     // Break the cache because we are changing the list data.
     SessionCache::breakCache($_SERVER['PHP_SELF']);
-    
+
     // If the userpass is left blank or with the filler **** characters, we don't want to update it.
     if (!empty($frm['userpass']) && !preg_match('/[\*]{4,}/', $frm['userpass'])) {
@@ -412,5 +412,5 @@
         $auth->setPassword($frm['admin_id'], $frm['userpass']);
     }
-    
+
     // Update record data.
     DB::query("
@@ -440,7 +440,7 @@
     global $page;
     global $so;
-    
+
     $where_clause = '';
-    
+
     // Build search query if available.
     if (getFormData('search_query', false)) {
@@ -460,18 +460,18 @@
     // Count the total number of records so we can do something about the page numbers.
     $qid = DB::query("
-        SELECT COUNT(*) 
-        FROM admin_tbl 
+        SELECT COUNT(*)
+        FROM admin_tbl
         $where_clause
     ");
     list($num_results) = mysql_fetch_row($qid);
-    
+
     // Set page numbers now we know (needed for next step).
     $page->setTotalItems($num_results);
     $page->calculate();
-    
+
     // Final SQL, with sort and page limiters.
     $sql = "
-        SELECT 
-            admin_tbl.*, 
+        SELECT
+            admin_tbl.*,
             a1.username AS added_admin_username,
             a2.username AS modified_admin_username
@@ -483,5 +483,5 @@
         " . $page->getLimitSQL() . "
     ";
-    
+
     // A unique key for this query, with the total_items in case db records
     // were added since the last cache. This identifies a unique set of
@@ -494,5 +494,5 @@
         Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
     }
-    
+
     if (SessionCache::isCached($_SERVER['PHP_SELF']) && false) {
         // Get the cached results.
@@ -505,5 +505,5 @@
             $list[] = $row;
         }
-            
+
         if (isset($list) && !empty($list)) {
             // Cache the results.
Index: /trunk/services/css.php
===================================================================
--- /trunk/services/css.php	(revision 41)
+++ /trunk/services/css.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * css.php 
+ * css.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  *
Index: /trunk/services/lock.php
===================================================================
--- /trunk/services/lock.php	(revision 41)
+++ /trunk/services/lock.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * lock.php 
+ * lock.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
Index: /trunk/services/login.php
===================================================================
--- /trunk/services/login.php	(revision 41)
+++ /trunk/services/login.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * login.php 
+ * login.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -24,5 +24,5 @@
     } else {
         App::raiseMsg(_("Login failed, please try again."), MSG_NOTICE, __FILE__, __LINE__);
-        App::logMsg(sprintf('%s %s failed login using (MD5ed) password: %s', $auth->getVal('auth_name'), $frm['username'], md5($frm['password'])), LOG_NOTICE, __FILE__, __LINE__);
+        App::logMsg(sprintf('%s %s failed login using (MD5ed) password: %s', ucfirst($auth->getVal('auth_name')), $frm['username'], md5($frm['password'])), LOG_NOTICE, __FILE__, __LINE__);
     }
 }
Index: /trunk/services/logout.php
===================================================================
--- /trunk/services/logout.php	(revision 41)
+++ /trunk/services/logout.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * logout.php 
+ * logout.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
Index: /trunk/services/logs.php
===================================================================
--- /trunk/services/logs.php	(revision 41)
+++ /trunk/services/logs.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * logs.php 
+ * logs.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -48,7 +48,7 @@
  * MAIN
  *****************************************************************************/
- 
+
 // Allow realtime file stats.
-clearstatcache(); 
+clearstatcache();
 
 // What action to take.
@@ -65,5 +65,5 @@
     App::dieURL($_SERVER['PHP_SELF']);
     break;
-    
+
 case 'clear' :
 //     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
@@ -76,5 +76,5 @@
     App::dieURL($_SERVER['PHP_SELF']);
     break;
-    
+
 case 'archive' :
 //     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
@@ -90,9 +90,9 @@
     App::dieURL($_SERVER['PHP_SELF']);
     break;
-    
+
 // case 'ouput' :
 //     $main_template = 'ouput';
 //     break;
-    
+
 case 'download' :
     header('Content-Type: application/octet-stream');
@@ -101,5 +101,5 @@
     die;
     break;
-    
+
 default :
     $list =& getLog(Prefs::getValue('log_file', 'logs_module'), getFormData('search_query'));
@@ -137,5 +137,5 @@
 
 function deleteLog($log_file)
-{    
+{
     if (!file_exists(App::getParam('log_directory') . '/' . $log_file)) {
         App::raiseMsg(sprintf(_("Log file %s does not exist."), $log_file), MSG_NOTICE, __FILE__, __LINE__);
@@ -143,5 +143,5 @@
         return false;
     }
-    
+
     if (!is_writable(App::getParam('log_directory') . '/' . $log_file) && !is_writable(App::getParam('log_directory'))) {
         App::raiseMsg(sprintf(_("Log file %s could not be deleted."), $log_file), MSG_NOTICE, __FILE__, __LINE__);
@@ -149,5 +149,5 @@
         return false;
     }
-    
+
     if (unlink(App::getParam('log_directory') . '/' . $log_file)) {
         App::raiseMsg(sprintf(_("Log file %s has been deleted."), $log_file), MSG_NOTICE, __FILE__, __LINE__);
@@ -162,5 +162,5 @@
 
 function clearLog($log_file)
-{    
+{
     if (!$fp = fopen(App::getParam('log_directory') . '/' . $log_file, 'r+')) {
         App::raiseMsg(sprintf(_("Log file %s could not be opened."), $log_file), MSG_NOTICE, __FILE__, __LINE__);
@@ -168,5 +168,5 @@
         return false;
     }
-    
+
     flock($fp, LOCK_EX);
     $ftruncate_return = ftruncate($fp, 0);
@@ -185,5 +185,5 @@
 
 function archiveLog($log_file)
-{    
+{
     $old_file_name = $log_file;
     $new_file_name = $log_file . '__' . date('Y-m-d');
@@ -198,5 +198,5 @@
         return false;
     }
-    
+
     App::raiseMsg(sprintf(_("Log file %s has been archived to %s."), $old_file_name, $new_file_name), MSG_NOTICE, __FILE__, __LINE__);
     App::logMsg(sprintf('Log file %s has been archived to %s.', $old_file_name, $new_file_name), LOG_NOTICE, __FILE__, __LINE__);
@@ -205,5 +205,5 @@
 
 function printLog($log_file)
-{        
+{
     if (!is_file(App::getParam('log_directory') . '/' . $log_file)) {
         App::raiseMsg(sprintf(_("Log file %s not found."), $log_file), MSG_WARNING, __FILE__, __LINE__);
@@ -216,5 +216,5 @@
 
 function &getLog($log_file, $search_query='')
-{    
+{
     if (!is_file(App::getParam('log_directory') . '/' . $log_file)) {
         App::raiseMsg(sprintf(_("Log file %s not found."), $log_file), MSG_WARNING, __FILE__, __LINE__);
@@ -223,5 +223,5 @@
     }
     $log = file(App::getParam('log_directory') . '/' . $log_file);
-    
+
     if ('' != trim($search_query)) {
         if (getFormData('search_grep')) {
@@ -237,5 +237,5 @@
 {
     global $valid_file_extensions;
-    
+
     // Get a list of all files in the log directory.
     $dir_handle = opendir(App::getParam('log_directory'));
Index: /trunk/services/password.php
===================================================================
--- /trunk/services/password.php	(revision 41)
+++ /trunk/services/password.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * password.php 
+ * password.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -14,5 +14,5 @@
  * CODE CONFIG
  *****************************************************************************/
-    
+
 // Titles and navigation header.
 $nav->addPage(_("Change password"));
@@ -47,5 +47,5 @@
         }
     }
-    
+
     if (!$fv->anyErrors() && false === $auth->authenticate($auth->getVal('username'), $frm['oldpassword'])) {
         $fv->addError('oldpassword', _("Your <strong>Old password</strong> failed authentication."));
Index: /trunk/services/templates/admin_list.ihtml
===================================================================
--- /trunk/services/templates/admin_list.ihtml	(revision 41)
+++ /trunk/services/templates/admin_list.ihtml	(revision 42)
@@ -6,5 +6,5 @@
     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add administrator"); ?></a></span>
     <br />
-    
+
     <input type="text" class="small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: Admin id, Username, Userpass, First name, Last name, Email, User type, Login abuse exempt, Blocked, Blocked reason, Abuse warning level, Seconds online, Last login datetime, Last access datetime, Last login ip, Added by user id, Modified by user id, Added datetime, Modified datetime.")); ?>" />
     <input type="submit" value="<?php echo _("Search"); ?>" />
Index: /trunk/services/templates/list_info.ihtml
===================================================================
--- /trunk/services/templates/list_info.ihtml	(revision 41)
+++ /trunk/services/templates/list_info.ihtml	(revision 42)
@@ -4,5 +4,5 @@
     <?php } ?>
     <span class="nowrap commanditem commandtext">
-        <?php printf(_("Listing <strong>%s-%s</strong> of <strong>%s</strong> results on <strong>%s</strong> pages"), (0==$page->total_items ? 0 : $page->first_item+1), (0==$page->total_items ? 0 : $page->last_item+1), $page->total_items, $page->total_pages) ?> 
+        <?php printf(_("Listing <strong>%s-%s</strong> of <strong>%s</strong> results on <strong>%s</strong> pages"), (0==$page->total_items ? 0 : $page->first_item+1), (0==$page->total_items ? 0 : $page->last_item+1), $page->total_items, $page->total_pages) ?>
         &nbsp;&nbsp; <a href="<?php echo App::oHREF($_SERVER['PHP_SELF'], false); ?>"><?php echo _("List all"); ?></a>
         &nbsp;&nbsp; <?php echo _("Per page"); ?>:&nbsp;<?php $page->printPerPageLinks() ?>
Index: /trunk/services/templates/lock.ihtml
===================================================================
--- /trunk/services/templates/lock.ihtml	(revision 41)
+++ /trunk/services/templates/lock.ihtml	(revision 42)
@@ -1,3 +1,3 @@
-<?php 
+<?php
 if (!is_a($lock, 'RecordLock')) {
     return null;
@@ -9,7 +9,7 @@
 
     <p><?php
-    printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."), 
-        $lock->getTitle(), 
-        $lock->getEditor(), 
+    printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."),
+        $lock->getTitle(),
+        $lock->getEditor(),
         date('i', $lock->getSecondsElapsed() + 60)
     );
Index: /trunk/services/templates/versions_diff.ihtml
===================================================================
--- /trunk/services/templates/versions_diff.ihtml	(revision 41)
+++ /trunk/services/templates/versions_diff.ihtml	(revision 42)
@@ -1,3 +1,3 @@
-<div id="commandbox">               
+<div id="commandbox">
 <?php if (!getFormData('current', false)) { ?>
     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
Index: /trunk/services/templates/versions_list.ihtml
===================================================================
--- /trunk/services/templates/versions_list.ihtml	(revision 41)
+++ /trunk/services/templates/versions_list.ihtml	(revision 42)
@@ -9,5 +9,5 @@
     <th class="padleft"><?php echo _("By"); ?></th>
 </tr>
-<?php 
+<?php
 $first = true;
 foreach ($versions as $v) { ?>
@@ -25,7 +25,7 @@
     <td class="padleft nowrap"><?php echo $v['editor']; ?></td>
 </tr>
-<?php 
+<?php
 $first = false;
-} 
+}
 ?>
 </table>
Index: /trunk/services/templates/versions_view.ihtml
===================================================================
--- /trunk/services/templates/versions_view.ihtml	(revision 41)
+++ /trunk/services/templates/versions_view.ihtml	(revision 42)
@@ -1,3 +1,3 @@
-<div id="commandbox">               
+<div id="commandbox">
 <?php if (!getFormData('current', false)) { ?>
     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
@@ -10,5 +10,5 @@
 <table class="list" border="0" cellspacing="0" cellpadding="4">
 <?php
-while ((list($k, $v_d) = each($data))) { 
+while ((list($k, $v_d) = each($data))) {
     ?>
     <tr>
Index: /trunk/services/versions.php
===================================================================
--- /trunk/services/versions.php	(revision 41)
+++ /trunk/services/versions.php	(revision 42)
@@ -1,5 +1,5 @@
 <?php
 /**
- * versions.php 
+ * versions.php
  * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
  */
@@ -110,5 +110,5 @@
  * TEMPLATE INITIALIZATION
  *****************************************************************************/
- 
+
 include 'header.ihtml';
 include 'codebase/services/templates/' . $main_template;
Index: /trunk/tests/AppTest.php
===================================================================
--- /trunk/tests/AppTest.php	(revision 41)
+++ /trunk/tests/AppTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for App
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -124,5 +124,5 @@
 //         App::dieURL('/die/to/this/url.php');
 //     }
-// 
+//
 //     function test_dieboomerangurl()
 //     {
@@ -131,5 +131,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_setboomerangurl()
 //     {
@@ -138,5 +138,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_getboomerangurl()
 //     {
@@ -145,5 +145,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_deleteboomerangurl()
 //     {
@@ -152,5 +152,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_validboomerangurl()
 //     {
@@ -159,5 +159,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_sslon()
 //     {
@@ -166,5 +166,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_ssloff()
 //     {
Index: /trunk/tests/Auth_FileTest.php
===================================================================
--- /trunk/tests/Auth_FileTest.php	(revision 41)
+++ /trunk/tests/Auth_FileTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for Auth_File
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -71,5 +71,5 @@
 //         $this->assertTrue($true);
 //     }
-// 
+//
 //     function test_requireadminlogin()
 //     {
@@ -78,5 +78,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test__encrypt()
 //     {
@@ -85,5 +85,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test__salt()
 //     {
Index: /trunk/tests/Auth_SQLTest.php
===================================================================
--- /trunk/tests/Auth_SQLTest.php	(revision 41)
+++ /trunk/tests/Auth_SQLTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for Auth_SQL
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -53,5 +53,5 @@
             )
         ");
-        
+
     }
 
@@ -212,5 +212,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test_requireaccessclearance()
 //     {
Index: /trunk/tests/AuthorizeNetTest.php
===================================================================
--- /trunk/tests/AuthorizeNetTest.php	(revision 41)
+++ /trunk/tests/AuthorizeNetTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for AuthorizeNet
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -63,5 +63,5 @@
     {
         $result_code = $this->AuthorizeNet->process();
-        
+
         $this->assertTrue(false != $result_code, 'Processing did not return valid response. Do you have net access?');
         $this->assertEquals('3', $result_code);
@@ -89,5 +89,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function test__processresult()
 //     {
Index: /trunk/tests/CSSTest.php
===================================================================
--- /trunk/tests/CSSTest.php	(revision 41)
+++ /trunk/tests/CSSTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for CSS
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/DBSessionHandlerTest.php
===================================================================
--- /trunk/tests/DBSessionHandlerTest.php	(revision 41)
+++ /trunk/tests/DBSessionHandlerTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for DBSessionHandler
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/EmailTest.php
===================================================================
--- /trunk/tests/EmailTest.php	(revision 41)
+++ /trunk/tests/EmailTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for Email
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-12-01
  */
@@ -37,5 +37,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function testgetparam()
 //     {
@@ -44,5 +44,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function testsettemplate()
 //     {
@@ -51,5 +51,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function testsetstring()
 //     {
@@ -58,5 +58,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function testreplace()
 //     {
@@ -65,5 +65,5 @@
 //         $this->assertEquals($expected, $result);
 //     }
-// 
+//
 //     function testsend()
 //     {
@@ -76,5 +76,5 @@
     {
         $testpool = file('_email_test_addresses.txt');
-        
+
         $gc = 0;
         $bc = 0;
Index: /trunk/tests/FormValidatorTest.php
===================================================================
--- /trunk/tests/FormValidatorTest.php	(revision 41)
+++ /trunk/tests/FormValidatorTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for FormValidator
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/Google_APITest.php
===================================================================
--- /trunk/tests/Google_APITest.php	(revision 41)
+++ /trunk/tests/Google_APITest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for GoogleAPI
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/ImageThumbTest.php
===================================================================
--- /trunk/tests/ImageThumbTest.php	(revision 41)
+++ /trunk/tests/ImageThumbTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for ImageThumb
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/MCVETest.php
===================================================================
--- /trunk/tests/MCVETest.php	(revision 41)
+++ /trunk/tests/MCVETest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for MCVE
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/NavTest.php
===================================================================
--- /trunk/tests/NavTest.php	(revision 41)
+++ /trunk/tests/NavTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for Nav
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/NodeHeirarchyTest.php
===================================================================
--- /trunk/tests/NodeHeirarchyTest.php	(revision 41)
+++ /trunk/tests/NodeHeirarchyTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for NodeHeirarchy
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/PEditTest.php
===================================================================
--- /trunk/tests/PEditTest.php	(revision 41)
+++ /trunk/tests/PEditTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for PEdit
- * 
- * T\he method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * T\he method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/PageNumbersTest.php
===================================================================
--- /trunk/tests/PageNumbersTest.php	(revision 41)
+++ /trunk/tests/PageNumbersTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for PageNumbers
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/PageSequenceTest.php
===================================================================
--- /trunk/tests/PageSequenceTest.php	(revision 41)
+++ /trunk/tests/PageSequenceTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for PageSequence
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/PayPalTest.php
===================================================================
--- /trunk/tests/PayPalTest.php	(revision 41)
+++ /trunk/tests/PayPalTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for PayPal
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -101,10 +101,10 @@
 //         $result = $this->PayPal->incomingipnrequest();
 //     }
-// 
+//
 //     function test_processipn()
 //     {
 //         $result = $this->PayPal->processipn();
 //     }
-// 
+//
 //     function test_verifiedipn()
 //     {
Index: /trunk/tests/PrefsTest.php
===================================================================
--- /trunk/tests/PrefsTest.php	(revision 41)
+++ /trunk/tests/PrefsTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for Prefs
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/RecordLockTest.php
===================================================================
--- /trunk/tests/RecordLockTest.php	(revision 41)
+++ /trunk/tests/RecordLockTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for RecordLock
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/RecordVersionTest.php
===================================================================
--- /trunk/tests/RecordVersionTest.php	(revision 41)
+++ /trunk/tests/RecordVersionTest.php	(revision 42)
@@ -2,9 +2,9 @@
 /**
  * PHPUnit test case for RecordVersion
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
@@ -37,5 +37,5 @@
         // Use fresh user table.
         $this->Auth_SQL->initDB(true);
-        
+
         // Insert test data.
         DB::query("
@@ -56,7 +56,7 @@
             )
         ");
-        
+
         $this->Auth_SQL->login('testuser', 'testpass');
-        
+
         $this->RecordVersion =& RecordVersion::getInstance($this->Auth_SQL);
         $this->RecordVersion->setParam(array('db_table' => 'test_version_tbl'));
Index: /trunk/tests/ScriptTimerTest.php
===================================================================
--- /trunk/tests/ScriptTimerTest.php	(revision 41)
+++ /trunk/tests/ScriptTimerTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for ScriptTimer
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/SessionCacheTest.php
===================================================================
--- /trunk/tests/SessionCacheTest.php	(revision 41)
+++ /trunk/tests/SessionCacheTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for SessionCache
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/SortOrderTest.php
===================================================================
--- /trunk/tests/SortOrderTest.php	(revision 41)
+++ /trunk/tests/SortOrderTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for SortOrder
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/SpellCheckTest.php
===================================================================
--- /trunk/tests/SpellCheckTest.php	(revision 41)
+++ /trunk/tests/SpellCheckTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for SpellCheck
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/TemplateGlueTest.php
===================================================================
--- /trunk/tests/TemplateGlueTest.php	(revision 41)
+++ /trunk/tests/TemplateGlueTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for TemplateGlue
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/UploadTest.php
===================================================================
--- /trunk/tests/UploadTest.php	(revision 41)
+++ /trunk/tests/UploadTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for Upload
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/UtilitiesTest.php
===================================================================
--- /trunk/tests/UtilitiesTest.php	(revision 41)
+++ /trunk/tests/UtilitiesTest.php	(revision 42)
@@ -5,9 +5,9 @@
 /**
  * PHPUnit test case for Utilities
- * 
- * The method skeletons below need to be filled in with 
- * real data so that the tests will run correctly. Replace 
- * all EXPECTED_VAL and PARAM strings with real data. 
- * 
+ *
+ * The method skeletons below need to be filled in with
+ * real data so that the tests will run correctly. Replace
+ * all EXPECTED_VAL and PARAM strings with real data.
+ *
  * Created with PHPUnit_Skeleton on 2005-08-09
  */
Index: /trunk/tests/_email_test_addresses.txt
===================================================================
--- /trunk/tests/_email_test_addresses.txt	(revision 41)
+++ /trunk/tests/_email_test_addresses.txt	(revision 42)
@@ -4,6 +4,6 @@
 "Bob Smith" asdf@domain.com
 "Bob Smith"a sldkf &D*&F^*&^# @#*$ @#* asdf@domain.com
- "white space" <asdf@domain.com> 
- whitespace@domain.com 
+ "white space" <asdf@domain.com>
+ whitespace@domain.com
 asdf@domain.com (hello donkey)
 <asdf@domain.com>
Index: /trunk/tests/_skel.php
===================================================================
--- /trunk/tests/_skel.php	(revision 41)
+++ /trunk/tests/_skel.php	(revision 42)
@@ -39,19 +39,19 @@
 //     if (!preg_match('/^\./', $file) && is_file($dir . '/' . $file)) {
 //         echo 'Proccessing ' . realpath($dir . '/' . $file) . "\n";
-//         
+//
 //         preg_match('/([^\.]+)\..*$/i', $file, $match);
 //         $classname = $match[1];
-// 
+//
 //         $ps = new PHPUnit_Skeleton($classname, '../lib/' . $file);
-//         
+//
 //         // Generate the test class.
 //         // Default settings will not include any parent class methods, but
 //         // will include private methods.
 //         $ps->createTestClass();
-//         
+//
 //         // Write the new test class to file.
 //         // By default, code to run the test will be included.
 //         $ps->writeTestClass();
-// 
+//
 //     }
 // }
