You are here

protected function field_timer_jquery_countdown_led_base::renderLayout in Field Timer 7.2

Render field item.

2 calls to field_timer_jquery_countdown_led_base::renderLayout()
field_timer_jquery_countdown_led_base::renderItems in includes/field_timer_jquery_countdown_led.inc
@inheritdoc
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 182
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

protected function renderLayout($display_days, $max_count_of_days, $display_hours, $display_minutes, $display_seconds, $countdown_theme) {
  $layout = '<div class="jquery-countdown-led-display-wrapper">';
  if ($display_days) {
    for ($i = $max_count_of_days; $i > 0; $i--) {
      $layout .= '<span class="%t% image{d1' . substr('000', 0, $i - 1) . '}"></span>';
    }
    $layout .= '<span class="%t% imageDay"></span><span class="%t% imageSpace"></span>';
  }
  if ($display_hours) {
    $layout .= '<span class="%t% image{h10}"></span><span class="%t% image{h1}"></span>';
  }
  if ($display_minutes) {
    $layout .= '<span class="%t% imageSep"></span>' . '<span class="%t% image{m10}"></span><span class="%t% image{m1}"></span>';
  }
  if ($display_seconds) {
    $layout .= '<span class="%t% imageSep"></span>' . '<span class="%t% image{s10}"></span><span class="%t% image{s1}"></span>';
  }
  return str_replace('%t%', $countdown_theme, $layout) . '</div>';
}