Skip to content

Commit

Permalink
NEW Remove Subsite Configuration header, rename Main tab and remove D…
Browse files Browse the repository at this point in the history
…omains GridField title
  • Loading branch information
robbieaverill committed Oct 2, 2017
1 parent 4328f8a commit 62df0b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions src/Model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public function getCMSFields()
$fields->addFieldsToTab('Root.Domains', [
GridField::create(
'Domains',
_t(__CLASS__ . '.DomainsListTitle', 'Domains'),
'',
$this->Domains(),
GridFieldConfig_RecordEditor::create(10)
)
Expand All @@ -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'),
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 62df0b4

Please sign in to comment.