mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Fixed parameters in CMSMain->getfilteredsubtree()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92723 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
44e16b9620
commit
49ff1648bd
@ -138,13 +138,13 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getfilteredsubtree($request) {
|
public function getfilteredsubtree($data, $form) {
|
||||||
$params = $form->getData();
|
$params = $form->getData();
|
||||||
|
|
||||||
// Get the tree
|
// Get the tree
|
||||||
$tree = $this->getSiteTreeFor(
|
$tree = $this->getSiteTreeFor(
|
||||||
$this->stat('tree_class'),
|
$this->stat('tree_class'),
|
||||||
$request->requestVar('ID'),
|
$data['ID'],
|
||||||
null,
|
null,
|
||||||
array(new CMSMainMarkingFilter($params), 'mark')
|
array(new CMSMainMarkingFilter($params), 'mark')
|
||||||
);
|
);
|
||||||
@ -155,29 +155,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of batch actions
|
|
||||||
*/
|
|
||||||
function SiteTreeFilters() {
|
|
||||||
$filters = ClassInfo::subclassesFor('CMSSiteTreeFilter');
|
|
||||||
array_shift($filters);
|
|
||||||
$doSet = new DataObjectSet();
|
|
||||||
$doSet->push(new ArrayData(array(
|
|
||||||
'ClassName' => 'all',
|
|
||||||
'Title' => 'All items'
|
|
||||||
)));
|
|
||||||
foreach($filters as $filter) {
|
|
||||||
if (call_user_func(array($filter, 'showInList'))) {
|
|
||||||
$doSet->push(new ArrayData(array(
|
|
||||||
'ClassName' => $filter,
|
|
||||||
'Title' => call_user_func(array($filter, 'title'))
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $doSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function generateDataTreeHints() {
|
public function generateDataTreeHints() {
|
||||||
$classes = ClassInfo::subclassesFor( $this->stat('tree_class') );
|
$classes = ClassInfo::subclassesFor( $this->stat('tree_class') );
|
||||||
|
|
||||||
@ -1059,6 +1037,18 @@ JS;
|
|||||||
array_unshift($pageTypes, 'All');
|
array_unshift($pageTypes, 'All');
|
||||||
$pageTypes = array_combine($pageTypes, $pageTypes);
|
$pageTypes = array_combine($pageTypes, $pageTypes);
|
||||||
asort($pageTypes);
|
asort($pageTypes);
|
||||||
|
|
||||||
|
// get all filter instances
|
||||||
|
$filters = ClassInfo::subclassesFor('CMSSiteTreeFilter');
|
||||||
|
$filterMap = array();
|
||||||
|
// remove base class
|
||||||
|
array_shift($filters);
|
||||||
|
// add filters to map
|
||||||
|
foreach($filters as $filter) {
|
||||||
|
if(!call_user_func(array($filter, 'showInList'))) continue;
|
||||||
|
|
||||||
|
$filterMap[$filter] = call_user_func(array($filter, 'title'));
|
||||||
|
}
|
||||||
|
|
||||||
$form = new Form(
|
$form = new Form(
|
||||||
$this,
|
$this,
|
||||||
@ -1068,9 +1058,10 @@ JS;
|
|||||||
'Title',
|
'Title',
|
||||||
_t('CMSMain.TITLEOPT', 'Title')
|
_t('CMSMain.TITLEOPT', 'Title')
|
||||||
),
|
),
|
||||||
|
new DropdownField('filter', 'Type', $filterMap, null, null, 'Any'),
|
||||||
new TextField('Content', 'Text'),
|
new TextField('Content', 'Text'),
|
||||||
new CalendarDateField('EditedSince', _t('CMSMain_left.ss.EDITEDSINCE','Edited Since')),
|
new CalendarDateField('EditedSince', _t('CMSMain_left.ss.EDITEDSINCE','Edited Since')),
|
||||||
new DropdownField('ClassName', 'Page Type', $pageTypes, null, 'Any'),
|
new DropdownField('ClassName', 'Page Type', $pageTypes, null, null, 'Any'),
|
||||||
new TextField(
|
new TextField(
|
||||||
'MenuTitle',
|
'MenuTitle',
|
||||||
_t('CMSMain.MENUTITLEOPT', 'Navigation Label')
|
_t('CMSMain.MENUTITLEOPT', 'Navigation Label')
|
||||||
|
Loading…
Reference in New Issue
Block a user