Development

Changeset 4993

You must first sign up to be able to contribute.

Changeset 4993

Show
Ignore:
Timestamp:
09/07/07 09:03:04 (6 years ago)
Author:
mahono
Message:

little fix to avoid error on empty trees

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrineNestedSetManagerPlugin/modules/sfNestedSetManager/templates/_nested_set_list.php

    r4692 r4993  
    22<?php $update = $model.'_nested_set_manager_holder'; ?> 
    33 
    4 <?php if( isset($records) && $records->count() > 0 ): ?> 
     4<?php if( isset($records) && is_object($records) && $records->count() > 0 ): ?> 
    55  <ul class="nested_set_list"> 
    66  <?php foreach($records AS $record): ?> 
    77    <li> 
    8       <div class="main_element">        
     8      <div class="main_element"> 
    99        <div style="margin-left: <?php echo $record->getNode()->getLevel() * 10; ?>px;" id="<?php echo $record->getId(); ?>_field" class="field"> 
    1010          <?php echo get_partial('sfNestedSetManager/edit_field', array('record' => $record, 'field' => $field, 'model' => $model, 'root' => $root)); ?> 
     
    1414      <div class="links"> 
    1515        <?php echo link_to_remote('add child', array('url' => 'sfNestedSetManager/add_child?root='.$root.'&field='.$field.'&model='.$model.'&parent_id='.$record->getId(), 'update' => $update)); ?> 
    16          
     16 
    1717        / <?php echo link_to_remote('delete', array('url' => 'sfNestedSetManager/delete?root='.$root.'&field='.$field.'&model='.$model.'&id='.$record->getId(), 'update' => $update, 'confirm' => 'Are you sure you wish to delete this record?')); ?> 
    18          
     18 
    1919        <?php if( $record->getNode()->hasPrevSibling() ): ?> 
    2020          / <?php echo link_to_remote('move up', array('url' => 'sfNestedSetManager/move?direction=up&root='.$root.'&field='.$field.'&model='.$model.'&id='.$record->getId(), 'update' => $update)); ?> 
    2121        <?php endif; ?> 
    22          
     22 
    2323        <?php if( $record->getNode()->hasNextSibling() ): ?> 
    2424          / <?php echo link_to_remote('move down', array('url' => 'sfNestedSetManager/move?direction=down&root='.$root.'&field='.$field.'&model='.$model.'&id='.$record->getId(), 'update' => $update)); ?> 
    2525        <?php endif; ?> 
    26          
     26 
    2727        <?php if( $record->getNode()->getLevel() > 0 ): ?> 
    2828          / <?php echo link_to_remote('move', array('url' => 'sfNestedSetManager/move_to?root='.$root.'&field='.$field.'&model='.$model.'&id='.$record->getId(), 'update' => $record->getId().'_field')); ?>