Author: michkinn
Date: 2010-01-15 00:15:56 +0100 (Fri, 15 Jan 2010)
New Revision: 26659
Added:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_no_root.php
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_tree.php
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_roots.php
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_tree.php
Log:
Adding multi root support
resolve rename bug
Added:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_no_root.php
===================================================================
---
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_no_root.php
(rev 0)
+++
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_no_root.php
2010-01-14 23:15:56 UTC (rev 26659)
@@ -0,0 +1,23 @@
+<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();?>
\ No newline at end of file
Added:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_tree.php
===================================================================
---
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_tree.php
(rev 0)
+++
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_list_actions_tree.php
2010-01-14 23:15:56 UTC (rev 26659)
@@ -0,0 +1,55 @@
+<ul class="sf_admin_actions">
+ <?php if($hasManyRoots):?>
+ <li class="sf_admin_action_list">
+ <?php echo link_to( __('Back to root list')
,$sf_request->getParameter('module') . '/' .
$sf_request->getParameter('action') );?>
+ <?php endif;?>
+ <li class="sf_admin_action_insert_node">
+ <button disabled="disabled" class="nodeinteraction createnode">
+ <img alt=""
src="/sfJqueryTreeDoctrineManagerPlugin/images/node-insert-next.png"/><?php
echo __('Insert Node');?>
+ </button>
+ </li>
+ <li class="sf_admin_action_delete_node">
+ <button disabled="disabled" class="nodeinteraction deletenode">
+ <img alt=""
src="/sfJqueryTreeDoctrineManagerPlugin/images/node-delete-next.png"/><?php
echo __('Delete Node');?>
+ </button>
+ </li>
+</ul>
+
+
+
+
+
+
+
+
+
+<?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();?>
\ No newline at end of file
Added:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_roots.php
===================================================================
---
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_roots.php
(rev 0)
+++
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_roots.php
2010-01-14 23:15:56 UTC (rev 26659)
@@ -0,0 +1,44 @@
+<div class="sf_admin_list">
+ <?php if (!$roots->count()): ?>
+ <p><?php echo __('No root', array(), 'sf_admin') ?></p>
+ <?php else: ?>
+ <table cellspacing="0">
+ <thead>
+ <tr>
+ <th id="sf_admin_text sf_admin_list_th_<?php echo
strtolower($model);?>"><?php echo ucfirst($field);?> </th>
+ <th id="sf_admin_list_th_actions"><?php echo __('Actions', array(),
'sf_admin') ?></th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <th colspan="2"> <?php echo $roots->count() ;?>
<?php echo __('Roots');?></th>
+ </tr>
+ </tfoot>
+
+
+ <tbody>
+ <?php foreach ($roots as $i => $root): $odd = fmod(++$i, 2) ? 'odd' :
'even' ?>
+ <tr class="sf_admin_row <?php echo $odd ?>">
+ <td class="sf_admin_text sf_admin_list_td_<?php echo $field ?>">
+ <?php echo $root->$field ?>
+ </td>
+
+ <td>
+ <ul
class="sf_admin_td_actions">
+ <li
class="sf_admin_action_edit"><?php echo link_to( __('Manage Tree')
,$sf_request->getParameter('module') . '/' .
$sf_request->getParameter('action') . '?root=' . $root->id);?></li> </ul>
+
+ </td>
+
+
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <?php endif; ?>
+</div>
+
+<div class="sf_admin_actions">
+ <?php include_partial('sfJqueryTreeDoctrineManager/list_batch_actions') ?>
+ <?php
include_partial('sfJqueryTreeDoctrineManager/list_actions_no_root',
array('model' => $model, 'field' => $field, 'root' => $root)) ?>
+</div>
\ No newline at end of file
Added:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_tree.php
===================================================================
---
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_tree.php
(rev 0)
+++
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_manager_tree.php
2010-01-14 23:15:56 UTC (rev 26659)
@@ -0,0 +1,10 @@
+<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"> </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, 'hasManyRoots' => $hasManyRoots)); ?>
+</div>
\ No newline at end of file
--
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.