nice buttons

This commit is contained in:
Roland Gruber 2010-09-17 18:39:53 +00:00
parent 7a258a47fb
commit 18c38f3501
1 changed files with 5 additions and 7 deletions

View File

@ -535,23 +535,18 @@ class htmlButton extends htmlElement {
logNewMessage(LOG_ERR, 'Meta HTML: Requested button in restricted mode.'); logNewMessage(LOG_ERR, 'Meta HTML: Requested button in restricted mode.');
return array(); return array();
} }
$value = '';
$style = ''; $style = '';
$class = ''; $class = '';
$title = ''; $title = '';
$name = ' name="' . $this->name . '"'; $name = ' name="' . $this->name . '"';
// image button // image button
if ($this->isImageButton) { if ($this->isImageButton) {
$value = ' value=" "';
$class = ' class="smallImageButton"'; $class = ' class="smallImageButton"';
$style = ' style="background-image: url(../../graphics/' . $this->value . ');"'; $style = ' style="background-image: url(../../graphics/' . $this->value . ');"';
} }
// text button // text button
else { else {
$class = ' class="smallPadding"'; $class = ' class="smallPadding"';
if ($this->value != null) {
$value = ' value="' . $this->value . '"';
}
} }
if ($this->title != null) { if ($this->title != null) {
$title = ' title="' . $this->title . '"'; $title = ' title="' . $this->title . '"';
@ -560,8 +555,11 @@ class htmlButton extends htmlElement {
if (!$this->isEnabled) { if (!$this->isEnabled) {
$disabled = ' disabled'; $disabled = ' disabled';
} }
echo '<input type="submit" id="btn_' . $this->name . '"' . $name . $value . $style . $class . $title . $disabled . '>'; if ($this->isImageButton) {
if (!$this->isImageButton) { echo '<input type="submit" id="btn_' . $this->name . '" value=" "' . $name . $style . $class . $title . $disabled . '>';
}
else {
echo '<button id="btn_' . $this->name . '"' . $name . $style . $class . $title . $disabled . '>' . $this->value . '</button>';
// text buttons get JQuery style // text buttons get JQuery style
echo '<script type="text/javascript">'; echo '<script type="text/javascript">';
echo ' jQuery(document).ready(function() {'; echo ' jQuery(document).ready(function() {';