BUGFIX: Fixed readonly version of TreeMultiselectField

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@78471 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-06-05 01:55:42 +00:00
parent 74c89fced4
commit d34def6b47

View File

@ -85,6 +85,12 @@ HTML;
* Changes this field to the readonly field. * Changes this field to the readonly field.
*/ */
function performReadonlyTransformation() { function performReadonlyTransformation() {
return new TreeMultiselectField_Readonly($this->name, $this->title, $this->sourceObject, $this->keyField, $this->labelField);
}
}
class TreeMultiselectField_Readonly extends TreeMultiselectField {
function Field() {
$titleArray = array(); $titleArray = array();
$titleList = array(); $titleList = array();
if($items = $this->getItems()) { if($items = $this->getItems()) {
@ -95,6 +101,6 @@ HTML;
$field = new ReadonlyField($this->name, $this->title); $field = new ReadonlyField($this->name, $this->title);
$field->setValue($titleList); $field->setValue($titleList);
$field->setForm($this->form); $field->setForm($this->form);
return $field; return $field->Field();
} }
} }