Author: grifis
Date: 2010-01-21 11:46:13 +0100 (Thu, 21 Jan 2010)
New Revision: 26969
Modified:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
Log:
query optimization
Modified:
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
===================================================================
---
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
2010-01-21 10:21:00 UTC (rev 26968)
+++
plugins/sfJqueryTreeDoctrineManagerPlugin/trunk/modules/sfJqueryTreeDoctrineManager/templates/_nested_set_list.php
2010-01-21 10:46:13 UTC (rev 26969)
@@ -1,14 +1,14 @@
-<?php if( isset($records) && is_object($records) && $records->count() > 0 ): ?>
+<?php if( isset($records) && is_object($records) && count($records) > 0 ): ?>
<div id="<?php echo strtolower($model);?>-nested-set">
<ul class="nested_set_list">
<?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()); ?>
+ <?php if($prevLevel > 0 && $record['level'] == $prevLevel) echo
'</li>';
+ if($record['level'] > $prevLevel) echo '<ul>';
+ elseif ($record['level'] < $prevLevel) echo
str_repeat('</ul></li>', $prevLevel - $record['level']); ?>
<li id ="phtml_<?php echo $record->id ?>">
<a href="#"><ins> </ins><?php echo $record->$field;?></a>
- <?php $prevLevel = $record->getNode()->getLevel();
+ <?php $prevLevel = $record['level'];
endforeach; ?>
</ul>
</div>
--
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.