From e35991b363b9771e5fcde78628867f8e3421ae8f Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 3 Jan 2012 17:57:04 +0100 Subject: [PATCH] MINOR Misc styling fixes around dialogs and "add page" styling --- code/controllers/CMSMain.php | 2 +- code/forms/SiteTreeURLSegmentField.php | 4 ++++ code/model/SiteTree.php | 3 ++- templates/Includes/CMSPagesController_Content.ss | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 8116a387..5b5ed113 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1096,7 +1096,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $this->extend('updatePageOptions', $fields); $form = new Form($this, "AddForm", $fields, $actions); - $form->addExtraClass('cms-add-form'); + $form->addExtraClass('cms-add-form stacked'); return $form; } diff --git a/code/forms/SiteTreeURLSegmentField.php b/code/forms/SiteTreeURLSegmentField.php index 0d5a32f2..fac5ee60 100644 --- a/code/forms/SiteTreeURLSegmentField.php +++ b/code/forms/SiteTreeURLSegmentField.php @@ -39,4 +39,8 @@ class SiteTreeURLSegmentField extends TextField { $idField = $this->getForm()->dataFieldByName('ID'); return ($idField && $idField->Value()) ? DataObject::get_by_id('SiteTree', $idField->Value()) : singleton('SiteTree'); } + + function Type() { + return 'text sitetreeurlsegment'; + } } \ No newline at end of file diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index b0f2dabb..a7b5e36b 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1822,7 +1822,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $tabMain = new Tab('Main', new TextField("Title", $this->fieldLabel('Title')), new TextField("MenuTitle", $this->fieldLabel('MenuTitle')), - new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", PR_MEDIUM, 'HTML editor title')) + $htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", PR_MEDIUM, 'HTML editor title')) ), $tabMeta = new Tab('Metadata', new SiteTreeURLSegmentField("URLSegment", $this->fieldLabel('URLSegment') . $urlHelper), @@ -1841,6 +1841,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid ) ) ); + $htmlField->addExtraClass('stacked'); // Conditional dependent pages tab if($dependentPagesCount) $tabDependent->setTitle(_t('SiteTree.TABDEPENDENT', "Dependent pages") . " ($dependentPagesCount)"); diff --git a/templates/Includes/CMSPagesController_Content.ss b/templates/Includes/CMSPagesController_Content.ss index 2d0f22cb..3ab50267 100644 --- a/templates/Includes/CMSPagesController_Content.ss +++ b/templates/Includes/CMSPagesController_Content.ss @@ -40,7 +40,7 @@ $SiteTreeAsUL -
+
$AddForm