Permalink
Browse files

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

… tabs
  • Loading branch information...
Julian Seidenberg
Julian Seidenberg committed May 18, 2012
1 parent aa7bc23 commit 7112032b4c0df1cbf21f1a0fb840de793464d43f
@@ -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 @@ function getEditForm($id = null, $fields = null) {
$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 @@ function getEditForm($id = null, $fields = null) {
return $form;
}
+
/**
* Save the current sites {@link SiteConfig} into the database
*
@@ -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>
@@ -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>

0 comments on commit 7112032

Please sign in to comment.