function _jquery_countdown_block_block_view in jQuery Countdown 6
Returns the 'view' $op info for hook_block().
Parameters
$delta: string The id of the block to render.
File
- jquery_countdown_block/
jquery_countdown_block.module, line 123 - Provides configurable blocks of countdown timers.
Code
function _jquery_countdown_block_block_view($delta) {
$data = array();
// Get block settings from variables or throw error if not exists...
$block_settings = variable_get('jquery_countdown_block_' . $delta . '_settings', NULL);
if (!$block_settings) {
$data['subject'] = '';
$data['content'] = t('this block is not configured. please go to the block settings and configure it');
return $data;
}
// sanitize block settings to a format the our jquery_countdown script is understanding ;)
$jquery_countdown_options = array(
$block_settings['until'] => date_format_date(date_make_date($block_settings['date']), 'custom', 'F d, Y g:i a', 'en_US'),
'format' => implode('', $block_settings['format']),
);
// merge with the rest so we get always all settings
$jquery_countdown_options = array_merge($block_settings, $jquery_countdown_options);
// call theme function and return the countdown
$data['subject'] = '';
$data['content'] = theme('jquery_countdown', $jquery_countdown_options, '', 'jquery-countdown-block-' . $delta);
return $data;
}