Author: gimler
Date: 2010-02-04 22:49:50 +0100 (Thu, 04 Feb 2010)
New Revision: 27583

Modified:
   plugins/dmCommentPlugin/lib/form/doctrine/PluginDmCommentForm.class.php
   plugins/dmCommentPlugin/modules/dmComment/templates/_form.php
Log:
[Diem][dmCommentPlugin] cleanup code

Modified: 
plugins/dmCommentPlugin/lib/form/doctrine/PluginDmCommentForm.class.php
===================================================================
--- plugins/dmCommentPlugin/lib/form/doctrine/PluginDmCommentForm.class.php     
2010-02-04 21:06:35 UTC (rev 27582)
+++ plugins/dmCommentPlugin/lib/form/doctrine/PluginDmCommentForm.class.php     
2010-02-04 21:49:50 UTC (rev 27583)
@@ -19,17 +19,19 @@
     $this->changeToHidden('record_model');
     $this->changeToHidden('record_id');
 
-    $this->widgetSchema->setLabel('author_name', 'Name');
-    $this->widgetSchema->setLabel('author_website', 'Website');
-    $this->widgetSchema->setLabel('author_email', 'Email');
-    $this->widgetSchema->setLabel('body', 'Message');
-    
+    $this->widgetSchema
+      ->setLabel('author_name', 'Name')
+      ->setLabel('author_website', 'Website')
+      ->setLabel('author_email', 'Email')
+      ->setLabel('body', 'Message')
+      ->setHelp('author_email', 'Your email will never be published');
+
+    $this->validatorSchema['author_name']
+      ->setMessage('required', 'Please enter your name');
+
     $this->validatorSchema['body']
-    ->setOption('required', true)
-    ->setMessage('required', 'Please enter a message');
+      ->setMessage('required', 'Please enter a message');
 
-    $this->widgetSchema->setHelp('author_email', 'Your email will never be 
published');
-
     $this->changeToEmail('author_email');
 
     if ($this->isCaptchaEnabled())
@@ -53,4 +55,4 @@
   {
     return sfConfig::get('app_recaptcha_enabled');
   }
-}
\ No newline at end of file
+}

Modified: plugins/dmCommentPlugin/modules/dmComment/templates/_form.php
===================================================================
--- plugins/dmCommentPlugin/modules/dmComment/templates/_form.php       
2010-02-04 21:06:35 UTC (rev 27582)
+++ plugins/dmCommentPlugin/modules/dmComment/templates/_form.php       
2010-02-04 21:49:50 UTC (rev 27583)
@@ -19,7 +19,7 @@
 // same with email, plus a help message
 echo $form['author_email']->label()->field()->help()->error();
 
-echo $form['body']->label('Your message')->field()->error();
+echo $form['body']->label()->field()->error();
 
 // render captcha if enabled
 if($form->isCaptchaEnabled())
@@ -33,4 +33,4 @@
 echo _tag('div.submit_wrap', $form->submit('Send'));
 
 // close the form tag
-echo $form->close();  
\ No newline at end of file
+echo $form->close();  

-- 
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