function jst_timer_get_formats in Javascript Timer 7
Same name and namespace in other branches
- 8 widgets/jst_timer.module \jst_timer_get_formats()
Get a list of formats and handle default values.
2 calls to jst_timer_get_formats()
- jst_timer_form_alter in widgets/
jst_timer.module - Implementation of hook_form_alter(). Add the timer widget specific settings to admin screen.
- jst_timer_get_js_formats in widgets/
jst_timer.module - Get a javascript array encoded list of timer formats.
File
- widgets/
jst_timer.module, line 611 - Default widget implementation for an up and down timer. This widget does not use hook_ctwidget as it is always included.
Code
function jst_timer_get_formats() {
$formats = variable_get('jst_timer_formats', array());
if (count($formats) == 0) {
// The first one is the global format.
$formats[] = '<em>(%dow% %moy%%day%)</em><br/>%days% days + %hours%:%mins%:%secs%';
$formats[] = 'Only %days% days, %hours% hours, %mins% minutes and %secs% seconds left';
$formats[] = '%days% shopping days left';
$formats[] = '<em>(%dow% %moy%%day%)</em><br/>%days% days + %hours%:%mins%:%secs%';
}
return $formats;
}