function _timefield_js_settings in Timefield 7
Same name and namespace in other branches
- 1.0.x timefield.module \_timefield_js_settings()
Helper function to return settings usable for the jquery.timepicker.js library.
2 calls to _timefield_js_settings()
- timefield_field_formatter_settings_form in ./
timefield.module - Implements hook_field_formatter_settings_form().
- timefield_field_widget_form in ./
timefield.module - Implements hook_field_widget_form().
File
- ./
timefield.module, line 1155 - Defines a Field API field for time
Code
function _timefield_js_settings($class, $settings) {
$js_settings = array(
$class => array(
'showLeadingZero' => $settings['showLeadingZero'],
'timeSeparator' => $settings['separator'],
'showPeriod' => $settings['showPeriod'],
'showPeriodLabels' => $settings['showPeriod'],
'periodSeparator' => $settings['periodSeparator'],
'amPmText' => array(
$settings['am_text'],
$settings['pm_text'],
),
'showMinutesLeadingZero' => TRUE,
'showCloseButton' => $settings['showCloseButton'],
'closeButtonText' => $settings['closeButtonText'],
'showNowButton' => $settings['showNowButton'],
'nowButtonText' => $settings['nowButtonText'],
'showDeselectButton' => $settings['showDeselectButton'],
'deselectButtonText' => $settings['deselectButtonText'],
'myPosition' => $settings['myPosition'],
'atPosition' => $settings['atPosition'],
),
);
return $js_settings;
}