mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
Merge pull request #51 from mateusz/report-visibility-master
ADD Add report visibility setting to EditableFormHeading
This commit is contained in:
commit
90ba5031ab
@ -25,7 +25,7 @@ class EditableFormHeading extends EditableFormField {
|
|||||||
$label = _t('EditableFormHeading.LEVEL', 'Select Heading Level');
|
$label = _t('EditableFormHeading.LEVEL', 'Select Heading Level');
|
||||||
|
|
||||||
$options = parent::getFieldConfiguration();
|
$options = parent::getFieldConfiguration();
|
||||||
|
|
||||||
$options->push(
|
$options->push(
|
||||||
new DropdownField($this->getSettingName("Level"), $label, $levels, $level)
|
new DropdownField($this->getSettingName("Level"), $label, $levels, $level)
|
||||||
);
|
);
|
||||||
@ -33,10 +33,18 @@ class EditableFormHeading extends EditableFormField {
|
|||||||
if($this->readonly) {
|
if($this->readonly) {
|
||||||
$extraFields = $options->makeReadonly();
|
$extraFields = $options->makeReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$options->push(
|
||||||
|
new CheckboxField(
|
||||||
|
$this->getSettingName('HideFromReports'),
|
||||||
|
_t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'),
|
||||||
|
$this->getSetting('HideFromReports')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormField() {
|
public function getFormField() {
|
||||||
$labelField = new HeaderField($this->Name,$this->Title, $this->getSetting('Level'));
|
$labelField = new HeaderField($this->Name,$this->Title, $this->getSetting('Level'));
|
||||||
$labelField->addExtraClass('FormHeading');
|
$labelField->addExtraClass('FormHeading');
|
||||||
@ -45,10 +53,10 @@ class EditableFormHeading extends EditableFormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function showInReports() {
|
public function showInReports() {
|
||||||
return false;
|
return (!$this->getSetting('HideFromReports'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFieldValidationOptions() {
|
public function getFieldValidationOptions() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user