mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
parent
f496d09f0e
commit
9a31b19ed2
@ -2,6 +2,7 @@
|
||||
|
||||
namespace SilverStripe\CMS\Model;
|
||||
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\HeaderField;
|
||||
use SilverStripe\Forms\OptionsetField;
|
||||
use SilverStripe\Forms\TextField;
|
||||
@ -145,7 +146,7 @@ class RedirectorPage extends Page
|
||||
|
||||
public function getCMSFields()
|
||||
{
|
||||
$fields = parent::getCMSFields();
|
||||
$this->beforeUpdateCMSFields(function (FieldList $fields) {
|
||||
$fields->removeByName('Content', true);
|
||||
|
||||
// Remove all metadata fields, does not apply for redirector pages
|
||||
@ -154,26 +155,26 @@ class RedirectorPage extends Page
|
||||
$fields->addFieldsToTab(
|
||||
'Root.Main',
|
||||
array(
|
||||
new HeaderField('RedirectorDescHeader', _t('SilverStripe\\CMS\\Model\\RedirectorPage.HEADER', "This page will redirect users to another page")),
|
||||
new HeaderField('RedirectorDescHeader', _t(__CLASS__.'.HEADER', "This page will redirect users to another page")),
|
||||
new OptionsetField(
|
||||
"RedirectionType",
|
||||
_t('SilverStripe\\CMS\\Model\\RedirectorPage.REDIRECTTO', "Redirect to"),
|
||||
_t(__CLASS__.'.REDIRECTTO', "Redirect to"),
|
||||
array(
|
||||
"Internal" => _t('SilverStripe\\CMS\\Model\\RedirectorPage.REDIRECTTOPAGE', "A page on your website"),
|
||||
"External" => _t('SilverStripe\\CMS\\Model\\RedirectorPage.REDIRECTTOEXTERNAL', "Another website"),
|
||||
"Internal" => _t(__CLASS__.'.REDIRECTTOPAGE', "A page on your website"),
|
||||
"External" => _t(__CLASS__.'.REDIRECTTOEXTERNAL', "Another website"),
|
||||
),
|
||||
"Internal"
|
||||
),
|
||||
new TreeDropdownField(
|
||||
"LinkToID",
|
||||
_t('SilverStripe\\CMS\\Model\\RedirectorPage.YOURPAGE', "Page on your website"),
|
||||
"SilverStripe\\CMS\\Model\\SiteTree"
|
||||
_t(__CLASS__.'.YOURPAGE', "Page on your website"),
|
||||
SiteTree::class
|
||||
),
|
||||
new TextField("ExternalURL", _t('SilverStripe\\CMS\\Model\\RedirectorPage.OTHERURL', "Other website URL"))
|
||||
new TextField("ExternalURL", _t(__CLASS__.'.OTHERURL', "Other website URL"))
|
||||
)
|
||||
);
|
||||
|
||||
return $fields;
|
||||
});
|
||||
return parent::getCMSFields();
|
||||
}
|
||||
|
||||
// Don't cache RedirectorPages
|
||||
|
Loading…
Reference in New Issue
Block a user