";
return $html;
}
/**
* Returns a readonly version of this field
*/
function performReadonlyTransformation() {
$field = new SimpleImageField_Disabled($this->name, $this->title, $this->value);
$field->setForm($this->form);
$field->setReadonly(true);
return $field;
}
}
/**
* Disabled version of {@link SimpleImageField}.
* @package forms
* @subpackage fields-files
*/
class SimpleImageField_Disabled extends FormField {
protected $disabled = true;
protected $readonly = true;
function Field() {
$record = $this->form->getRecord();
$fieldName = $this->name;
if($record) $imageField = $record->$fieldName();
$field = "
";
if($imageField && $imageField->exists()) {
if($imageField->hasMethod('Thumbnail')) $field .= "Thumbnail()->URL."\" />";
elseif($imageField->CMSThumbnail()) $field .= "CMSThumbnail()->URL."\" />";
else {} // This shouldn't be called but it sometimes is for some reason, so we don't do anything
}else{
$field .= "";
}
$field .= "