BUGFIX Allowing to pass $context into Hierarchy->markPartialTree() and Hierarchy->markChildren()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69910 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-01-08 06:15:44 +00:00 committed by Sam Minnee
parent e25a15893e
commit 10cdb8e05c

View File

@ -69,13 +69,13 @@ class Hierarchy extends DataObjectDecorator {
* @param int $minCount The minimum amount of nodes to mark.
* @return int The actual number of nodes marked.
*/
public function markPartialTree($minCount = 30) {
public function markPartialTree($minCount = 30, $context = null) {
$this->markedNodes = array($this->owner->ID => $this->owner);
$this->owner->markUnexpanded();
// foreach can't handle an ever-growing $nodes list
while(list($id, $node) = each($this->markedNodes)) {
$this->markChildren($node);
$this->markChildren($node, $context);
if($minCount && sizeof($this->markedNodes) >= $minCount) {
break;