comparison 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
comparison
equal deleted inserted replaced
15:7bb375e191b1 16:a3d780c2979a
17 ), 17 ),
18 'mee_ressource_manager' => array( 18 'mee_ressource_manager' => array(
19 'arguments' => array('element' => NULL), 19 'arguments' => array('element' => NULL),
20 ), 20 ),
21 'mee_formatter_default' => array( 21 'mee_formatter_default' => array(
22 'arguments' => array('element' => NULL),
23 ),
24 'mee_formatter_plain' => array(
25 'arguments' => array('element' => NULL),
26 ),
27 'mee_formatter_short' => array(
22 'arguments' => array('element' => NULL), 28 'arguments' => array('element' => NULL),
23 ), 29 ),
24 ); 30 );
25 31
26 $scald_config = variable_get('scald_config', 0); 32 $scald_config = variable_get('scald_config', 0);
242 'plain' => array( 248 'plain' => array(
243 'label' => t('Plain text'), 249 'label' => t('Plain text'),
244 'field types' => array('multimedia_editorial_element'), 250 'field types' => array('multimedia_editorial_element'),
245 'multiple values' => CONTENT_HANDLE_CORE, 251 'multiple values' => CONTENT_HANDLE_CORE,
246 ), 252 ),
253 'short' => array(
254 'label' => t('Short content'),
255 'field types' => array('multimedia_editorial_element'),
256 'multiple values' => CONTENT_HANDLE_CORE
257 )
247 ); 258 );
248 //@TODO generate context processor based field formatters 259 //@TODO generate context processor based field formatters
249 //foreach (scald_contexts() as $context) { 260 //foreach (scald_contexts() as $context) {
250 // $formatters[$context] = array( 261 // $formatters[$context] = array(
251 // 'label' => t('Scald context processor: @context', array('@context' => $context), 262 // 'label' => t('Scald context processor: @context', array('@context' => $context),
286 /** 297 /**
287 * Theme function for 'plain' text field formatter. 298 * Theme function for 'plain' text field formatter.
288 */ 299 */
289 function theme_mee_formatter_plain($element) { 300 function theme_mee_formatter_plain($element) {
290 return strip_tags(scald_sas_to_rendered($element['#item']['safe'], 'title', TRUE)); 301 return strip_tags(scald_sas_to_rendered($element['#item']['safe'], 'title', TRUE));
302 }
303
304 /**
305 * Theme function for 'short' text field formatter.
306 */
307 function theme_mee_formatter_short($element) {
308 return check_markup($element['#item']['short']);
291 } 309 }
292 310
293 //function theme_mee_context_formatter($element) { 311 //function theme_mee_context_formatter($element) {
294 // return 'foo'; 312 // return 'foo';
295 //} 313 //}