Changeset 30086
- Timestamp:
- 07/01/10 11:40:34 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfTrafficCMSPlugin/trunk/lib/filter/TrafficCMSBaseFilter.class.php
r27008 r30086 23 23 private function autoConfigure() 24 24 { 25 $config = sfConfig::get('app_sf_traffic_cms_plugin_auto_configure', array()); 26 27 if (!isset($config['date_format'])) 28 { 29 $config['date_format'] = '%day%/%month%/%year%'; 30 } 31 25 32 foreach ($this->getWidgetSchema()->getFields() as $name => $widget) 26 33 { 27 // if ($widget instanceof sfWidgetFormFilterDate) 28 // { 29 // $this->setWidget($name, new sfWidgetFormJQueryDate(array( 30 // 'format' => sfConfig::get('app_sf_traffic_cms_plugin_date_format', $config['date_format']), 31 // 'can_be_empty' => $widget->getOption('can_be_empty'), 32 // ))); 33 // } 34 if ($widget instanceof sfWidgetFormFilterDate) 35 { 36 $this->getWidget($name)->getOption('from_date')->setOption('format', $config['date_format']); 37 $this->getWidget($name)->getOption('to_date')->setOption('format', $config['date_format']); 38 } 34 39 } 35 40 } plugins/sfTrafficCMSPlugin/trunk/lib/form/TrafficCMSBaseForm.class.php
r29817 r30086 230 230 sfJSLibManager::addLib('jquery_ui'); 231 231 232 $appConfig = sfConfig::get('app_sf_traffic_cms_plugin_auto_configure'); 233 $dateYear = array_combine($appConfig['date_picker']['years'], $appConfig['date_picker']['years']); 232 $dateYear = array_combine($config['date_picker']['years'], $config['date_picker']['years']); 234 233 235 234 $dateWidget = $this->getWidget($name); 236 235 $dateWidget->setOptions(array( 237 'format' => sfConfig::get($ appConfig['date_format'], $config['date_format']),236 'format' => sfConfig::get($config['date_format'], '%day%/%month%/%year%'), 238 237 'can_be_empty' => $widget->getOption('can_be_empty'), 239 238 'years' => $dateYear,