From 38db63c3b03e5d98bb14a05665af70ac990fff03 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 5 Jul 2011 11:31:33 +0200 Subject: [PATCH] MINOR Clearer CSS classes in CMS controller templates, added $BaseCSSClasses to content templates in order to support partial template loads through ajax (instead of relying on stale CSS classes on the tag) --- code/controller/CMSMain.php | 10 +--------- templates/Includes/AssetAdmin_Content.ss | 4 ++-- templates/Includes/CMSPageHistoryController_Content.ss | 2 +- templates/Includes/CMSPageReportsController_Content.ss | 2 +- templates/Includes/CMSPagesController_Content.ss | 4 ++-- templates/Includes/ReportAdmin_Content.ss | 4 ++-- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/code/controller/CMSMain.php b/code/controller/CMSMain.php index 2c251c0c..ed2801de 100755 --- a/code/controller/CMSMain.php +++ b/code/controller/CMSMain.php @@ -438,14 +438,6 @@ JS; $actions = $record->getCMSActions(); } - // Add a default or custom validator. - // @todo Currently the default Validator.js implementation - // adds javascript to the document body, meaning it won't - // be included properly if the associated fields are loaded - // through ajax. This means only serverside validation - // will kick in for pages+validation loaded through ajax. - // This will be solved by using less obtrusive javascript validation - // in the future, see http://open.silverstripe.com/ticket/2915 and http://open.silverstripe.com/ticket/3386 if($record->hasMethod('getCMSValidator')) { $validator = $record->getCMSValidator(); } else { @@ -464,7 +456,7 @@ JS; $form->addExtraClass('cms-edit-form'); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); // TODO Can't merge $FormAttributes in template at the moment - $form->addExtraClass('cms-content center ss-tabset'); + $form->addExtraClass('cms-content center ss-tabset ' . $this->BaseCSSClasses()); if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); if(!$record->canEdit() || $record->IsDeletedFromStage) { diff --git a/templates/Includes/AssetAdmin_Content.ss b/templates/Includes/AssetAdmin_Content.ss index 638f7239..d1ec94a3 100644 --- a/templates/Includes/AssetAdmin_Content.ss +++ b/templates/Includes/AssetAdmin_Content.ss @@ -1,4 +1,4 @@ -
+
@@ -35,7 +35,7 @@
-
+
$EditForm
diff --git a/templates/Includes/CMSPageHistoryController_Content.ss b/templates/Includes/CMSPageHistoryController_Content.ss index eca8c331..7e0037f2 100644 --- a/templates/Includes/CMSPageHistoryController_Content.ss +++ b/templates/Includes/CMSPageHistoryController_Content.ss @@ -1,3 +1,3 @@ -
+
Not implemented yet
\ No newline at end of file diff --git a/templates/Includes/CMSPageReportsController_Content.ss b/templates/Includes/CMSPageReportsController_Content.ss index eca8c331..7e0037f2 100644 --- a/templates/Includes/CMSPageReportsController_Content.ss +++ b/templates/Includes/CMSPageReportsController_Content.ss @@ -1,3 +1,3 @@ -
+
Not implemented yet
\ No newline at end of file diff --git a/templates/Includes/CMSPagesController_Content.ss b/templates/Includes/CMSPagesController_Content.ss index c6e8f03d..9eafb929 100644 --- a/templates/Includes/CMSPagesController_Content.ss +++ b/templates/Includes/CMSPagesController_Content.ss @@ -1,4 +1,4 @@ -
+
@@ -30,7 +30,7 @@
-
+
diff --git a/templates/Includes/ReportAdmin_Content.ss b/templates/Includes/ReportAdmin_Content.ss index c3ec7783..162c7613 100755 --- a/templates/Includes/ReportAdmin_Content.ss +++ b/templates/Includes/ReportAdmin_Content.ss @@ -1,4 +1,4 @@ -
+

<% _t('REPORTS','Reports') %>

@@ -17,7 +17,7 @@
-
+
$EditForm