mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: add more condition before $this->form is used as Caller since $this->form can still not be set yet in a certain circumstance.
ENHANCEMENT: add the ability that a SimpleImageField could be disabled. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74489 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d78fecdfe6
commit
2889ab115a
@ -24,9 +24,9 @@ class SimpleImageField extends FileField {
|
||||
public $allowedExtensions = array('jpg','gif','png');
|
||||
|
||||
function Field() {
|
||||
$record = $this->form->getRecord();
|
||||
if($this->form) $record = $this->form->getRecord();
|
||||
$fieldName = $this->name;
|
||||
if($record) {
|
||||
if(isset($record)&&$record) {
|
||||
$imageField = $record->$fieldName();
|
||||
} else {
|
||||
$imageField = "";
|
||||
@ -47,7 +47,8 @@ class SimpleImageField extends FileField {
|
||||
"type" => "file",
|
||||
"name" => $this->name,
|
||||
"id" => $this->id(),
|
||||
"tabindex" => $this->getTabIndex()
|
||||
"tabindex" => $this->getTabIndex(),
|
||||
'disabled' => $this->disabled
|
||||
)
|
||||
);
|
||||
$html .= $this->createTag("input",
|
||||
|
Loading…
x
Reference in New Issue
Block a user