--- textcommaformatter.module.orginal	Mon Oct 13 15:05:10 2008
+++ textcommaformatter.module.patch		Sat Nov  8 18:00:29 2008
@@ -5,13 +5,13 @@
  * Implementation of hook_field_formatter_info(),.
  */
 function textcommaformatter_field_formatter_info() {
-  return array(
-    'text_comma' => array(
-      'label' => t('Comma-separated'),
-      'field types' => array('text'),
-      'multiple values' => CONTENT_HANDLE_MODULE,
-    ),
-  );
+	return array(
+		'text_comma' => 				array('label' => t('Commas'), 				'multiple values' => CONTENT_HANDLE_MODULE, 'field types' => array('text')),
+		'text_comma_and' => 			array('label' => t('Commas-And'), 			'multiple values' => CONTENT_HANDLE_MODULE, 'field types' => array('text')),
+		'text_comma_and_period' => 		array('label' => t('Commas-And-Period'),	'multiple values' => CONTENT_HANDLE_MODULE, 'field types' => array('text')),
+		'text_unordered_list' => 		array('label' => t('Unordered List'), 		'multiple values' => CONTENT_HANDLE_MODULE, 'field types' => array('text')),
+		'text_ordered_list' => 			array('label' => t('Ordered List'), 		'multiple values' => CONTENT_HANDLE_MODULE, 'field types' => array('text')),
+	);
 }
 
 /**
@@ -19,9 +19,11 @@
  */
 function textcommaformatter_theme() {
   return array(
-    'textcommaformatter_formatter_text_comma' => array(
-      'arguments' => array('element' => NULL),
-    ),
+    'textcommaformatter_formatter_text_comma' => 			array('arguments' => array('element' => NULL), 'function' => 'theme_textcommaformatter_formatter_text_comma'),
+    'textcommaformatter_formatter_text_comma_and' => 		array('arguments' => array('element' => NULL), 'function' => 'theme_textcommaformatter_formatter_text_comma'),
+    'textcommaformatter_formatter_text_comma_and_period' => array('arguments' => array('element' => NULL), 'function' => 'theme_textcommaformatter_formatter_text_comma'),
+    'textcommaformatter_formatter_text_unordered_list' => 	array('arguments' => array('element' => NULL), 'function' => 'theme_textcommaformatter_formatter_text_comma'),
+    'textcommaformatter_formatter_text_ordered_list' => 	array('arguments' => array('element' => NULL), 'function' => 'theme_textcommaformatter_formatter_text_comma'),
   );
 }
 
@@ -31,6 +33,7 @@
  * @ingroup themeable
  */
 function theme_textcommaformatter_formatter_text_comma($element) {
+  //get data out of multidimensional $element array and place it in flat $values array
   $values = array();
   
   $item = $element;
@@ -42,6 +45,74 @@
     $item['#item'] = $element[$key]['#item'];
     $values[] = ($allowed =_text_allowed_values($item)) ? $allowed : $item['#item']['safe'];
   }
+  //$values array ready for use
   
-  return implode(', ', $values);
+  //format output
+  switch ($element['#formatter']) {
+    case 'text_comma':
+      $output = implode(', ', $values);
+      break;
+    case 'text_comma_and':
+      $output = ImplodeToEnglish($values, ', ', '');
+      break;
+    case 'text_comma_and_period':
+      $output = ImplodeToEnglish($values, ', ', '.');
+      break;
+	case 'text_unordered_list':
+      $output = ImplodeToList($values, 'ul');
+      break;
+	case 'text_ordered_list':
+      $output = ImplodeToList($values, 'ol');
+      break;
+	}
+
+	return $output;
 }
+
+
+//taken from http://us.php.net/manual/en/function.implode.php#86845
+function ImplodeToEnglish ($array, $seperator, $suffix) {
+    // sanity check
+    if (!$array || !count ($array)) {
+        return '';
+	}
+
+    // get last element   
+    $last = array_pop ($array);
+
+    // if it was the only element - return it
+    if (!count ($array)) {
+        return $last;
+	}
+	
+	//returns
+	// x, x, x and x.
+    return implode ($seperator, $array) . t(' and ') . $last . $suffix;
+}
+
+function ImplodeToList ($array, $type) {
+    // sanity check
+    if (!$array || !count ($array)) {
+        return '';
+	}
+	
+	//returns
+	// <ul>
+	// <li class="field-item odd">x</li>
+	// <li class="field-item even">x</li>
+	// </ul>
+	$odd = true;
+	$output = '<'.$type.'>'."\n";
+	foreach ($array as $value) {
+		if ($odd) {
+			$output .= '<li class="field-item odd">'.$value.'</li>'."\n";
+			$odd = false;
+		}
+		else {
+			$output .= '<li class="field-item even">'.$value.'</li>'."\n";
+			$odd = true;
+		}
+	}
+	$output .= '</'.$type.'>';
+	return $output;
+}
\ No newline at end of file
