Ignore:
Timestamp:
Apr 13, 2006 12:00:40 AM (18 years ago)
Author:
scdev
Message:

Q - Complete rebuild of PEdit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Hierarchy.inc.php

    r91 r92  
    677677     * @return array  Details of from the node table of all nodes below the
    678678     *                specified node: (type, id, title, indent level, selected status)
    679      *
    680      * FIX ME: $include_curr doesn't work because the current node will break with an infinite loop.
    681679     */
    682680    function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
     
    709707            for ($i=0; $i<$num_children; $i++) {
    710708
    711                 $row = $my_children[$i];
    712709                // Preventing circular references.
    713                 if ($row['child_type'] == $child_type && $row['child_id'] == $child_id) {
    714                     App::logMsg(sprintf(_("Circular reference detected: %s has itself as a parent."), $this->toStringID($row['child_type'], $row['child_id'])), LOG_ERR, __FILE__, __LINE__);
     710                if ($my_children[$i]['child_type'] == $child_type && $my_children[$i]['child_id'] == $child_id && !($_return_flag && $include_curr)) {
     711                    App::logMsg(sprintf(_("Circular reference detected: %s has itself as a parent."), $this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])), LOG_ERR, __FILE__, __LINE__);
    715712                    continue;
    716713                }
    717                 $row['indent'] = $_indent;
    718                 if (in_array($this->toStringID($row['child_type'], $row['child_id']), $preselected)) {
    719                     $row['selected'] = true;
     714
     715                $my_children[$i]['indent'] = $_indent;
     716                if (in_array($this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id']), $preselected)) {
     717                    $my_children[$i]['selected'] = true;
    720718                }
    721                 $output[] = $row;
    722                 unset($row);
    723 
    724                 // This is so we test if each node is a string only once. We store the result in the is_a_leaf array statically.
     719                $output[] = $my_children[$i];
     720
     721                // Test if each node is a string only once. Store the result in the is_a_leaf array statically.
    725722                if (!isset($is_a_leaf[$this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])])) {
    726723                    $is_a_leaf[$this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])] = $this->isLeaf($my_children[$i]['child_type'], $my_children[$i]['child_id']);
Note: See TracChangeset for help on using the changeset viewer.