mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Remove duplicate code
This commit is contained in:
parent
d265c9b733
commit
d6d3aa3554
@ -53,10 +53,8 @@
|
|||||||
class OptionsetField extends DropdownField {
|
class OptionsetField extends DropdownField {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Array
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $disabledItems = array();
|
|
||||||
|
|
||||||
public function Field($properties = array()) {
|
public function Field($properties = array()) {
|
||||||
$source = $this->getSource();
|
$source = $this->getSource();
|
||||||
$odd = 0;
|
$odd = 0;
|
||||||
@ -90,33 +88,6 @@ class OptionsetField extends DropdownField {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function performReadonlyTransformation() {
|
|
||||||
// Source and values are DataObject sets.
|
|
||||||
$field = $this->castedCopy('LookupField');
|
|
||||||
$field->setSource($this->getSource());
|
|
||||||
$field->setReadonly(true);
|
|
||||||
|
|
||||||
return $field;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mark certain elements as disabled,
|
|
||||||
* regardless of the {@link setDisabled()} settings.
|
|
||||||
*
|
|
||||||
* @param array $items Collection of array keys, as defined in the $source array
|
|
||||||
*/
|
|
||||||
public function setDisabledItems($items) {
|
|
||||||
$this->disabledItems = $items;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Array
|
|
||||||
*/
|
|
||||||
public function getDisabledItems() {
|
|
||||||
return $this->disabledItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user