Author: michkinn
Date: 2010-01-15 16:31:10 +0100 (Fri, 15 Jan 2010)
New Revision: 26682

Modified:
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
Log:
Add jsTree Cookie plugin.

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   2010-01-15 15:28:37 UTC (rev 26681)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/lib/helper/sfJqueryTreeDoctrineHelper.php
   2010-01-15 15:31:10 UTC (rev 26682)
@@ -4,6 +4,8 @@
         
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');
+                               
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/lib/jquery.cookie.js');
         
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/jquery.tree.min.js');
+                               
sfContext::getInstance()->getResponse()->addJavascript('/sfJqueryTreeDoctrineManagerPlugin/jsTree/plugins/jquery.tree.cookie.js');
         return get_component('sfJqueryTreeDoctrineManager', 'manager', 
array('model' => $model, 'field' => $field, 'root' => $root));
     }
\ No newline at end of file

Modified: 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
===================================================================
--- 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
  2010-01-15 15:28:37 UTC (rev 26681)
+++ 
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
  2010-01-15 15:31:10 UTC (rev 26682)
@@ -6,7 +6,7 @@
             <?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">
+            <li id ="phtml_<?php echo $record->id ?>">
                 <a href="#"><ins>&nbsp;</ins><?php echo $record->$field;?></a> 
             <?php $prevLevel = $record->getNode()->getLevel();
         endforeach; ?>        
@@ -16,7 +16,11 @@
 <?php echo javascript_tag();?>
 $(function () {
        $("#<?php echo strtolower($model);?>-nested-set").tree({
-       callback: {// activate add and delete node button
+       plugins : { 
+                       cookie : { prefix : "<?php echo 
strtolower($model);?>_jstree_" }
+               },
+               
+               callback: {// activate add and delete node button
                        onchange: function(){ 
$('.nodeinteraction').attr('disabled','');},
       
                        onrename : function (NODE, TREE_OBJ, RB) {

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