Index: trunk/lib/TemplateGlue.inc.php
===================================================================
--- trunk/lib/TemplateGlue.inc.php	(revision 40)
+++ 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.
