BUGFIX: fixing the look of Settings tab in the CMS if it has multiple tabs

This commit is contained in:
Julian Seidenberg 2012-05-18 16:33:34 +12:00
parent aa7bc23992
commit 7112032b4c
3 changed files with 68 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<?php
class CMSSettingsController extends CMSMain {
class CMSSettingsController extends LeftAndMain {
static $url_segment = 'settings';
static $url_rule = '/$Action/$ID/$OtherID';
@ -16,9 +16,9 @@ class CMSSettingsController extends CMSMain {
$actions = $siteConfig->getCMSActions();
$form = new Form($this, 'EditForm', $fields, $actions);
$form->addExtraClass('root-form');
$form->addExtraClass('cms-edit-form');
// TODO Can't merge $FormAttributes in template at the moment
$form->addExtraClass('cms-content center ss-tabset cms-panel-padded');
$form->addExtraClass('cms-edit-form cms-panel-padded center');
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
$form->setHTMLID('Form_EditForm');
$form->loadDataFrom($siteConfig);
@ -33,6 +33,7 @@ class CMSSettingsController extends CMSMain {
return $form;
}
/**
* Save the current sites {@link SiteConfig} into the database
*

View File

@ -1 +1,33 @@
$EditForm
<div class="cms-content center cms-tabset $BaseCSSClasses" data-layout-type="border">
<div class="cms-content-header north">
<div>
<% with EditForm %>
<h2>
<% with Controller %>
<% include CMSSectionIcon %>
<% include CMSBreadcrumbs %>
<% end_with %>
</h2>
<% if Fields.hasTabset %>
<% with Fields.fieldByName('Root') %>
<div class="cms-tabset cms-content-header-tabs ss-ui-tabs-nav">
<ul>
<% loop Tabs %>
<li<% if extraClass %> class="$extraClass"<% end_if %>><a href="#$id">$Title</a></li>
<% end_loop %>
</ul>
</div>
<% end_with %>
<% end_if %>
<% end_with %>
</div>
</div>
<div class="cms-content-fields center ui-widget-content" data-layout-type="border">
$EditForm
</div>
</div>

View File

@ -0,0 +1,30 @@
<form $FormAttributes>
<% if Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>
<fieldset>
<% if Legend %><legend>$Legend</legend><% end_if %>
<% loop Fields %>
$FieldHolder
<% end_loop %>
<div class="clear"><!-- --></div>
</fieldset>
<% if Actions %>
<div class="Actions">
<% loop Actions %>
$Field
<% end_loop %>
<% if CurrentPage.LinkPreview %>
<a href="$CurrentPage.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
<% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo;
</a>
<% end_if %>
</div>
<% end_if %>
</form>