Changeset 92 for trunk/lib/Hierarchy.inc.php
- Timestamp:
- Apr 13, 2006 12:00:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Hierarchy.inc.php
r91 r92 677 677 * @return array Details of from the node table of all nodes below the 678 678 * 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.681 679 */ 682 680 function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true) … … 709 707 for ($i=0; $i<$num_children; $i++) { 710 708 711 $row = $my_children[$i];712 709 // 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__); 715 712 continue; 716 713 } 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; 720 718 } 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. 725 722 if (!isset($is_a_leaf[$this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])])) { 726 723 $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.