Author: uncleringo
Date: 2010-05-14 15:16:18 +0200 (Fri, 14 May 2010)
New Revision: 29466

Modified:
   plugins/sfTrafficCMSPlugin/trunk/lib/form/TrafficCMSBaseForm.class.php
Log:
Updated jqueryui datepicker stuff



Modified: plugins/sfTrafficCMSPlugin/trunk/lib/form/TrafficCMSBaseForm.class.php
===================================================================
--- plugins/sfTrafficCMSPlugin/trunk/lib/form/TrafficCMSBaseForm.class.php      
2010-05-14 12:58:31 UTC (rev 29465)
+++ plugins/sfTrafficCMSPlugin/trunk/lib/form/TrafficCMSBaseForm.class.php      
2010-05-14 13:16:18 UTC (rev 29466)
@@ -225,14 +225,18 @@
       {
         sfJSLibManager::addLib('jquery_ui');
 
-               $appConfig = 
sfConfig::get('app_sf_traffic_cms_plugin_auto_configure');
-               $dateYear = array_combine($appConfig['date_picker']['years'], 
$appConfig['date_picker']['years']);
+        $appConfig = sfConfig::get('app_sf_traffic_cms_plugin_auto_configure');
+        $dateYear = array_combine($appConfig['date_picker']['years'], 
$appConfig['date_picker']['years']);
 
-        $this->setWidget($name, new sfWidgetFormJQueryDate(array(
+        $dateWidget = $this->getWidget($name);
+        $dateWidget->setOptions(array(
             'format' => sfConfig::get($appConfig['date_format'], 
$config['date_format']),
             'can_be_empty' => $widget->getOption('can_be_empty'),
-                       'years' => $dateYear
-        )));
+            'years' => $dateYear,
+            'months' => array_combine(range(1, 12), range(1, 12)),
+            'days' => array_combine(range(1, 31), range(1, 31)),
+          ));
+        $this->setWidget($name, new sfWidgetFormJQueryDate(array('date_widget' 
=> $dateWidget)));
       }
     }
   }
@@ -341,7 +345,7 @@
       
       // Hide the parent id since we don't want to be able to edit it
       $widget_form->setWidget($object->getTable()->getTableName() . '_id', new 
sfWidgetFormInputHidden());
-
+      
       $form_to_embed->embedForm($widget_name, $widget_form);
 
       $form_to_embed->setWidgetSchema(
@@ -352,6 +356,7 @@
       );
 
     }
+    
     $children->save();
 //    $object->set($model_class . 's', $children);
 //    if ($object_count > 0)
@@ -396,5 +401,6 @@
         )
       );
     }
+    
   }
 }
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to