mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Themes dropdown in SiteConfig::getCMSFields() should use setEmptyString() as the $emptyString argument is now deprecated.
This commit is contained in:
parent
d9ee61c4a3
commit
808819ec3b
@ -52,7 +52,7 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
|||||||
$tabMain = new Tab('Main',
|
$tabMain = new Tab('Main',
|
||||||
$titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")),
|
$titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")),
|
||||||
$taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")),
|
$taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")),
|
||||||
new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes(), '', null, _t('SiteConfig.DEFAULTTHEME', '(Use default theme)'))
|
$themeDropdownField = new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes())
|
||||||
),
|
),
|
||||||
$tabAccess = new Tab('Access',
|
$tabAccess = new Tab('Access',
|
||||||
$viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")),
|
$viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")),
|
||||||
@ -68,6 +68,8 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));
|
||||||
|
|
||||||
$viewersOptionsSource = array();
|
$viewersOptionsSource = array();
|
||||||
$viewersOptionsSource["Anyone"] = _t('SiteTree.ACCESSANYONE', "Anyone");
|
$viewersOptionsSource["Anyone"] = _t('SiteTree.ACCESSANYONE', "Anyone");
|
||||||
$viewersOptionsSource["LoggedInUsers"] = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
|
$viewersOptionsSource["LoggedInUsers"] = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
|
||||||
@ -81,11 +83,11 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
|||||||
|
|
||||||
$topLevelCreatorsOptionsField->setSource($editorsOptionsSource);
|
$topLevelCreatorsOptionsField->setSource($editorsOptionsSource);
|
||||||
|
|
||||||
// Translatable doesn't handle updateCMSFields on DataObjects,
|
// Translatable doesn't handle updateCMSFields on DataObjects,
|
||||||
// so add it here to save the current Locale,
|
// so add it here to save the current Locale,
|
||||||
// because onBeforeWrite does not work.
|
// because onBeforeWrite does not work.
|
||||||
if(class_exists('Translatable') && Object::has_extension('SiteConfig',"Translatable")){
|
if(class_exists('Translatable') && Object::has_extension('SiteConfig',"Translatable")){
|
||||||
$fields->push(new HiddenField("Locale"));
|
$fields->push(new HiddenField("Locale"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Permission::check('EDIT_SITECONFIG')) {
|
if (!Permission::check('EDIT_SITECONFIG')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user