From 62df0b45a5d9b0fafd9e72eabc10ec929fc7202e Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 2 Oct 2017 16:34:21 +1300 Subject: [PATCH] NEW Remove Subsite Configuration header, rename Main tab and remove Domains GridField title --- lang/en.yml | 3 +-- src/Model/Subsite.php | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lang/en.yml b/lang/en.yml index 4b534411..e65919e0 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -29,12 +29,12 @@ en: CopyToSubsiteWithChildren: 'Include children pages?' SubsiteOperations: 'Subsite Operations' SilverStripe\Subsites\Model\Subsite: + ConfigurationTab: Configuration CopyMessage: 'Created a copy of {title}' CustomExtraMeta: 'Custom Meta Tags' CustomMetaDescription: Description CustomMetaKeywords: Keywords CustomMetaTitle: Title - DomainsListTitle: Domains PLURALNAME: Subsites PLURALS: one: 'A Subsite' @@ -43,7 +43,6 @@ en: SINGULARNAME: Subsite SiteConfigSubtitle: 'Your tagline here' SiteConfigTitle: 'Your Site Name' - SubsiteConfigurationHeader: 'Subsite Configuration' ThemeFieldEmptyString: '-' ValidateTitle: 'Please add a "Title"' SilverStripe\Subsites\Model\SubsiteDomain: diff --git a/src/Model/Subsite.php b/src/Model/Subsite.php index 6c2e1150..fd16c8de 100644 --- a/src/Model/Subsite.php +++ b/src/Model/Subsite.php @@ -657,7 +657,7 @@ public function getCMSFields() $fields->addFieldsToTab('Root.Domains', [ GridField::create( 'Domains', - _t(__CLASS__ . '.DomainsListTitle', 'Domains'), + '', $this->Domains(), GridFieldConfig_RecordEditor::create(10) ) @@ -668,13 +668,6 @@ public function getCMSFields() // in a wrapper further down. The RedirectURL field is currently not in use. $fields->removeByName(['PageTypeBlacklist', 'RedirectURL']); - // Add the heading to the top of the fields list - $fields->fieldByName('Root.Main') - ->unshift(HeaderField::create( - 'ConfigForSubsiteHeaderField', - _t(__CLASS__ . '.SubsiteConfigurationHeader', 'Subsite Configuration') - )); - $fields->addFieldToTab('Root.Main', DropdownField::create( 'Language', $this->fieldLabel('Language'), @@ -709,6 +702,9 @@ public function getCMSFields() // We don't need the Groups many many tab $fields->removeByName('Groups'); + + // Rename the main tab to configuration + $fields->fieldByName('Root.Main')->setTitle(_t(__CLASS__ . '.ConfigurationTab', 'Configuration')); }); return parent::getCMSFields();