jquery_countdown_date.module in jQuery Countdown 6
provides a jquery.countdown formatter for "date" field and settings in the date widget
File
jquery_countdown_date/jquery_countdown_date.moduleView source
<?php
/**
* @file
* provides a jquery.countdown formatter for "date" field and settings in the date widget
*/
function jquery_countdown_date_widget_settings_alter(&$settings, $op, $widget) {
$widget_types = array(
'date_popup',
'date_select',
);
if (!empty($widget['type']) && in_array($widget['type'], $widget_types) || !empty($widget['widget_type']) && in_array($widget['widget_type'], $widget_types)) {
switch ($op) {
case 'form':
$settings = array_merge($settings, _jquery_countdown_settings_form());
// @TODO: remove date element and use from date field...
// @TODO: remove administrative title
// @TODO: add support for multiple value with same settings...
unset($settings['jquery_countdown']['admin_title']);
unset($settings['jquery_countdown']['date']);
break;
case 'save':
// tell cck to store the complete jquery_countdown form elements because we use #tree in first fieldgroup
$settings[] = 'jquery_countdown';
break;
}
}
}
/**
* Implementation of hook_theme();
*/
function jquery_countdown_date_theme() {
$items = array();
$items['jquery_countdown_date_formatter_jquery_countdown_default'] = array(
'arguments' => array(
'element' => NULL,
),
'file' => 'jquery_countdown_date.formatter.inc',
);
return $items;
}
/**
* Implementation of hook_field_formatter_info()
*/
function jquery_countdown_date_field_formatter_info() {
$formatter = array();
$formatter['jquery_countdown_default'] = array(
'label' => t('jQuery Countdown'),
'field types' => array(
'date',
),
'multiple values' => CONTENT_HANDLE_CORE,
'description' => t('Display date as jquery Countdown'),
);
return $formatter;
}
/**
* Helper function to get the widget settings.
* Based on the galleryformatter module
*/
function jquery_countdown_date_get_field_settings($field_name, $content_type) {
$field = content_fields($field_name, $content_type);
return $field['widget'];
}
Functions
Name![]() |
Description |
---|---|
jquery_countdown_date_field_formatter_info | Implementation of hook_field_formatter_info() |
jquery_countdown_date_get_field_settings | Helper function to get the widget settings. Based on the galleryformatter module |
jquery_countdown_date_theme | Implementation of hook_theme(); |
jquery_countdown_date_widget_settings_alter | @file provides a jquery.countdown formatter for "date" field and settings in the date widget |