Author: michkinn
Date: 2010-01-15 00:15:25 +0100 (Fri, 15 Jan 2010)
New Revision: 26658

Modified:
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/actions.class.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/components.class.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/jsonSuccess.php
   plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/web/css/screen.css
Log:
Adding multi root support
resolve rename bug

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,5 +1,6 @@
 <?php
-    function get_nested_set_manager($model, $field, $root = 0){
+    
+               function get_nested_set_manager($model, $field, $root = 0){
         
sfContext::getInstance()->getResponse()->addStylesheet('/sfJqueryTreeDoctrineManagerPlugin/jsTree/themes/default/style.css');
         
sfContext::getInstance()->getResponse()->addStylesheet('/sfJqueryTreeDoctrineManagerPlugin/css/screen.css');
         
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/lib/jquery.js');

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/actions.class.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/actions.class.php
       2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/actions.class.php
       2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,24 +1,122 @@
 <?php
 
-/*
- * This file is part of the symfony package.
- * (c) 2004-2006 Fabien Potencier <[email protected]>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
 
-require_once(dirname(__FILE__).'/../lib/BasesfJqueryTreeDoctrineManagerActions.class.php');
-
 /**
- * sfJqueryTreeDoctrineManager actions.
+ * sfJsTreeDoctrine actions.
  * 
- * @package    symfony
- * @subpackage plugin
- * @author     Gregory Schurgast <[email protected]>
- * @author     Gordon Franke <[email protected]>
- * @version    SVN: $Id: BasesfGuardForgotPasswordActions.class.php 18401 
2009-05-18 14:12:09Z gimler $
+ * @package    sfJsTreeDoctrinePlugin
+ * @subpackage sfJsTreeDoctrine
+ * @author     Your name here
+ * @version    SVN: $Id: actions.class.php 12534 2008-11-01 13:38:27Z 
Kris.Wallsmith $
  */
-class sfJqueryTreeDoctrineManagerActions extends 
BasesfJqueryTreeDoctrineManagerActions
+class sfJqueryTreeDoctrineManagerActions extends sfActions
 {
+
+
+
+  public function getTree($model, $rootId = 0)
+  {
+    if( $rootId )
+    {
+      $root = Doctrine_Core::getTable($model)->getTree()->findRoot($rootId);
+      return 
Doctrine_Core::getTable($model)->getTree()->fetchBranch($root->getId()); 
+    } else {
+      return Doctrine_Core::getTable($model)->getTree()->fetchTree();
+    }
+  }
+
+  public function executeAdd_child()
+  {
+    $parent_id = $this->getRequestParameter('parent_id');
+    $model = $this->getRequestParameter('model');
+    $field = $this->getRequestParameter('field');
+    $value = $this->getRequestParameter('value');
+    $record = Doctrine_Core::getTable($model)->find($parent_id);
+
+    $child = new $model;
+    $child->set($field, $value);
+    $record->getNode()->addChild($child);
+    
+    $this->json = json_encode($child->toArray());
+    
+    $this->getResponse()->setHttpHeader('Content-type', 'application/json');
+    $this->setTemplate('json');
+  }
+  
+  public function executeAdd_root()
+  {
+    $model = $this->getRequestParameter('model');
+    $data = $this->getRequestParameter( strtolower($model) );
+    $tree = $this->getTree($model);
+
+    $root = new $model;
+    $root->synchronizeWithArray( $data );
+               $root->save();
+               
+    Doctrine_Core::getTable($model)->getTree()->createRoot($root);
+    $this->records = $this->getTree($model);
+    return sfView::NONE;
+  }
+
+  public function executeEdit_field()
+  {
+    $id = $this->getRequestParameter('id');
+    $model = $this->getRequestParameter('model');
+    $field = $this->getRequestParameter('field');
+    $value = $this->getRequestParameter('value');
+
+    $record = Doctrine_Core::getTable($model)->find($id);
+    $record->set($field, $value);
+    $record->save();
+
+    $this->json = json_encode($record->toArray());
+    
+    $this->getResponse()->setHttpHeader('Content-type', 'application/json');
+    $this->setTemplate('json');
+  }
+
+  public function executeDelete()
+  {
+    $id = $this->getRequestParameter('id');
+    $model = $this->getRequestParameter('model');
+    
+    $record = Doctrine_Core::getTable($model)->find($id);
+    $record->getNode()->delete();
+    $this->json = json_encode(array());
+    $this->getResponse()->setHttpHeader('Content-type', 'application/json');
+    $this->setTemplate('json');
+    
+  }
+
+  public function executeMove()
+  {
+    $id = $this->getRequestParameter('id');
+    $to_id = $this->getRequestParameter('to_id');
+    $model = $this->getRequestParameter('model');
+    $movetype = $this->getRequestParameter('movetype');
+    
+    $record = Doctrine_Core::getTable($model)->find($id);
+    $dest = Doctrine_Core::getTable($model)->find($to_id);
+    
+    if( $movetype == 'inside' )
+    {
+      //$prev = $record->getNode()->getPrevSibling();
+      $record->getNode()->moveAsLastChildOf($dest);
+    }
+    else if( $movetype == 'after' )
+    {
+      $record->getNode()->moveAsNextSiblingOf($dest);
+    }
+    
+    else if( $movetype == 'before' )
+    {
+      //$next = $record->getNode()->getNextSibling();
+      $record->getNode()->moveAsPrevSiblingOf($dest);
+    }
+    $this->json = json_encode($record->toArray());
+    $this->getResponse()->setHttpHeader('Content-type', 'application/json');
+    $this->setTemplate('json');
+  }
+
+ 
 }

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/components.class.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/components.class.php
    2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/actions/components.class.php
    2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,24 +1,75 @@
 <?php
 
-/*
- * This file is part of the symfony package.
- * (c) 2004-2006 Fabien Potencier <[email protected]>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
 
-require_once(dirname(__FILE__).'/../lib/BasesfJqueryTreeDoctrineManagerComponents.class.php');
+class sfJqueryTreeDoctrineManagerComponents extends sfComponents
+{
+  
+       public function executeManager(){
+               $this->options = $this->getModelOptions();
+               $this->hasManyRoots = $this->modelHasManyRoots();
+               if ($this->records = $this->executeControl()){
+                       $request = $this->getRequest();
+                       
+                       if (  !$request->hasParameter('root') && 
!$this->modelHasManyRoots() ){
+                               $this->getController()->redirect(url_for(  
$request->getParameter('module') . '/'. $request->getParameter('action') 
.'?root=1'), true);
+                               return sfView::NONE;
+                       }
+                       elseif ( !$request->hasParameter('root') && 
$this->modelHasManyRoots() ){
+                               $this->roots = $this->getRoots( $this->model );
+                       }
+                       else{
+                               $this->records = $this->getTree($this->model, 
$request->getParameter('root'));
+                       }
+                       
+                       
+                       
+               }
+       }
 
-/**
- * sfJqueryTreeDoctrineManager components.
- *
- * @package    symfony
- * @subpackage plugin
- * @author     Gregory Schurgast <[email protected]>
- * @author     Gordon Franke <[email protected]>
- * @version    SVN: $Id: BasesfGuardAuthActions.class.php 7745 2008-03-05 
11:05:33Z fabien $
- */
-class sfJqueryTreeDoctrineManagerComponents extends 
BasesfJqueryTreeDoctrineManagerComponents
-{
+
+       private function executeControl(){
+               if ( !$this->modelIsNestedSet() ){
+                       throw new Exception('Model "'.$this->model.'" is not a 
NestedSet');
+                       return false;
+               }
+               return true;            
+       }
+       
+       
+       
+       private function getRoots($model){
+               $tree = Doctrine_Core::getTable($model)->getTree();
+    return $tree->fetchRoots();
+  }
+       
+       
+        private function getTree($model, $rootId = 0){
+               $tree = Doctrine_Core::getTable($model)->getTree();
+    if( $rootId ){
+                       $root = $tree->fetchRoot($rootId);
+                       return $root ? $tree->fetchBranch($root->getId()) : 
false; 
+    } else {
+      return $tree->fetchTree();
+    }
+  }
+       
+       /*
+        * Return the options of the model
+        */
+       private function getModelOptions(){
+               $model = $this->model;
+               $record = new $model;
+               return $record->getOptions();
+       }
+       
+       private function modelIsNestedSet(){
+               return $this->options['treeImpl'] == 'NestedSet';
+       }
+       
+       private function modelHasManyRoots(){
+               return isset($this->options['treeOptions']['hasManyRoots']) && 
$this->options['treeOptions']['hasManyRoots'];
+       }
+       
+       
+
 }
\ No newline at end of file

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions.php
     2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions.php
     2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,71 +1,5 @@
 <?php if (!$records) :?>
-<div>
-    <form id="<?php echo strtolower($model);?>_root_create" action="<?php echo 
url_for('sfJqueryTreeDoctrineManager/Add_root');?>" method="post">
-        <label for="<?php echo strtolower($model);?>_<?php echo 
$field;?>"><?php echo ucfirst($field);?> : </label>
-        <input type="text" id="<?php echo strtolower($model);?>_<?php echo 
$field;?>" value="" name="<?php echo strtolower($model);?>[<?php echo 
$field;?>]"/>
-        <input type="hidden" name="model" value="<?php echo $model;?>"/>
-        <button type="submit">
-            <img class="actionImage" 
src="/sfJqueryTreeDoctrineManagerPlugin/images/node-insert-next.png"/><?php 
echo __('Create Root');?>
-        </button>
-    </form>
-</div>
-
-<?php echo javascript_tag();?>
-$(document).ready(function(e){
-    $('#<?php echo strtolower($model);?>_root_create').submit(function(e){
-        e.preventDefault();
-        var src = $(this).find('.actionImage').attr('src');
-        $(this).find('.actionImage').attr('src', 
'/sfJqueryTreeDoctrineManagerPlugin/css/throbber.gif');
-        $.post( $(this).attr('action'), $(this).serialize(), function(){
-            document.location.reload();
-        } );
-    });
-});
-<?php echo end_javascript_tag();?>
-
-
+       <?php 
include_partial('sfJqueryTreeDoctrineManager/list_actions_no_root', 
array('model' => $model, 'field' => $field, 'root' => $root)) ?>
 <?php else : ?>
-
-<div>
-    <button disabled="disabled" class="nodeinteraction createnode">
-        <img alt="" 
src="/sfJqueryTreeDoctrineManagerPlugin/images/node-insert-next.png"/><?php 
echo __('Insert Node');?>
-    </button>
-    
-    <button disabled="disabled" class="nodeinteraction deletenode">
-        <img alt="" 
src="/sfJqueryTreeDoctrineManagerPlugin/images/node-delete-next.png"/><?php 
echo __('Delete Node');?>
-    </button>
-</div>
-
-<?php echo javascript_tag();?>
-    $(document).ready(function(){
-
-    $('.createnode').click(function(e){
-        var t = $.tree.focused(); 
-        if(t.selected) {
-            sfJqueryTreeDoctrineManagerPluginCreateNew<?php echo $model;?> = 
true;
-            t.create();
-        } 
-        else {
-            alert("Select a node first");
-        }
-    });
-                
-    $('.deletenode').click(function(e){
-        var t = $.tree.focused(); 
-        if(t.selected) {
-           if ( t.parent(t.selected) == -1){
-            alert("<?php echo __('forbidden to remove root node');?>")
-           }else{
-            t.remove();
-            }
-        } 
-        else {
-            alert("Select a node first");
-        }
-    });
-
-    })
-<?php echo end_javascript_tag();?>
-
-
+       <?php include_partial('sfJqueryTreeDoctrineManager/list_actions_tree', 
array('model' => $model, 'field' => $field, 'root' => $root, 'hasManyRoots' => 
$hasManyRoots)) ?>
 <?php endif; ?>
\ No newline at end of file

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager.php
  2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager.php
  2010-01-14 23:15:25 UTC (rev 26658)
@@ -5,15 +5,16 @@
     <?php include_partial('sfJqueryTreeDoctrineManager/flashes') ?>
     
     
-    <div class="nested_set_manager_holder" id="<?php echo strtolower($model); 
?>_nested_set_manager_holder">
-        <?php echo get_partial('sfJqueryTreeDoctrineManager/nested_set_list', 
array('model' => $model, 'field' => $field, 'root' => $root, 'records' => 
$records)); ?>
-        <div style="clear:both">&nbsp;</div>
-    </div>
-    
-    
-    <div class="sf_admin_actions">
-      <?php include_partial('sfJqueryTreeDoctrineManager/list_batch_actions') 
?>
-      <?php include_partial('sfJqueryTreeDoctrineManager/list_actions', 
array('model' => $model, 'field' => $field, 'root' => $root, 'records' => 
$records)) ?>
-    </div>
-    
-</div>
\ No newline at end of file
+
+
+                       <?php if ($hasManyRoots && 
!$sf_request->hasParameter('root') ):?>
+                               <?php 
include_partial('sfJqueryTreeDoctrineManager/manager_roots', array('model' => 
$model, 'field' => $field, 'root' => $root, 'roots' => $roots)) ?>
+                       <?php else: ?>
+                               <?php 
include_partial('sfJqueryTreeDoctrineManager/manager_tree', array('model' => 
$model, 'field' => $field, 'root' => $root, 'records' => $records, 
'hasManyRoots' => $hasManyRoots)) ?>
+                       <?php endif;?>
+                       
+                       
+</div>
+
+
+

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
  2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
  2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,24 +1,20 @@
 <?php if( isset($records) && is_object($records) && $records->count() > 0 ): ?>
     <div id="<?php echo strtolower($model);?>-nested-set">
         <ul class="nested_set_list">
-        <?php $prevLevel = 0;?>
-        
-        <?php foreach($records AS $record): ?>
+        <?php $prevLevel = 0;?>      
+        <?php foreach($records as $record): ?>
             <?php if($prevLevel > 0 && $record->getNode()->getLevel() == 
$prevLevel)  echo '</li>';
             if($record->getNode()->getLevel() > $prevLevel)  echo '<ul>'; 
             elseif ($record->getNode()->getLevel() < $prevLevel) echo 
str_repeat('</ul></li>', $prevLevel - $record->getNode()->getLevel()); ?>
             <li id ="phtml_<?php echo $record->id ?>" class="open">
                 <a href="#"><ins>&nbsp;</ins><?php echo $record->$field;?></a> 
-            <?php $prevLevel = $record->getNode()->getLevel(); ?>
-        <?php endforeach; ?>
-
+            <?php $prevLevel = $record->getNode()->getLevel();
+        endforeach; ?>        
         </ul>
     </div>
 <?php endif;?>
-
 <?php echo javascript_tag();?>
 $(function () { 
-
     $("#<?php echo strtolower($model);?>-nested-set").tree({
         callback: {
             // activate add and delete node button
@@ -27,24 +23,24 @@
             onrename : function (NODE, TREE_OBJ, RB) {
                 $('.error').remove();
                 $('.notice').remove();
+                                                               
$('.nested_set_manager_holder').before('<div class="waiting"><?php echo 
__('Sending data to server.');?></div>');
                 if (TREE_OBJ.get_text(NODE) == 'New folder'){
                     $('.nested_set_manager_holder').before('<div 
class="error">"'+TREE_OBJ.get_text(NODE)+'" <?php echo __('is not a valid 
name');?></div>');
                     $.tree.focused().rename();
                 }
                 else {
-                    $('.nested_set_manager_holder').before('<div 
class="waiting"><?php echo __('Sending data to server.');?></div>');
                     if (NODE.id == ''){ // happen if creation of a new node
                         $.ajax({
                             type: "POST",
                             url : '<?php echo 
url_for('sfJqueryTreeDoctrineManager/Add_child');?>',
-                            dataType : 'json',
-                            data : 'model=<?php echo $model;?>&root=<?php echo 
$root;?>&field=<?php echo 
$field;?>&value='+TREE_OBJ.get_text(NODE)+'&parent_id=' + 
TREE_OBJ.parent(NODE).attr('id').replace('phtml_',''),
+                            //dataType : 'json',
+                            data : 'root=<?php echo $root;?>&model=<?php echo 
$model;?>&field=<?php echo 
$field;?>&value='+TREE_OBJ.get_text(NODE)+'&parent_id=' + 
TREE_OBJ.parent(NODE).attr('id').replace('phtml_',''),
                             complete : function(){ 
-                                $('.waiting').remove();
-                            },
-                            success : function (data, textStatus) {
+                                                                               
                                $('.waiting').remove();
+                                                                               
                          },
+                                                                               
                                success : function (data, textStatus) {
                                 $('.nested_set_manager_holder').before('<div 
class="notice"><?php echo __('The item was created successfully.');?></div>');
-                                $(NODE).attr('id','phtml_'+data.id);
+                                                                               
                                                
$(NODE).attr('id','phtml_'+data.id);
                             },
                             error : function (data, textStatus) {
                                 $('.nested_set_manager_holder').before('<div 
class="error"><?php echo __('Error while creating the item.');?></div>');
@@ -52,17 +48,20 @@
                             }
 
                         });
+                        
+                        
                     }
                     else { // happen when renaming an existing node
+                        
                         $.ajax({
                             type: "POST",
                             url : '<?php echo 
url_for('sfJqueryTreeDoctrineManager/Edit_field');?>',
-                            dataType : 'json',
-                            data : 'model=<?php echo $model;?>&field=<?php 
echo $field;?>&value='+TREE_OBJ.get_text(NODE)+'&id=' + 
NODE.id.replace('phtml_',''),
+                            //dataType : 'json',
+                            data : 'root=<?php echo $root;?>&model=<?php echo 
$model;?>&field=<?php echo $field;?>&value='+TREE_OBJ.get_text(NODE)+'&id=' + 
NODE.id.replace('phtml_',''),
                             complete : function(){ 
-                                $('.waiting').remove();
-                            },
-                            success : function (data, textStatus) {
+                                                                               
                                $('.waiting').remove();
+                                                                               
                          },
+                                                                               
                                success : function (data, textStatus) {
                                 $('.nested_set_manager_holder').before('<div 
class="notice"><?php echo __('The item was renamed successfully.');?></div>');
                             },
                             error : function (data, textStatus) {
@@ -70,30 +69,31 @@
                                 $.tree.rollback(RB);
                             }
                         });
+ 
                     }
                 }
-            },
-
+                       },
+            
             ondblclk : function (NODE, TREE_OBJ){
                 $('.error').remove();
                 $('.notice').remove();
                 $.tree.focused().rename();
             },
-
+            
             onmove: function(NODE, REF_NODE, TYPE, TREE_OBJ, RB){
                 $('.error').remove();
                 $('.notice').remove();
                 $('.nested_set_manager_holder').before('<div 
class="waiting"><?php echo __('Sending data to server.');?></div>');
-                                    
+                                                                       
                 $.ajax({
                     type: "POST",
                     url : '<?php echo 
url_for('sfJqueryTreeDoctrineManager/Move');?>',
-                    dataType : 'json',
-                    data : 'model=<?php echo $model;?>&id=' + 
NODE.id.replace('phtml_','') +'&to_id=' + REF_NODE.id.replace('phtml_','') + 
'&movetype=' + TYPE, 
+                    //dataType : 'json',
+                    data : 'root=<?php echo $root;?>&model=<?php echo 
$model;?>&id=' + NODE.id.replace('phtml_','') +'&to_id=' + 
REF_NODE.id.replace('phtml_','') + '&movetype=' + TYPE, 
                     complete : function(){ 
-                        $('.waiting').remove();
-                    },
-                    success : function (data, textStatus) {
+                                                                               
$('.waiting').remove();
+                                                                         },
+                                                                               
success : function (data, textStatus) {
                         $('.nested_set_manager_holder').before('<div 
class="notice"><?php echo __('The item was moved successfully.');?></div>');
                     },
                     error : function (data, textStatus) {
@@ -101,8 +101,12 @@
                         $.tree.rollback(RB);
                     }
                 });
+                
+                
+                
+                    
+                    
             },
-
             ondelete: function(NODE, TREE_OBJ, RB){
                 $('.error').remove();
                 $('.notice').remove();
@@ -110,12 +114,12 @@
                 $.ajax({
                     type: "POST",
                     url : '<?php echo 
url_for('sfJqueryTreeDoctrineManager/Delete');?>',
-                    dataType : 'json',
-                    data : 'model=<?php echo $model;?>&id=' + 
NODE.id.replace('phtml_','') , 
+                    //dataType : 'json',
+                    data : 'root=<?php echo $root;?>&model=<?php echo 
$model;?>&id=' + NODE.id.replace('phtml_','') , 
                     complete : function(){ 
-                        $('.waiting').remove();
-                    },
-                    success : function (data, textStatus) {
+                                                                               
$('.waiting').remove();
+                                                                         },
+                                                                               
success : function (data, textStatus) {
                         $('.nested_set_manager_holder').before('<div 
class="notice"><?php echo __('The item was deleted successfully.');?></div>');
                     },
                     error : function (data, textStatus) {

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/jsonSuccess.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/jsonSuccess.php
       2010-01-14 22:47:49 UTC (rev 26657)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/jsonSuccess.php
       2010-01-14 23:15:25 UTC (rev 26658)
@@ -1 +1 @@
-<?php echo $sf_data->getRaw('json'); ?>
\ No newline at end of file
+<?php echo $json; ?>
\ No newline at end of file

Modified: plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/web/css/screen.css
===================================================================
--- plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/web/css/screen.css  
2010-01-14 22:47:49 UTC (rev 26657)
+++ plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/web/css/screen.css  
2010-01-14 23:15:25 UTC (rev 26658)
@@ -1,4 +1,4 @@
-#sf_admin_container ul li a { padding: 0; background : none;}
+#sf_admin_container .nested_set_manager_holder ul li a { padding: 0; 
background : none;}
 
 #sf_admin_container .waiting
 {

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