You are here

function theme_jquery_countdown in jQuery Countdown 7.2

Same name and namespace in other branches
  1. 5 jquery_countdown.module \theme_jquery_countdown()
  2. 6 jquery_countdown.theme.inc \theme_jquery_countdown()
  3. 7 jquery_countdown.module \theme_jquery_countdown()

Constructs a jQuery Countdown element and adds the required JavaScript.

Parameters

$content: (optional) The initial content to put in the countdown. This is what is shown when JavaScript is not available.

$options: (optional) The options to apply to the element.

$id: (optional) The name of the element.

2 theme calls to theme_jquery_countdown()
jquery_countdown_field_formatter_view in ./jquery_countdown.module
_jquery_countdown_block_content in ./jquery_countdown.module

File

./jquery_countdown.module, line 260

Code

function theme_jquery_countdown($variables) {

  //@TODO: add javascript fallback for target time as possible $content ?!
  $id = $variables['id'];
  $options = $variables['options'];
  $content = $variables['content'];

  // Construct the ID name and add the JavaScript.
  $id = drupal_html_id($id);

  // add the Javascript
  jquery_countdown_add('#' . $id, $options);

  // Construct the HTML.
  return '<div id="' . $id . '" class="jquery-countdown">' . $content . '</div>';
}