mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
74c89fced4
commit
d34def6b47
@ -85,16 +85,22 @@ HTML;
|
||||
* Changes this field to the readonly field.
|
||||
*/
|
||||
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();
|
||||
$titleList = array();
|
||||
if($items = $this->getItems()) {
|
||||
foreach($items as $item) $titleArray[] = $item->Title;
|
||||
if($titleArray) $titleList = implode(", ", $titleArray);
|
||||
}
|
||||
|
||||
|
||||
$field = new ReadonlyField($this->name, $this->title);
|
||||
$field->setValue($titleList);
|
||||
$field->setForm($this->form);
|
||||
return $field;
|
||||
return $field->Field();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user