MINOR Backlinks in CMS edit form template, first defined in GridFieldPopupForms

This commit is contained in:
Ingo Schommer 2012-02-27 20:23:07 +01:00
parent 8ff8d32764
commit f1775b5f84
3 changed files with 12 additions and 4 deletions

View File

@ -1,4 +0,0 @@
<div class="cms-content-fields center">
<a class="backlink ss-ui-button" href="$Backlink">Back</a>
$ItemEditForm
</div>

View File

@ -20,6 +20,13 @@
<% end_if %>
<!-- <div class="cms-content-search">...</div> -->
<% if Backlink %>
<a class="backlink ss-ui-button" href="$Backlink">
<% _t('Back', 'Back') %>
</a>
<% end_if %>
</div>
</div>

View File

@ -173,6 +173,11 @@ class GridFieldPopupForm_ItemRequest extends RequestHandler {
$form->setTemplate($controller->getTemplatesWithSuffix('_EditForm'));
$form->addExtraClass('cms-content center ss-tabset ' . $controller->BaseCSSClasses());
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.
// The current root record is held in session only,
// e.g. page/edit/show/6/ vs. page/edit/EditForm/field/MyGridField/....
$form->Backlink = $controller->Link();
}
$return = $this->customise(array(