Index: branches/1.1dev/lib/Email.inc.php
===================================================================
--- branches/1.1dev/lib/Email.inc.php	(revision 758)
+++ branches/1.1dev/lib/Email.inc.php	(revision 759)
@@ -209,5 +209,7 @@
         // Apply regex pattern to search elements.
         $search = array_keys($replacements);
-        array_walk($search, create_function('&$v', '$v = "{" . mb_strtoupper($v) . "}";'));
+        array_walk($search, function (&$v) {
+            $v = sprintf('{%s}', mb_strtoupper($v));
+        });
 
         // Replacement values.
Index: branches/1.1dev/lib/TemplateGlue.inc.php
===================================================================
--- branches/1.1dev/lib/TemplateGlue.inc.php	(revision 758)
+++ branches/1.1dev/lib/TemplateGlue.inc.php	(revision 759)
@@ -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".
  *
@@ -21,5 +21,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 dir and file extension.
@@ -30,5 +30,5 @@
 {
     $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src;
-    
+
     if (false === ($gis = @getimagesize($filepath)) || preg_match('/width|height/', $extra)) {
         $image_size = '';
@@ -36,5 +36,5 @@
         $image_size = $gis[3];
     }
-    
+
     return sprintf('<img src="%s" %s alt="%s" %s />',
         $src,
@@ -52,5 +52,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
@@ -62,7 +62,7 @@
 {
 	$qid = dbQuery("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], $enum)) {
+	if (isset($row[1]) && preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $enum)) {
     	natsort($enum[1]);
 		return $enum[1];
@@ -74,5 +74,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
@@ -109,5 +109,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
@@ -118,10 +118,10 @@
  */
 function printSetCheckboxes($db_table, $db_col, $preselected, $columns=1, $flag=null)
-{	
+{
     // Sometimes preselected comes as a comma list.
     if (!is_array($preselected)) {
         $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
@@ -131,8 +131,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);
-	
+
     if (!empty($values)) {
         ?>
@@ -160,5 +160,5 @@
             $curr = $num_rows * $col_cnt + $lastrow_add + $row_cnt;
             $col_cnt++;
-        
+
             // Look for preselected value.
             if (in_array($item, $preselected)) {
@@ -189,5 +189,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
@@ -198,10 +198,10 @@
  */
 function printSetRadios($db_table, $db_col, $preselected, $columns=1, $flag=null)
-{	
+{
     // Sometimes preselected comes as a comma list.
     if (!is_array($preselected)) {
         $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
@@ -211,8 +211,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);
-	
+
     if (!empty($values)) {
         ?>
@@ -240,5 +240,5 @@
             $curr = $num_rows * $col_cnt + $lastrow_add + $row_cnt;
             $col_cnt++;
-        
+
             // Look for preselected value.
             if (in_array($item, $preselected)) {
@@ -262,5 +262,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
@@ -284,5 +284,5 @@
         <?php
 	}
-	
+
 	// When the 'blank' value needs a specific key->val pair.
 	if (is_array($blank)) {
@@ -304,5 +304,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
@@ -321,5 +321,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
@@ -329,10 +329,10 @@
         $preselected = array_keys($preselected);
     }
-	
+
 	$qid = dbQuery("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.
 // 	if ($vert_columns) {
@@ -360,5 +360,5 @@
 	    return false;
 	}
-	
+
     // Initialize the HTML table generation vars.
     $num_cells = sizeof($values) - 1;
@@ -378,5 +378,5 @@
             $row_cnt++;
         }
-        
+
         if ($col_cnt < $cols_lastrow) {
             $lastrow_add = $col_cnt;
@@ -384,8 +384,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)) {
@@ -394,5 +394,5 @@
             $checked = '';
         }
-        
+
         // Print a cell with named checkboxes.
         $checkbox_name = oTxt(sprintf($name, $val_column, $box[$val_column]));
@@ -400,5 +400,5 @@
         <?php
     }
-    
+
     if ($col_cnt < $columns) {
         // This last cell must expand to fill the last blank cells.
Index: branches/1.1dev/lib/Utilities.inc.php
===================================================================
--- branches/1.1dev/lib/Utilities.inc.php	(revision 758)
+++ branches/1.1dev/lib/Utilities.inc.php	(revision 759)
@@ -292,8 +292,8 @@
  *
  * @param  string $text  A string for which to convert to color.
- *
- * @return string  A hexadecimal html color.
- */
-function getTextColor($text, $method=1)
+ * @param  float  $n     Brightness value between 0-1.
+ * @return string        A hexadecimal html color.
+ */
+function getTextColor($text, $method=1, $n=0.87)
 {
     $hash = md5($text);
@@ -310,6 +310,8 @@
     case 1 :
     default :
-        // Reduce all hex values slighly to avoid all white.
-        array_walk($rgb, create_function('&$v', '$v = dechex(round(hexdec($v) * 0.87));'));
+        // Reduce all hex values slightly to avoid all white.
+        array_walk($rgb, function (&$v) use ($n) {
+            $v = dechex(round(hexdec($v) * $n));
+        });
         break;
     case 2 :
