MINOR Using new triangle/step markup in AddForm

This commit is contained in:
Ingo Schommer 2012-01-03 22:17:47 +01:00
parent f8d1523823
commit 8da0defa27

View File

@ -1062,21 +1062,23 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$pageTypes[$type->getField('ClassName')] = $html;
}
$labelTriangle = '<span class="label-triangle"></span>';
$numericLabelTmpl = '<span class="step-label"><span class="flyout">%d</span><span class="arrow"></span><span class="title">%s</span></span>';
$fields = new FieldList(
// new HiddenField("ParentID", false, ($this->parentRecord) ? $this->parentRecord->ID : null),
// TODO Should be part of the form attribute, but not possible in current form API
$hintsField = new LiteralField('Hints', sprintf('<span class="hints" data-hints="%s"></span>', $this->SiteTreeHints())),
$label1 = new LabelField("Triangle1", _t('CMSMain.1', '1').$labelTriangle),
$parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Choose parent'), 'SiteTree'),
$label2 = new LabelField("Triangle2", _t('CMSMain.2', '2').$labelTriangle),
new OptionsetField("PageType", _t('CMSMain.ChoosePageType', 'Choose page type'), $pageTypes, 'Page')
$parentField = new TreeDropdownField(
"ParentID",
sprintf($numericLabelTmpl, 1, _t('CMSMain.AddFormParentLabel', 'Choose parent')),
'SiteTree'
),
$typeField = new OptionsetField(
"PageType",
sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')),
$pageTypes,
'Page'
)
);
$label1->addExtraClass("numeric-label");
$label1->setAllowHTML(true);
$label2->addExtraClass("numeric-label");
$label2->setAllowHTML(true);
$parentField->setValue(($record) ? $record->ID : null);
$actions = new FieldList(