From 184352ec0564e67ca9e12f388f1433d8cf41976b Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 22 Sep 2008 22:52:12 +0000 Subject: [PATCH] ENHANCEMENT #2417: Replaced http://www.yoursite.com with the actual base URL git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62867 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/RedirectorPage.php | 15 +++++++++++++-- core/model/SiteTree.php | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/model/RedirectorPage.php b/core/model/RedirectorPage.php index f7741dfb7..53617f720 100755 --- a/core/model/RedirectorPage.php +++ b/core/model/RedirectorPage.php @@ -53,8 +53,19 @@ class RedirectorPage extends Page { new TextField("Title", _t('SiteTree.PAGETITLE')), new TextField("MenuTitle", _t('SiteTree.MENUTITLE')), new FieldGroup(_t('SiteTree.URL'), - new LabelField("http://www.yoursite.com/"), - new TextField("URLSegment",""), + new LabelField(Director::absoluteBaseURL()), + new UniqueRestrictedTextField("URLSegment", + "URLSegment", + "SiteTree", + _t('SiteTree.VALIDATIONURLSEGMENT1', "Another page is using that URL. URL must be unique for each page"), + "[^A-Za-z0-9-]+", + "-", + _t('SiteTree.VALIDATIONURLSEGMENT2', "URLs can only be made up of letters, digits and hyphens."), + "", + "", + "", + 50 + ), new LabelField("/") ), new HeaderField(_t('RedirectorPage.HEADER', "This page will redirect users to another page")), diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 9692418c1..aa1e9629c 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1115,8 +1115,7 @@ class SiteTree extends DataObject { ), $tabMeta = new Tab('Meta-data', new FieldGroup(_t('SiteTree.URL', "URL"), - new LabelField("http://www.yoursite.com/"), - //new TextField("URLSegment",""), + new LabelField(Director::absoluteBaseURL()), new UniqueRestrictedTextField("URLSegment", "URLSegment", "SiteTree",