Author: sid.gbf
Date: 2010-03-17 20:42:53 +0100 (Wed, 17 Mar 2010)
New Revision: 28589

Modified:
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
Log:


Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
    2010-03-17 19:36:19 UTC (rev 28588)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
    2010-03-17 19:42:53 UTC (rev 28589)
@@ -10,7 +10,17 @@
       $class = $field->getWidget()->getOption('model');
       $value = Doctrine::getTable($class)->findOneBy('id', $field->getValue());
     } else if($field->getValue()) {
-      $value = $field->getValue();
+      switch($field->getWidget()->getOption('type')) {
+        case 'checkbox': {
+          $value = ($field->getValue())?__('Sim'):__('Não');
+          break;
+        }
+        default: {
+          $value = $field->getValue();
+          break;
+        }
+      }
+      
     } else if($help) {
       $value = $help;
     }
@@ -48,6 +58,7 @@
     $command = '';
     $type = 
(!is_null($field->getWidget()->getOption('type')))?$field->getWidget()->getOption('type'):get_class($field->getWidget());
     switch($type) {
+      case 'checkbox':
       case 'sfWidgetFormDoctrineChoice': {
         $command .= '    jQuery("#'.$field->renderId().'").change( function() 
{ reset_function(); update_values("#'.$field->renderId().'", 
"#'.$field->renderId().'") } );' . "\r\n";
         break;

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