added $name to constructor (can't derive a valid ID from the title, as it might not contain alphanumeric characters - had problems with chinese translation)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44256 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-11-05 03:18:18 +00:00
parent a09369d605
commit 5b7139c874
2 changed files with 5 additions and 3 deletions

View File

@ -1009,7 +1009,9 @@ class SiteTree extends DataObject {
new TextField("MetaTitle", _t('SiteTree.METATITLE', "Title")),
new TextareaField("MetaDescription", _t('SiteTree.METADESC', "Description")),
new TextareaField("MetaKeywords", _t('SiteTree.METAKEYWORDS', "Keywords")),
new ToggleCompositeField(_t('SiteTree.METAADVANCEDHEADER', "Advanced Options..."),
new ToggleCompositeField(
'AdvancedOptions',
_t('SiteTree.METAADVANCEDHEADER', "Advanced Options..."),
array(
new TextareaField("ExtraMeta",_t('SiteTree.METAEXTRA', "Custom Meta Tags")),
new LiteralField(

View File

@ -9,9 +9,9 @@ class ToggleCompositeField extends CompositeField {
*/
public $headingLevel = 2;
function __construct($title, $children) {
function __construct($name, $title, $children) {
$this->name = $name;
$this->title = $title;
$this->name = ereg_replace('[^A-Za-z0-9]','',$this->title);
$this->startClosed(true);