Author: sid.gbf
Date: 2010-04-15 16:48:01 +0200 (Thu, 15 Apr 2010)
New Revision: 29161

Modified:
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/parts/deleteAction.php
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_actions.php
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
   
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/generator/sfjQueryDoctrineModelGeneratorHelper.class.php
Log:
Fixes para os conteudos e conteudos relacionados

Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/parts/deleteAction.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/parts/deleteAction.php
       2010-04-15 09:37:26 UTC (rev 29160)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/parts/deleteAction.php
       2010-04-15 14:48:01 UTC (rev 29161)
@@ -4,11 +4,19 @@
 
     $this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', 
array('object' => $this->getRoute()->getObject())));
 
-    if ($this->getRoute()->getObject()->delete())
+    $object = $this->getRoute()->getObject();
+
+    if ($object->delete())
     {
       $this->getUser()->setFlash('notice', 'The item was deleted 
successfully.');
     }
-
+    if($object->getRootId()) {
+      if($request->getParameter('culture', false)) {
+        $this->redirect(array('sf_route' => '<?php echo 
$this->getUrlForAction('edit') ?>', 'sf_subject' => $object->getRoot(), 
'culture' => $request->getParameter('culture')));
+      } else {
+        $this->redirect(array('sf_route' => '<?php echo 
$this->getUrlForAction('edit') ?>', 'sf_subject' => $object->getRoot()));
+      }
+    }
     if($request->getParameter('culture', false)) {
       $this->redirect('@<?php echo $this->getUrlForAction('list') 
?>?culture='.$request->getParameter('culture'));
     }

Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_actions.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_actions.php
 2010-04-15 09:37:26 UTC (rev 29160)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_actions.php
 2010-04-15 14:48:01 UTC (rev 29161)
@@ -10,7 +10,7 @@
   <?php echo $this->addCredentialCondition('[?php echo 
$helper->linkToDelete($form->getObject(), '.$this->asPhp($params).') ?]', 
$params) ?>
 
 <?php elseif ('_list' == $name): ?>
-  <?php echo $this->addCredentialCondition('[?php echo 
$helper->linkToList('.$this->asPhp($params).') ?]', $params) ?>
+  <?php echo $this->addCredentialCondition('[?php echo 
$helper->linkToList('.$this->asPhp($params).', $form->getObject()) ?]', 
$params) ?>
 
 <?php elseif ('_save' == $name): ?>
   <?php echo $this->addCredentialCondition('[?php echo 
$helper->linkToSave($form->getObject(), '.$this->asPhp($params).') ?]', 
$params) ?>

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-15 09:37:26 UTC (rev 29160)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/data/generator/sfDoctrineModule/javascript/template/templates/_form_field.php
   2010-04-15 14:48:01 UTC (rev 29161)
@@ -24,13 +24,13 @@
   <div class="[?php echo $class ?][?php $form[$name]->hasError() and print ' 
errors' ?]">
     [?php $placeholder = 
$form[$name]->getWidget()->getAttribute('placeholder'); ?]
     [?php $help = $form[$name]->getWidget()->getAttribute('help'); ?]
-    [?php if (!$help): ?]
+    [?php if ($help === null): ?]
       [?php if ($form[$name]->renderHelp()): ?]
         [?php $help = fix_help($form[$name]->renderHelp()); ?]
       [?php else: ?]
         [?php $help = '<em>'.getDefaultHint().'</em>'; ?]
       [?php endif; ?]
-    [?php else: ?]
+    [?php elseif($help): ?]
       [?php $help = '<em>'.__($help).'</em>'; ?]
     [?php endif; ?]
     [?php if(!$placeholder): ?]
@@ -55,6 +55,10 @@
           [?php if ($help): ?]
             <div class="help">[?php echo $help ?]</div>
           [?php endif; ?]
+
+          [?php if ($form[$name]->getWidget()->getAttribute('extra_options')): 
?]
+            <div class="extra_options">[?php echo 
$form[$name]->getWidget()->getAttribute('extra_options') ?]</div>
+          [?php endif; ?]
       </div>
     </div>
   </div>

Modified: 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/generator/sfjQueryDoctrineModelGeneratorHelper.class.php
===================================================================
--- 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/generator/sfjQueryDoctrineModelGeneratorHelper.class.php
    2010-04-15 09:37:26 UTC (rev 29160)
+++ 
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/generator/sfjQueryDoctrineModelGeneratorHelper.class.php
    2010-04-15 14:48:01 UTC (rev 29161)
@@ -52,8 +52,13 @@
     return '<li class="sf_admin_action_delete">'.link_to(__($params['label'], 
array(), 'sf_admin'), $this->getUrlForAction('delete'), 
$this->getCultureArray(array('sf_subject' => $object)), array('method' => 
'delete', 'confirm' => !empty($params['confirm']) ? __($params['confirm'], 
array(), 'sf_admin') : $params['confirm'])).'</li>';
   }
 
-  public function linkToList($params)
+  public function linkToList($params, $object = null)
   {
+    if($object) {
+      if($object->getRootId()) {
+        return '<li 
class="sf_admin_action_list">'.link_to(__($params['label'], array(), 
'sf_admin'), $this->getUrlForAction('edit'), 
$this->getCultureArray(array('sf_subject' => $object->getRoot()))).'</li>';
+      }
+    }
     return '<li class="sf_admin_action_list">'.link_to(__($params['label'], 
array(), 'sf_admin'), '@'.$this->getUrlForAction('list')).'</li>';
   }
 

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