Author: sid.gbf
Date: 2010-04-06 22:19:56 +0200 (Tue, 06 Apr 2010)
New Revision: 29019

Modified:
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/widget/sfWidgetFormjQueryDatePicker.class.php
Log:


Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
   2010-04-06 20:19:51 UTC (rev 29018)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
   2010-04-06 20:19:56 UTC (rev 29019)
@@ -32,14 +32,16 @@
     [?php endif; ?]
     <div>
       [?php echo $form[$name]->renderLabel($label) ?]
-      <div class="content_view" id="[?php echo $form[$name]->renderId(); 
?]_view" style="display: none;">
-        <div class="help">[?php echo content_to_view($form[$name], 
($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : 
$attributes), $help) ?]&nbsp;</div>
+      <div class="content content_view" id="[?php echo 
$form[$name]->renderId(); ?]_view" style="display: none;">
+        [?php echo content_tag('a', 
image_tag('../sf/sf_admin/images/edit.png', array('align' => 'right')), 
array('id' => $form[$name]->renderId().'_open', 'href' => '')); ?]
+        <div>[?php echo content_to_view($form[$name], ($attributes instanceof 
sfOutputEscaper ? $attributes->getRawValue() : $attributes), 
$form[$name]->getWidget()->getOption('tip', '')) ?]&nbsp;</div>
       </div>
-      <div class="content_edit" id="[?php echo $form[$name]->renderId(); 
?]_edit">
-          <div class="content">[?php echo $form[$name]->render($attributes 
instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?]</div>
+      <div class="content content_edit" id="[?php echo 
$form[$name]->renderId(); ?]_edit">
+          [?php echo content_tag('a', 
image_tag('../sf/sf_admin/images/ok.png', array('align' => 'right')), 
array('id' => $form[$name]->renderId().'_close', 'href' => '')); ?]
+          <div class="contents">[?php echo $form[$name]->render($attributes 
instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?]</div>
 
           [?php if ($help): ?]
-            <div class="help">[?php echo $help ?]</div>
+            <div class="help">[?php echo fix_help($help) ?]</div>
           [?php endif; ?]
       </div>
     </div>

Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
    2010-04-06 20:19:51 UTC (rev 29018)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
    2010-04-06 20:19:56 UTC (rev 29019)
@@ -28,8 +28,14 @@
 
     return $value;
   }
+  function fix_help($value) {
+    if(is_object($value))
+      $value = $value->__toString();
+    if(substr($value, 0, 6) == '<br />')
+      $value = substr($value, 6);
+    return $value;
+  }
   function form_event_handlers($form) {
-    include_jquery();
     $command = 'jQuery(document).ready(function() { formBind(); } );'."\r\n";
     $command .= 'function formBind() {'."\r\n";
     $command .= _process_form($form);
@@ -63,45 +69,12 @@
     $fieldName = '#'.$field->renderId();
     $updateId = '#'.$field->renderId();
     $id = '#'.$field->renderId();
-    switch($type) {
-      case 'checkbox':
-      case 'file':
-      case 'sfWidgetFormjQueryDatePicker':
-      case 'sfWidgetFormSelect':
-      case 'sfWidgetFormDoctrineChoice': {
-        $function = 'change';
-        if($type == 'sfWidgetFormjQueryDatePicker')
-          $id = '#'.$field->renderId().'_temp';
 
-        break;
-      }
-      case 'sfWidgetFormTextarea':
-      case 'text': {
-        $function = 'blur';
-        break;
-      }
-      case 'fckeditor': {
-        $function = false;
-        echo javascript_tag('function FCKeditor_OnComplete(editor) { 
-  editor.Events.AttachEvent("OnBlur",
-    function(editor) {
-      jQuery("input[name=\''.$field->renderName().'\']").val(editor.GetHTML());
-
-      reset_function();
-      update_values("input[name=\''.$field->renderName().'\']", 
"#'.$field->renderId().'");
-    });
-}' . "\r\n");
-        $command .= 'jQuery("input[name=\''.$field->renderName().'\']"); //' . 
"\r\n";
-        break;
-      }
-      default: {
-        var_dump('DEBUG!');
-        var_dump($type);
-      }
+    $command .= '  jQuery("#'.$field->renderId().'_close").click( function() { 
reset_function(); update_values("'.$fieldName.'", "'.$updateId.'"); return 
false; } );' . "\r\n";
+    $command .= '  jQuery("#'.$field->renderId().'_open").click( function() { 
switch_field("'.$field->renderId().'"); return false; } );' . "\r\n";
+    if($type == 'sfWidgetFormjQueryDatePicker') {
+        $command .= '  update_values("'.$fieldName.'", "'.$updateId.'");' . 
"\r\n";
     }
-    if($function)
-      $command .= '  jQuery("'.$id.'").'.$function.'( function() { 
reset_function(); update_values("'.$fieldName.'", "'.$updateId.'") } );' . 
"\r\n";
-    $command .= '  jQuery("#'.$field->renderId().'_view").click( function() { 
switch_field("'.$field->renderId().'") } );' . "\r\n\r\n";
     return $command;
   }
   function _form_hide_fields_function() {
@@ -143,15 +116,12 @@
       newValue = jQuery(fieldName).val();
     }
   }
-  if(newValue == null || newValue == "") {
-    newValue = jQuery(fieldName+"_edit > .help").html();
-  }
-  jQuery(updateId+"_view > .help").html(newValue);
+/*  if(newValue == null || newValue == "") {
+    newValue = jQuery(fieldName+"_edit > div").html();
+  }*/
 
+  jQuery(updateId+"_view > div").html(newValue);
+
 }'."\r\n";
   }
-  function include_jquery() {
-    $jquery = sfConfig::get('app_jquery_path', '/jquery.js');
-    use_javascript($jquery);
-  }
 ?>

Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/widget/sfWidgetFormjQueryDatePicker.class.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/widget/sfWidgetFormjQueryDatePicker.class.php
       2010-04-06 20:19:51 UTC (rev 29018)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/widget/sfWidgetFormjQueryDatePicker.class.php
       2010-04-06 20:19:56 UTC (rev 29019)
@@ -179,7 +179,7 @@
     }
     public function getJavaScripts() {
       $array = parent::getJavaScripts();
-      $array[] = 'jquery.ui.datepicker.min.js';
+      $array[] = 
'../sfJqueryReloadedPlugin/js/i18n/ui.datepicker-'.$this->getOption('culture').'.js';
       return $array;
     }
     public function getStylesheets() {

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