diff mee.module @ 16:a3d780c2979a

Add CCK formatters to access the short content version of the element.
author Franck Deroche <franck@defr.org>
date Fri, 20 Nov 2009 09:59:22 +0100
parents 50a57b1517cb
children 7ac5a50a9db5
line wrap: on
line diff
--- a/mee.module	Fri Nov 20 09:57:07 2009 +0100
+++ b/mee.module	Fri Nov 20 09:59:22 2009 +0100
@@ -21,6 +21,12 @@
     'mee_formatter_default' => array(
       'arguments' => array('element' => NULL),
     ),
+    'mee_formatter_plain' => array(
+      'arguments' => array('element' => NULL),
+    ),
+    'mee_formatter_short' => array(
+      'arguments' => array('element' => NULL),
+    ),
   );
 
   $scald_config = variable_get('scald_config', 0);
@@ -244,6 +250,11 @@
       'field types' => array('multimedia_editorial_element'),
       'multiple values' => CONTENT_HANDLE_CORE,
     ),
+    'short' => array(
+      'label' => t('Short content'),
+      'field types' => array('multimedia_editorial_element'),
+      'multiple values' => CONTENT_HANDLE_CORE
+    )
   );
   //@TODO generate context processor based field formatters
   //foreach (scald_contexts() as $context) {
@@ -290,6 +301,13 @@
   return strip_tags(scald_sas_to_rendered($element['#item']['safe'], 'title', TRUE));
 }
 
+/**
+ * Theme function for 'short' text field formatter.
+ */
+function theme_mee_formatter_short($element) {
+  return check_markup($element['#item']['short']);
+}
+
 //function theme_mee_context_formatter($element) {
 //  return 'foo';
 //}