# HG changeset patch # User Franck Deroche # Date 1258707562 -3600 # Node ID a3d780c2979a3737a11def84a5654e5aa903bc18 # Parent 7bb375e191b16fbe764067c6611cbbecc4fe6272 Add CCK formatters to access the short content version of the element. diff -r 7bb375e191b1 -r a3d780c2979a mee.module --- 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'; //}