Author: Jonathan.Wage
Date: 2010-02-10 17:02:38 +0100 (Wed, 10 Feb 2010)
New Revision: 27819
Modified:
plugins/sfSympalPlugin/trunk/config/app.yml
plugins/sfSympalPlugin/trunk/lib/form/sfSympalForm.class.php
Log:
[1.4][sfSympalPlugin][1.0] Making automatic form rich date changing configurable
Modified: plugins/sfSympalPlugin/trunk/config/app.yml
===================================================================
--- plugins/sfSympalPlugin/trunk/config/app.yml 2010-02-10 15:52:28 UTC (rev
27818)
+++ plugins/sfSympalPlugin/trunk/config/app.yml 2010-02-10 16:02:38 UTC (rev
27819)
@@ -5,6 +5,11 @@
all:
sympal_config:
+ # Configure what forms and date fields should be replaced by jQuery rich
date
+ rich_date_forms:
+ sfSympalContentForm: [date_published]
+ sfSympalMenuItemForm: [date_published]
+
# Configure the default culture
default_culture: en
Modified: plugins/sfSympalPlugin/trunk/lib/form/sfSympalForm.class.php
===================================================================
--- plugins/sfSympalPlugin/trunk/lib/form/sfSympalForm.class.php
2010-02-10 15:52:28 UTC (rev 27818)
+++ plugins/sfSympalPlugin/trunk/lib/form/sfSympalForm.class.php
2010-02-10 16:02:38 UTC (rev 27819)
@@ -77,12 +77,17 @@
sfSympalFormToolkit::changeContentWidget($form);
}
- foreach ($form as $name => $field)
+ $richDateForms = sfSympalConfig::get('rich_date_forms');
+ $formClass = get_class($form);
+ if (isset($richDateForms[$formClass]))
{
- $widget = $field->getWidget();
- if ($widget instanceof sfWidgetFormDateTime || $widget instanceof
sfWidgetFormDate)
+ foreach ($form as $name => $field)
{
- sfSympalFormToolkit::changeDateWidget($name, $form);
+ $widget = $field->getWidget();
+ if (in_array($name, $richDateForms[$formClass]) && ($widget instanceof
sfWidgetFormDateTime || $widget instanceof sfWidgetFormDate))
+ {
+ sfSympalFormToolkit::changeDateWidget($name, $form);
+ }
}
}
}
--
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.