mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
API CHANGE: Added numChildrenMethod argument to LeftAndMain::getSiteTreeFor()
BUGFIX: Use the correct numChildrenMethod when showing the 'all children, including deleted' tree (from r91166) (from r96809) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102474 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cbe7f13e89
commit
480d5068d1
@ -253,9 +253,9 @@ HTML;
|
|||||||
return $this->getSiteTreeFor($this->stat('tree_class'), null, 'ChildFolders');
|
return $this->getSiteTreeFor($this->stat('tree_class'), null, 'ChildFolders');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
||||||
if (!$childrenMethod) $childrenMethod = 'ChildFolders';
|
if (!$childrenMethod) $childrenMethod = 'ChildFolders';
|
||||||
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $filterFunction, $minNodeCount);
|
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $numChildrenMethod, $filterFunction, $minNodeCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCMSTreeTitle() {
|
public function getCMSTreeTitle() {
|
||||||
|
@ -475,9 +475,10 @@ class LeftAndMain extends Controller {
|
|||||||
* Children, AllChildrenIncludingDeleted, or AllHistoricalChildren
|
* Children, AllChildrenIncludingDeleted, or AllHistoricalChildren
|
||||||
* @return String Nested <ul> list with links to each page
|
* @return String Nested <ul> list with links to each page
|
||||||
*/
|
*/
|
||||||
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
||||||
// Default childrenMethod
|
// Default childrenMethod and numChildrenMethod
|
||||||
if (!$childrenMethod) $childrenMethod = 'AllChildrenIncludingDeleted';
|
if (!$childrenMethod) $childrenMethod = 'AllChildrenIncludingDeleted';
|
||||||
|
if (!$numChildrenMethod) $numChildrenMethod = 'numChildren';
|
||||||
|
|
||||||
// Get the tree root
|
// Get the tree root
|
||||||
$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
|
$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
|
||||||
@ -485,7 +486,7 @@ class LeftAndMain extends Controller {
|
|||||||
// Mark the nodes of the tree to return
|
// Mark the nodes of the tree to return
|
||||||
if ($filterFunction) $obj->setMarkingFilterFunction($filterFunction);
|
if ($filterFunction) $obj->setMarkingFilterFunction($filterFunction);
|
||||||
|
|
||||||
$obj->markPartialTree($minNodeCount, $this, $childrenMethod);
|
$obj->markPartialTree($minNodeCount, $this, $childrenMethod, $numChildrenMethod);
|
||||||
|
|
||||||
// Ensure current page is exposed
|
// Ensure current page is exposed
|
||||||
if($p = $this->currentPage()) $obj->markToExpose($p);
|
if($p = $this->currentPage()) $obj->markToExpose($p);
|
||||||
@ -509,6 +510,7 @@ class LeftAndMain extends Controller {
|
|||||||
$this,
|
$this,
|
||||||
true,
|
true,
|
||||||
$childrenMethod,
|
$childrenMethod,
|
||||||
|
$numChildrenMethod,
|
||||||
$minNodeCount
|
$minNodeCount
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -542,14 +544,13 @@ class LeftAndMain extends Controller {
|
|||||||
$filter = null;
|
$filter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$html = $this->getSiteTreeFor(
|
$html = $this->getSiteTreeFor(
|
||||||
$this->stat('tree_class'),
|
$this->stat('tree_class'),
|
||||||
$request->getVar('ID'),
|
$request->getVar('ID'),
|
||||||
|
($filter) ? $filter->getChildrenMethod() : null,
|
||||||
null,
|
null,
|
||||||
($filter) ? array($filter, 'isPageIncluded') : null,
|
($filter) ? array($filter, 'isPageIncluded') : null,
|
||||||
$request->getVar('minNodeCount'),
|
$request->getVar('minNodeCount')
|
||||||
($filter) ? $filter->getChildrenMethod() : null
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Trim off the outer tag
|
// Trim off the outer tag
|
||||||
|
@ -330,9 +330,9 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
|
||||||
if (!$childrenMethod) $childrenMethod = 'stageChildren';
|
if (!$childrenMethod) $childrenMethod = 'stageChildren';
|
||||||
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $filterFunction, $minNodeCount);
|
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $numChildrenMethod, $filterFunction, $minNodeCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCMSTreeTitle() {
|
function getCMSTreeTitle() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user