diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index bb9fa19185..9626e212bd 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -248,7 +248,7 @@ switch ($login_screen) { echo ''; echo ''; echo '
'; @@ -288,7 +288,8 @@ switch ($login_screen) { ); echo '
'; echo '
'; - html_print_submit_button(__('Login'), 'login_button', false, 'class="next_login"'); + // html_print_submit_button(__('Login'), 'login_button', false, 'class="next_login"'); + html_print_submit_button(__('Login'), 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']); echo '
'; } break; @@ -307,7 +308,8 @@ switch ($login_screen) { html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true); echo ''; echo '
'; - html_print_submit_button(__('Check code').'  >', 'login_button', false, 'class="next_login"'); + // html_print_submit_button(__('Check code').'  >', 'login_button', false, 'class="next_login"'); + html_print_submit_button(__('Check code').'  >', 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']); echo '
'; break; diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 9be97a8685..062b897eb2 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -206,7 +206,7 @@ if (enterprise_installed() || defined('DESTDIR')) { html_print_input_hidden('update_settings', 1); html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"'); echo '  '; - html_print_button(__('Request new license'), '', false, 'generate_request_code()', 'class="sub next"'); + html_print_button(__('Request new license'), 'license', false, 'generate_request_code()', [ 'fixed_id' => 'button-', 'icon' => 'next']); echo ''; } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 457a7f506e..443520f1a9 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -3451,6 +3451,7 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $ { $output = ''; $classes = ''; + $fixedId = ''; if (empty($name) === true) { $name = 'unnamed'; @@ -3477,6 +3478,8 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $ $classes .= ' '.$value.'Button'; } else if ($attribute === 'class') { $classes .= ' '.$value; + } else if ($attribute === 'fixed_id') { + $fixedId = $value; } else { $attributes .= $attribute.'="'.$value.'" '; } @@ -3520,16 +3523,19 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $ $classes .= ' disabled_action_button'; } + $parameters = []; + $parameters[] = 'class="'.$classes.'"'; + $parameters[] = (empty($name) === false) ? ' name="'.$name.'"' : ''; + $parameters[] = 'id="'.((empty($fixedId) === false) ? $fixedId : 'button-'.$name ).'"'; + $parameters[] = (empty($label) === false) ? ' value="'.$label.'"' : ''; + $parameters[] = (empty($script) === false) ? ' onClick="'.$script.'"' : ''; + $parameters[] = ($disabled === true) ? ' disabled' : ''; + $parameters[] = (empty($attributes) === false) ? $attributes : ''; + $output = sprintf( - '', + '', $buttonType, - $classes, - (empty($name) === false) ? ' name="'.$name.'"' : '', - (empty($name) === false) ? ' id="button-'.$name.'"' : '', - (empty($label) === false) ? ' value="'.$label.'"' : '', - ($disabled === true) ? ' disabled' : '', - (empty($script) === false) ? ' onClick="'.$script.'"' : '', - (empty($attributes) === false) ? $attributes : '', + implode(' ', $parameters), $content );