? 695270_textformatters_singlelist.patch
Index: textformatter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/textformatter/textformatter.module,v
retrieving revision 1.2
diff -u -p -r1.2 textformatter.module
--- textformatter.module	17 Sep 2009 15:35:58 -0000	1.2
+++ textformatter.module	28 Feb 2010 23:15:19 -0000
@@ -30,6 +30,16 @@ function textformatter_field_formatter_i
       'label' => t('Ordered List'),
       'multiple values' => CONTENT_HANDLE_MODULE,
       'field types' => array('text')),
+    
+    'text_unordered_list_single' => array(
+      'label' => t('Unordered List (single)'),
+      'field types' => array('text'),
+      'multiple values' => CONTENT_HANDLE_CORE,),
+      
+    'text_ordered_list_single' => array(
+      'label' => t('Ordered List (single)'),
+      'field types' => array('text'),
+      'multiple values' => CONTENT_HANDLE_CORE,),
   );
 }
 
@@ -57,6 +67,15 @@ function textformatter_theme() {
     'textformatter_formatter_text_unordered_list' => array(
       'arguments' => array('element' => NULL),
       'function' => 'theme_textformatter_formatter_text_unorderedlist'),
+
+    'textformatter_formatter_text_ordered_list_single' => array(
+      'arguments' => array('element' => NULL),
+      'function' => 'theme_textformatter_formatter_text_orderedlist_single'),
+
+    'textformatter_formatter_text_unordered_list_single' => array(
+      'arguments' => array('element' => NULL),
+      'function' => 'theme_textformatter_formatter_text_unorderedlist_single'),
+
   );
 }
 
@@ -164,3 +183,29 @@ function theme_textformatter_formatter_t
   $values = textformatter_formatter_get_element_values($element);
   return theme('item_list', $values, NULL, 'ul');
 }
+
+
+/**
+ * Theme a single textfield as an HTML unordered list.
+ *
+ * @ingroup themeable
+ */
+  
+function theme_textformatter_formatter_text_unorderedlist_single($element) {
+  $output = '';
+  $txt = ($allowed =_text_allowed_values($element)) ? $allowed : $element['#item']['safe'];
+  $items = array_filter(explode("\n",trim($txt)));
+  return theme('item_list',$items);
+}
+
+/**
+ * Theme a single textfield as an HTML ordered list.
+ *
+ * @ingroup themeable
+ */
+function theme_textformatter_formatter_text_orderedlist_single($element) {
+  $output = '';
+  $txt = ($allowed =_text_allowed_values($element)) ? $allowed : $element['#item']['safe'];
+  $items = array_filter(explode("\n",trim($txt)));
+  return theme('item_list',$items, NULL, 'ol');
+}
\ No newline at end of file
