MINOR Making page drop down searchable on CMS add form, and ensuring that the default page option is showing first

This commit is contained in:
Ingo Schommer 2012-01-05 13:45:07 +01:00
parent bb7edf8bfd
commit 167bc045fe

View File

@ -1061,6 +1061,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
); );
$pageTypes[$type->getField('ClassName')] = $html; $pageTypes[$type->getField('ClassName')] = $html;
} }
// Ensure generic page type shows on top
if(isset($pageTypes['Page'])) {
$pageTitle = $pageTypes['Page'];
$pageTypes = array_merge(array('Page' => $pageTitle), $pageTypes);
}
$numericLabelTmpl = '<span class="step-label"><span class="flyout">%d</span><span class="arrow"></span><span class="title">%s</span></span>'; $numericLabelTmpl = '<span class="step-label"><span class="flyout">%d</span><span class="arrow"></span><span class="title">%s</span></span>';
$fields = new FieldList( $fields = new FieldList(
@ -1079,6 +1084,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
'Page' 'Page'
) )
); );
$parentField->setShowSearch(true);
$parentField->setValue(($record) ? $record->ID : null); $parentField->setValue(($record) ? $record->ID : null);
$actions = new FieldList( $actions = new FieldList(