You are here

protected function field_timer_jquery_countdown_js_base::generateJSSettingsArray in Field Timer 7.2

3 calls to field_timer_jquery_countdown_js_base::generateJSSettingsArray()
field_timer_jquery_countdown_date_field_base::generateJSSettings in includes/field_timer_jquery_countdown.inc
@inheritdoc
field_timer_jquery_countdown_js_base::generateJSSettings in includes/field_timer_base.inc
@inheritdoc
field_timer_jquery_countdown_led_date_field_base::generateJSSettings in includes/field_timer_jquery_countdown_led.inc
@inheritdoc

File

includes/field_timer_base.inc, line 205
Contains base help classes to perform field formatter related actions.

Class

field_timer_jquery_countdown_js_base
Base class for jquery_countdown formatters.

Code

protected function generateJSSettingsArray($key, $timestamp, $type, $settings) {
  $js_settings = array();
  $js_settings[$key]['timestamp'] = $timestamp;
  $js_settings[$key]['options'] = $settings;
  if ($type == 'timer' || $type == 'auto' && $timestamp <= REQUEST_TIME) {
    $js_settings[$key]['options']['until'] = FALSE;
    $js_settings[$key]['options']['since'] = TRUE;
  }
  elseif ($type == 'countdown' || $type == 'auto' && $timestamp > REQUEST_TIME) {
    $js_settings[$key]['options']['until'] = TRUE;
    $js_settings[$key]['options']['since'] = FALSE;
  }
  $js_settings[$key]['plugin'] = $this
    ->getPluginName();
  return $js_settings;
}