diff --git a/include/class_IconTheme.inc b/include/class_IconTheme.inc index 8e15b3b40fd644213f94d88112635bc23b49ae0f..b7874729d6804f379f1692fef8251c0545a82ebd 100644 --- a/include/class_IconTheme.inc +++ b/include/class_IconTheme.inc @@ -309,6 +309,10 @@ class IconTheme array('actions','go-up'), array('actions','arrow-up'), ), + 'actions/upload' => array( + array('actions','document-import'), + array('actions','up'), + ), 'actions/down' => array( array('actions','go-down'), array('actions','arrow-down'), diff --git a/include/simpleplugin/class_attribute.inc b/include/simpleplugin/class_attribute.inc index 8836f0f52ef9e1ee5f13b1535e5d92c7b8336b09..0ca9001ca6bcad218c08068b74a7329928d0e727 100644 --- a/include/simpleplugin/class_attribute.inc +++ b/include/simpleplugin/class_attribute.inc @@ -1782,8 +1782,20 @@ class ImageAttribute extends FileAttribute function loadPostValue () { $this->postValue = $this->value; - if (isset($_POST['upload'.$this->getHtmlId()])) { - parent::loadPostValue(); + $id = $this->getHtmlId(); + if (!$this->disabled && $this->isVisible()) { + foreach (array_keys($_POST) as $name) { + if (!$this->isRequired()) { + if (preg_match('/^'.$id.'_remove_/', $name)) { + $this->setPostValue(''); + break; + } + } + if (preg_match('/^'.$id.'_upload_/', $name)) { + parent::loadPostValue(); + break; + } + } } } @@ -1846,7 +1858,26 @@ class ImageAttribute extends FileAttribute ' title="'.$this->getDescription().'"'. ' /><br/>'; $display .= $this->renderInputField('file', $id); - $display .= $this->renderInputField('submit', 'upload'.$id, array('value' => _('Upload'))); + $display .= $this->renderInputField( + 'image', $id.'_upload', + array( + 'class' => 'center', + 'src' => 'geticon.php?context=actions&icon=upload&size=16', + 'title' => _('Upload'), + 'alt' => _('Upload') + ) + ); + if (!$this->isRequired()) { + $display .= $this->renderInputField( + 'image', $id.'_remove', + array( + 'class' => 'center', + 'src' => 'geticon.php?context=actions&icon=remove&size=16', + 'title' => _('Remove'), + 'alt' => _('Remove') + ) + ); + } if (($this->getValue() == '') && ($this->placeholder != '')) { session::set('binary', $this->placeholder); } else { diff --git a/include/simpleplugin/class_dialogAttributes.inc b/include/simpleplugin/class_dialogAttributes.inc index 947e26115ee014ef043abcdb42d287770ebf35ba..9e00e7ff861698c6e7c462750f95e87ccaaf4134 100644 --- a/include/simpleplugin/class_dialogAttributes.inc +++ b/include/simpleplugin/class_dialogAttributes.inc @@ -641,7 +641,7 @@ class UserAttribute extends DialogButtonAttribute 'image', $id.'_remove', array( 'class' => 'center', - 'src' => 'geticon.php?context=actions&icon=edit-delete&size=16', + 'src' => 'geticon.php?context=actions&icon=remove&size=16', 'title' => _('Remove'), 'alt' => _('Remove') )