You are here

function countdown_tutorialzine_angelov_build in Countdown 7.2

Countdown build callback.

Parameters

$plugin: The plugin definition.

$countdown_options: The array of options from the countdown box plugin.

Return value

A build array.

1 string reference to 'countdown_tutorialzine_angelov_build'
tutorialzine_angelov.inc in plugins/countdown/tutorialzine_angelov.inc

File

plugins/countdown/tutorialzine_angelov.inc, line 35

Code

function countdown_tutorialzine_angelov_build($plugin, $countdown_options) {
  $path = $plugin['path'] . '/tutorialzine_angelov';

  // Code more or less verbatim from jquery_countdown_timer_attach().
  $attach['js'] = array(
    $path . '/js/jquery_countdown_timer.js' => array(
      'type' => 'file',
      'scope' => 'footer',
    ),
    $path . '/js/jquery_countdown_timer_init.js' => array(
      'type' => 'file',
      'scope' => 'footer',
    ),
  );

  // Add JS settings.
  $settings = array(
    'jquery_countdown_timer_date' => $countdown_options['countdown_target_timestamp'],
  );
  $attach['js'][] = array(
    'data' => array(
      'jquery_countdown_timer' => $settings,
    ),
    'type' => 'setting',
  );

  // Add css.
  $attach['css'] = array(
    $path . '/css/jquery_countdown_timer.css',
  );
  return array(
    // The CSS ID is hardcoded in the JS :(
    '#markup' => "<div id='jquery-countdown-timer'></div>" . "<div id='jquery-countdown-timer-note'></div>",
    '#attached' => $attach,
  );
}