MINOR Using base LeftAndMain_EditForm template in GridFieldPopupForms regardless of template overrides on the "root" cms controller

This commit is contained in:
Ingo Schommer 2012-03-07 16:23:02 +01:00
parent c820692e9e
commit 3b9c9399dc

View File

@ -257,9 +257,11 @@ class GridFieldPopupForm_ItemRequest extends RequestHandler {
// TODO Coupling with CMS
$toplevelController = $this->getToplevelController();
if($toplevelController && $toplevelController instanceof LeftAndMain) {
$form->addExtraClass('cms-edit-form');
$form->setTemplate($toplevelController->getTemplatesWithSuffix('_EditForm'));
$form->addExtraClass('cms-content center ss-tabset ' . $toplevelController->BaseCSSClasses());
// Always show with base template (full width, no other panels),
// regardless of overloaded CMS controller templates.
// TODO Allow customization, e.g. to display an edit form alongside a search form from the CMS controller
$form->setTemplate('LeftAndMain_EditForm');
$form->addExtraClass('cms-content cms-edit-form center ss-tabset');
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
// TODO Link back to controller action (and edited root record) rather than index,
// which requires more URL knowledge than the current link to this field gives us.