Permalink
Browse files

MINOR Using new triangle/step markup in AddForm

  • Loading branch information...
1 parent f8d1523 commit 8da0defa2763f79dc2bd39a510259244eebaa686 @chillu chillu committed Jan 3, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 code/controllers/CMSMain.php
@@ -1062,21 +1062,23 @@ function AddForm() {
$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(

0 comments on commit 8da0def

Please sign in to comment.