function _jquery_countdown_block_content in jQuery Countdown 7.2
Same name and namespace in other branches
- 7 jquery_countdown.module \_jquery_countdown_block_content()
1 call to _jquery_countdown_block_content()
- jquery_countdown_block_view in ./
jquery_countdown.module - Implementation of hook_block_view().
File
- ./
jquery_countdown.module, line 68
Code
function _jquery_countdown_block_content($delta = '') {
// @TODO: ? Never used please explain... or fix it...
$init_format = date("F d, Y g:i a", time());
$format = '';
$msg_format = check_plain(variable_get('jquery_countdown_msg_format', ''));
$format .= preg_match("/%years/", $msg_format) ? 'Y' : $format;
$format .= preg_match("/%months/", $msg_format) ? 'O' : $format;
$format .= preg_match("/%weeks/", $msg_format) ? 'W' : $format;
$format .= preg_match("/%days/", $msg_format) ? 'D' : $format;
$format .= preg_match("/%hours/", $msg_format) ? 'H' : $format;
$format .= preg_match("/%minutes/", $msg_format) ? 'M' : $format;
$format .= preg_match("/%seconds/", $msg_format) ? 'S' : $format;
$event_name = check_plain(variable_get('jquery_countdown_event_name', ''));
$until = date("F d, Y g:i a", strtotime(variable_get('jquery_countdown_target', '')));
$description = t(variable_get('jquery_countdown_description', 'Until @event_name') . ' ', array(
'@event_name' => $event_name,
));
$options = array(
'until' => $until,
'format' => $format,
'description' => $description,
'onExpiry' => 'Drupal.jQueryCountdownEvent',
'expiryText' => check_plain(variable_get('jquery_countdown_exp_txt', '')),
);
return theme('jquery_countdown', array(
'options' => $options,
'id' => 'jquery_countdown-' . $delta,
));
}