From c35c83bad7258166a8f6d8d382a437913c2bb091 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 02:00:59 +0000 Subject: [PATCH] elofgren: USABILITY: Make Page URL input field wider as part of fix for http://support.silverstripe.com/gsoc/ticket/35 (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42034 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 5 ++++- forms/UniqueTextField.php | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 4729d8ddb..6459b9c12 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -991,7 +991,10 @@ class SiteTree extends DataObject { "[^A-Za-z0-9-]+", "-", "URLs can only be made up of letters, digits and hyphens.", - "" + "", + "", + "", + 50 ), new LabelField("/") ), diff --git a/forms/UniqueTextField.php b/forms/UniqueTextField.php index f2146bde7..53d2049ad 100755 --- a/forms/UniqueTextField.php +++ b/forms/UniqueTextField.php @@ -50,10 +50,12 @@ class UniqueTextField extends TextField { } */ + $fieldSize = $this->maxLength ? min( $this->maxLength, 30 ) : 30; + if($this->maxLength){ - return /*implode("", $restrictedInputs).*/"class."\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" maxlength=\"$this->maxLength\" />id()."]\" id=\"".$this->id()."-restricted-message\" value=\"{$this->restrictedMessage}\" />"; + return /*implode("", $restrictedInputs).*/"class."\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" maxlength=\"$this->maxLength\" size=\"$fieldSize\" />id()."]\" id=\"".$this->id()."-restricted-message\" value=\"{$this->restrictedMessage}\" />"; }else{ - return /*implode("", $restrictedInputs).*/"class."\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" />id()."]\" id=\"".$this->id()."-restricted-message\" value=\"{$this->restrictedMessage}\" />"; + return /*implode("", $restrictedInputs).*/"class."\" type=\"text\" id=\"" . $this->id() . "\" name=\"{$this->name}\" value=\"" . $this->attrValue() . "\" size=\"30\" />id()."]\" id=\"".$this->id()."-restricted-message\" value=\"{$this->restrictedMessage}\" />"; } } }