Make button object to be a <button> by default

pull/5838/head
Aleksander Machniak 8 years ago
parent 5b57043cbf
commit cc10cbe039

@ -1333,7 +1333,7 @@ EOF;
} }
} }
else { else {
$attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'link'; $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'button';
} }
$command = $attrib['command']; $command = $attrib['command'];
@ -1469,11 +1469,22 @@ EOF;
$attrib['value'] = $attrib['label']; $attrib['value'] = $attrib['label'];
} }
if ($attrib['command']) { if ($attrib['command']) {
$attrib['disabled'] = 'disabled'; $attrib['disabled'] = 'disabled';
} }
$out = html::tag('input', $attrib, null, array('type', 'value', 'onclick', 'id', 'class', 'style', 'tabindex', 'disabled')); $out = html::tag('input', $attrib, null, array('type', 'value', 'onclick', 'id', 'class', 'style', 'tabindex', 'disabled'));
} }
else {
if ($attrib['label']) {
$attrib['value'] = $attrib['label'];
}
if ($attrib['command']) {
$attrib['disabled'] = 'disabled';
}
$content = isset($attrib['content']) ? $attrib['content'] : $attrib['label'];
$out = html::tag('button', $attrib, $content, array('type', 'value', 'onclick', 'id', 'class', 'style', 'tabindex', 'disabled'));
}
// generate html code for button // generate html code for button
if ($btn_content) { if ($btn_content) {

@ -7328,7 +7328,7 @@ function rcube_webmail()
obj.className = button[state]; obj.className = button[state];
} }
// disable/enable input buttons // disable/enable input buttons
if (button.type == 'input') { if (button.type == 'input' || button.type == 'button') {
obj.disabled = state == 'pas'; obj.disabled = state == 'pas';
} }
else if (button.type == 'uibutton') { else if (button.type == 'uibutton') {

@ -1395,7 +1395,7 @@ function rcmail_settings_tabs($attrib)
$action['href'] = $RCMAIL->url(array('_action' => $action['action'])); $action['href'] = $RCMAIL->url(array('_action' => $action['action']));
} }
$button = $OUTPUT->button($action); $button = $OUTPUT->button($action + array('type' => 'link'));
$attr = $attrib; $attr = $attrib;
$cmd = $action['action'] ?: $action['command']; $cmd = $action['action'] ?: $action['command'];

Loading…
Cancel
Save