You are here

protected function field_timer_jquery_countdown_js_base::loadLibrary in Field Timer 7.2

@inheritdoc

Overrides field_timer_formatter_js_base::loadLibrary

2 calls to field_timer_jquery_countdown_js_base::loadLibrary()
field_timer_jquery_countdown_base::renderItems in includes/field_timer_jquery_countdown.inc
@inheritdoc
field_timer_jquery_countdown_led_base::renderItems in includes/field_timer_jquery_countdown_led.inc
@inheritdoc

File

includes/field_timer_base.inc, line 157
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 loadLibrary() {
  if (!$this->library_loaded) {
    $library = libraries_load('jquery.countdown');
    $this->library_loaded = $library && !empty($library['loaded']);
    $js_name = 'jquery.countdown.js';
    $js_name_min = 'jquery.countdown.min.js';
    $base_path = 'sites/all/libraries/jquery.countdown';
    if (!$this->library_loaded) {
      drupal_set_message(t("Can't load jQuery Countdown library. Please download !url plugin and extract it to @path, so @js and @js_min can be found at @full_path and @full_path_min.", array(
        '!url' => l(t('jQuery Countdown'), 'http://keith-wood.name/countdown.html', array(
          'absolute' => TRUE,
        )),
        '@path' => $base_path,
        '@js' => $js_name,
        '@js_min' => $js_name_min,
        '@full_path' => $base_path . '/' . $js_name,
        '@full_path_min' => $base_path . '/' . $js_name_min,
      )), 'error');
    }
  }
  return $this->library_loaded;
}