BUGFIX Adjusted HeaderField and LabelField implementation to new constructor arguments (see r64421)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64422 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-16 13:26:50 +00:00
parent e95c5657ff
commit 768fc5a588
9 changed files with 25 additions and 21 deletions

View File

@ -17,7 +17,7 @@ class GhostPage extends SiteTree implements HiddenClass {
return $this->LinkedPage()->getCMSFields($val); return $this->LinkedPage()->getCMSFields($val);
} else { } else {
return new FieldSet( return new FieldSet(
new LabelField(_t('GhostPage.NOLINKED', "This ghost page has no linked page.")) new LabelField('GhostPageNoLinkedLabel',_t('GhostPage.NOLINKED', "This ghost page has no linked page."))
); );
} }
} }

View File

@ -574,7 +574,7 @@ class Image_Uploader extends Controller {
new HiddenField("Class", null, $this->urlParams['Class']), new HiddenField("Class", null, $this->urlParams['Class']),
new HiddenField("ID", null, $this->urlParams['ID']), new HiddenField("ID", null, $this->urlParams['ID']),
new HiddenField("Field", null, $this->urlParams['Field']), new HiddenField("Field", null, $this->urlParams['Field']),
new HeaderField($title), new HeaderField('EditImageHeader',$title),
new SelectionGroup("ImageSource", array( new SelectionGroup("ImageSource", array(
"new//$fromYourPC" => new FieldGroup("", "new//$fromYourPC" => new FieldGroup("",
new FileField("Upload","") new FileField("Upload","")

View File

@ -94,7 +94,7 @@ class RedirectorPage extends Page {
new TextField("Title", _t('SiteTree.PAGETITLE')), new TextField("Title", _t('SiteTree.PAGETITLE')),
new TextField("MenuTitle", _t('SiteTree.MENUTITLE')), new TextField("MenuTitle", _t('SiteTree.MENUTITLE')),
new FieldGroup(_t('SiteTree.URL'), new FieldGroup(_t('SiteTree.URL'),
new LabelField(Director::absoluteBaseURL()), new LabelField('BaseUrlLabel',Director::absoluteBaseURL()),
new UniqueRestrictedTextField("URLSegment", new UniqueRestrictedTextField("URLSegment",
"URLSegment", "URLSegment",
"SiteTree", "SiteTree",
@ -107,9 +107,9 @@ class RedirectorPage extends Page {
"", "",
50 50
), ),
new LabelField("/") new LabelField('TrailingSlashLabel',"/")
), ),
new HeaderField(_t('RedirectorPage.HEADER', "This page will redirect users to another page")), new HeaderField('RedirectorDescHeader',_t('RedirectorPage.HEADER', "This page will redirect users to another page")),
new OptionsetField( new OptionsetField(
"RedirectionType", "RedirectionType",
_t('RedirectorPage.REDIRECTTO', "Redirect to"), _t('RedirectorPage.REDIRECTTO', "Redirect to"),

View File

@ -1057,7 +1057,7 @@ class SiteTree extends DataObject {
), ),
$tabMeta = new Tab('Meta-data', $tabMeta = new Tab('Meta-data',
new FieldGroup(_t('SiteTree.URL', "URL"), new FieldGroup(_t('SiteTree.URL', "URL"),
new LabelField(Director::absoluteBaseURL()), new LabelField('BaseUrlLabel',Director::absoluteBaseURL()),
new UniqueRestrictedTextField("URLSegment", new UniqueRestrictedTextField("URLSegment",
"URLSegment", "URLSegment",
"SiteTree", "SiteTree",
@ -1070,9 +1070,9 @@ class SiteTree extends DataObject {
"", "",
50 50
), ),
new LabelField("/") new LabelField('TrailingSlashLabel',"/")
), ),
new HeaderField(_t('SiteTree.METAHEADER', "Search Engine Meta-tags")), new HeaderField('MetaTagsHeader',_t('SiteTree.METAHEADER', "Search Engine Meta-tags")),
new TextField("MetaTitle", _t('SiteTree.METATITLE', "Title")), new TextField("MetaTitle", _t('SiteTree.METATITLE', "Title")),
new TextareaField("MetaDescription", _t('SiteTree.METADESC', "Description")), new TextareaField("MetaDescription", _t('SiteTree.METADESC', "Description")),
new TextareaField("MetaKeywords", _t('SiteTree.METAKEYWORDS', "Keywords")), new TextareaField("MetaKeywords", _t('SiteTree.METAKEYWORDS', "Keywords")),
@ -1132,7 +1132,7 @@ class SiteTree extends DataObject {
) )
), ),
$tabAccess = new Tab('Access', $tabAccess = new Tab('Access',
new HeaderField(_t('SiteTree.ACCESSHEADER', "Who can view this page on my site?"), 2), new HeaderField('WhoCanViewHeader',_t('SiteTree.ACCESSHEADER', "Who can view this page on my site?"), 2),
new OptionsetField( new OptionsetField(
"Viewers", "Viewers",
"", "",
@ -1143,7 +1143,7 @@ class SiteTree extends DataObject {
) )
), ),
new DropdownField("ViewersGroup", _t('SiteTree.GROUP', "Group"), Group::map()), new DropdownField("ViewersGroup", _t('SiteTree.GROUP', "Group"), Group::map()),
new HeaderField(_t('SiteTree.EDITHEADER', "Who can edit this inside the CMS?"), 2), new HeaderField('WhoCanEditHeader',_t('SiteTree.EDITHEADER', "Who can edit this inside the CMS?"), 2),
new OptionsetField( new OptionsetField(
"Editors", "Editors",
"", "",

View File

@ -614,7 +614,7 @@ class Translatable extends DataObjectDecorator {
$fields->addFieldsToTab( $fields->addFieldsToTab(
'Root', 'Root',
new Tab(_t('Translatable.TRANSLATIONS', 'Translations'), new Tab(_t('Translatable.TRANSLATIONS', 'Translations'),
new HeaderField(_t('Translatable.CREATE', 'Create new translation'), 2), new HeaderField('CreateTransHeader',_t('Translatable.CREATE', 'Create new translation'), 2),
$langDropdown = new LanguageDropdownField("NewTransLang", _t('Translatable.NEWLANGUAGE', 'New language'), $alreadyTranslatedLangs), $langDropdown = new LanguageDropdownField("NewTransLang", _t('Translatable.NEWLANGUAGE', 'New language'), $alreadyTranslatedLangs),
$createButton = new InlineFormAction('createtranslation',_t('Translatable.CREATEBUTTON', 'Create')) $createButton = new InlineFormAction('createtranslation',_t('Translatable.CREATEBUTTON', 'Create'))
) )
@ -623,7 +623,7 @@ class Translatable extends DataObjectDecorator {
$fields->addFieldsToTab( $fields->addFieldsToTab(
'Root.Translations', 'Root.Translations',
new FieldSet( new FieldSet(
new HeaderField(_t('Translatable.EXISTING', 'Existing translations:'), 3), new HeaderField('ExistingTransHeader',_t('Translatable.EXISTING', 'Existing translations:'), 3),
new LiteralField('existingtrans',implode(', ',$alreadyTranslatedLangs)) new LiteralField('existingtrans',implode(', ',$alreadyTranslatedLangs))
) )
); );

View File

@ -76,7 +76,7 @@ class VirtualPage extends Page {
// Add fields to the tab // Add fields to the tab
$fields->addFieldToTab("Root.Content.Main", $fields->addFieldToTab("Root.Content.Main",
new HeaderField(_t('VirtualPage.HEADER', "This is a virtual page")), new HeaderField('VirtualPageHeader',_t('VirtualPage.HEADER', "This is a virtual page")),
"Title" "Title"
); );
$fields->addFieldToTab("Root.Content.Main", $copyContentFromField, "Title"); $fields->addFieldToTab("Root.Content.Main", $copyContentFromField, "Title");
@ -85,7 +85,11 @@ class VirtualPage extends Page {
if($this->CopyContentFromID) { if($this->CopyContentFromID) {
$linkToContent = "<a class=\"cmsEditlink\" href=\"admin/show/$this->CopyContentFromID\">" . $linkToContent = "<a class=\"cmsEditlink\" href=\"admin/show/$this->CopyContentFromID\">" .
_t('VirtualPage.EDITCONTENT', 'click here to edit the content') . "</a>"; _t('VirtualPage.EDITCONTENT', 'click here to edit the content') . "</a>";
$fields->addFieldToTab("Root.Content.Main", new LabelField($linkToContent, null, true), "Title"); $fields->addFieldToTab("Root.Content.Main",
$linkToContentLabelField = new LabelField('VirtualPageContentLinkLabel', $linkToContent),
"Title"
);
$linkToContentLabelField->setAllowHTML(true);
} }
return $fields; return $fields;

View File

@ -13,14 +13,14 @@ class AdvancedSearchForm extends SearchForm {
if(!$fields) { if(!$fields) {
$fields = new FieldSet( $fields = new FieldSet(
$searchBy = new CompositeField( $searchBy = new CompositeField(
new HeaderField(_t('AdvancedSearchForm.SEARCHBY', 'SEARCH BY')), new HeaderField('SearchByHeader',_t('AdvancedSearchForm.SEARCHBY', 'SEARCH BY')),
new TextField("+", _t('AdvancedSearchForm.ALLWORDS', 'All Words')), new TextField("+", _t('AdvancedSearchForm.ALLWORDS', 'All Words')),
new TextField("quote", _t('AdvancedSearchForm.EXACT', 'Exact Phrase')), new TextField("quote", _t('AdvancedSearchForm.EXACT', 'Exact Phrase')),
new TextField("any", _t('AdvancedSearchForm.ATLEAST', 'At Least One Of the Words')), new TextField("any", _t('AdvancedSearchForm.ATLEAST', 'At Least One Of the Words')),
new TextField("-", _t('AdvancedSearchForm.WITHOUT', 'Without the Words')) new TextField("-", _t('AdvancedSearchForm.WITHOUT', 'Without the Words'))
), ),
$sortBy = new CompositeField( $sortBy = new CompositeField(
new HeaderField(_t('AdvancedSearchForm.SORTBY', 'SORT RESULTS BY')), new HeaderField('SortByHeader',_t('AdvancedSearchForm.SORTBY', 'SORT RESULTS BY')),
new OptionsetField("sortby", "", new OptionsetField("sortby", "",
array( array(
'Relevance' => _t('AdvancedSearchForm.RELEVANCE', 'Relevance'), 'Relevance' => _t('AdvancedSearchForm.RELEVANCE', 'Relevance'),
@ -31,7 +31,7 @@ class AdvancedSearchForm extends SearchForm {
) )
), ),
$chooseDate = new CompositeField( $chooseDate = new CompositeField(
new HeaderField(_t('AdvancedSearchForm.LASTUPDATEDHEADER', 'LAST UPDATED')), new HeaderField('LastUpdatedHeader',_t('AdvancedSearchForm.LASTUPDATEDHEADER', 'LAST UPDATED')),
new CompositeDateField("From", _t('AdvancedSearchForm.FROM', 'From')), new CompositeDateField("From", _t('AdvancedSearchForm.FROM', 'From')),
new CompositeDateField("To", _t('AdvancedSearchForm.TO', 'To')) new CompositeDateField("To", _t('AdvancedSearchForm.TO', 'To'))
) )

View File

@ -816,12 +816,12 @@ class Member extends DataObject {
$mainFields->replaceField('Password', $password); $mainFields->replaceField('Password', $password);
$mainFields->insertBefore( $mainFields->insertBefore(
new HeaderField(_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')), new HeaderField('MemberDetailsHeader',_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')),
'FirstName' 'FirstName'
); );
$mainFields->insertBefore( $mainFields->insertBefore(
new HeaderField(_t('Member.USERDETAILS', "User Details", PR_MEDIUM, 'Headline for formfields')), new HeaderField('MemberUserDetailsHeader',_t('Member.USERDETAILS', "User Details", PR_MEDIUM, 'Headline for formfields')),
'Email' 'Email'
); );

View File

@ -77,7 +77,7 @@ class FormTest extends FunctionalTest {
new Controller(), new Controller(),
'Form', 'Form',
new FieldSet( new FieldSet(
new HeaderField('My Player'), new HeaderField('MyPlayerHeader','My Player'),
new TextField('Name'), // appears in both Player and Team new TextField('Name'), // appears in both Player and Team
new TextareaField('Biography'), new TextareaField('Biography'),
new DateField('Birthday'), new DateField('Birthday'),
@ -118,7 +118,7 @@ class FormTest extends FunctionalTest {
new Controller(), new Controller(),
'Form', 'Form',
new FieldSet( new FieldSet(
new HeaderField('My Player'), new HeaderField('MyPlayerHeader','My Player'),
new TextField('Name'), // appears in both Player and Team new TextField('Name'), // appears in both Player and Team
new TextareaField('Biography'), new TextareaField('Biography'),
new DateField('Birthday'), new DateField('Birthday'),