2015-08-04 17:12:17 +12:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* A step in multi-page user form
|
|
|
|
*
|
|
|
|
* @package userforms
|
|
|
|
*/
|
|
|
|
class EditableFormStep extends EditableFormField {
|
|
|
|
|
2015-08-11 18:21:43 +12:00
|
|
|
/**
|
|
|
|
* Disable selection of step class
|
|
|
|
*
|
|
|
|
* @config
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private static $hidden = true;
|
|
|
|
|
2015-08-04 17:12:17 +12:00
|
|
|
/**
|
|
|
|
* @config
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private static $singular_name = 'Step';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @config
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private static $plural_name = 'Steps';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FieldList
|
|
|
|
*/
|
|
|
|
public function getCMSFields() {
|
|
|
|
$fields = parent::getCMSFields();
|
|
|
|
|
|
|
|
$fields->removeByName('MergeField');
|
|
|
|
$fields->removeByName('Default');
|
|
|
|
$fields->removeByName('Validation');
|
|
|
|
$fields->removeByName('CustomRules');
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FormField
|
|
|
|
*/
|
|
|
|
public function getFormField() {
|
2015-08-10 17:03:36 +12:00
|
|
|
$field = CompositeField::create()
|
|
|
|
->setTitle($this->EscapedTitle);
|
|
|
|
$this->doUpdateFormField($field);
|
|
|
|
return $field;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function updateFormField($field) {
|
|
|
|
// if this field has an extra class
|
|
|
|
if($field->ExtraClass) {
|
|
|
|
$field->addExtraClass($field->ExtraClass);
|
|
|
|
}
|
2015-08-04 17:12:17 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function showInReports() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|