public function field_timer_jquery_countdown_led_base::renderItems in Field Timer 7.2
@inheritdoc
Overrides field_timer_formatter_interface::renderItems
1 call to field_timer_jquery_countdown_led_base::renderItems()
- field_timer_jquery_countdown_led_date_field_base::renderItems in includes/
field_timer_jquery_countdown_led.inc - @inheritdoc
1 method overrides field_timer_jquery_countdown_led_base::renderItems()
- field_timer_jquery_countdown_led_date_field_base::renderItems in includes/
field_timer_jquery_countdown_led.inc - @inheritdoc
File
- includes/
field_timer_jquery_countdown_led.inc, line 125 - Help file. Contains help classes to perform field_timer_jquery_countdown_led formatter related actions.
Class
- field_timer_jquery_countdown_led_base
- Base class for field_timer_jquery_countdown_led formatter.
Code
public function renderItems($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
if (!$this
->loadLibrary()) {
return array();
}
$info = entity_get_info($entity_type);
$id_key = $info['entity keys']['id'];
$elements = array();
$settings = $display['settings'];
foreach ($items as $delta => $item) {
$layout = $this
->renderLayout($settings['display_days'], $settings['max_count_of_days'], $settings['display_hours'], $settings['display_minutes'], $settings['display_seconds'], $settings['countdown_theme']);
$elements[$delta] = array(
'#type' => 'markup',
'#markup' => '<span id="jquery-countdown-led-' . $entity_type . '_' . $entity->{$id_key} . '_' . $field['field_name'] . '_' . $delta . '" class="jquery-countdown-led ' . $settings['countdown_theme'] . '">' . $layout . '</span>',
);
}
$this
->loadJSandCSS($entity_type, $entity, $field, $instance, $langcode, $items, $display);
return $elements;
}