diff options
-rw-r--r-- | src/usr/local/www/diag_testport.php | 10 | ||||
-rw-r--r-- | src/usr/local/www/edit.php | 37 | ||||
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 5 |
3 files changed, 31 insertions, 21 deletions
diff --git a/src/usr/local/www/diag_testport.php b/src/usr/local/www/diag_testport.php index 9ac7278..570289b 100644 --- a/src/usr/local/www/diag_testport.php +++ b/src/usr/local/www/diag_testport.php @@ -225,20 +225,20 @@ if ($input_errors) { // User asked for a port test if ($retval == 0) { // Good host & port - $alert_text = '<div class="alert alert-success" role="alert">' . sprintf(gettext('Port test to host: %1$s Port: %2$s successful'), $host, $port); + $alert_text = sprintf(gettext('Port test to host: %1$s Port: %2$s successful.'), $host, $port); if ($showtext) { $alert_text .= ' ' . gettext('Any text received from the host will be shown below the form.'); } + print_info_box($alert_text, 'success', false); } else { // netcat exit value != 0 - $alert_text = '<div class="alert alert-danger" role="alert">'; if ($showtext) { - $alert_text .= gettext('No output received, or connection failed. Try with "Show Remote Text" unchecked first.'); + $alert_text = gettext('No output received, or connection failed. Try with "Show Remote Text" unchecked first.'); } else { - $alert_text .= gettext('Connection failed.'); + $alert_text = gettext('Connection failed.'); } + print_info_box($alert_text, 'danger', false); } - print ($alert_text . '</div>'); } else { // First time, new page print_info_box(gettext('This page allows you to perform a simple TCP connection test to determine if a host is up and accepting connections on a given port.') . " " . diff --git a/src/usr/local/www/edit.php b/src/usr/local/www/edit.php index 72b18ca..050afa9 100644 --- a/src/usr/local/www/edit.php +++ b/src/usr/local/www/edit.php @@ -66,21 +66,26 @@ $pgtitle = array(gettext("Diagnostics"), gettext("Edit File")); require("guiconfig.inc"); if ($_POST['action']) { - $button_html = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'; - $alert_danger_html = '<div class="alert alert-danger" role="alert">' . $button_html; - $alert_success_html = '<div class="alert alert-success" role="alert">' . $button_html; switch ($_POST['action']) { case 'load': if (strlen($_POST['file']) < 1) { - print('|5|' . $alert_danger_html . gettext("No file name specified") . '</div>' . '|'); + print('|5|'); + print_info_box(gettext("No file name specified"), 'danger', false); + print('|'); } elseif (is_dir($_POST['file'])) { - print('|4|' . $alert_danger_html . gettext("Loading a directory is not supported") . '</div>' . '|'); + print('|4|'); + print_info_box(gettext("Loading a directory is not supported"), 'danger', false); + print('|'); } elseif (!is_file($_POST['file'])) { - print('|3|' . $alert_danger_html . gettext("File does not exist or is not a regular file") . '</div>' . '|'); + print('|3|'); + print_info_box(gettext("File does not exist or is not a regular file"), 'danger', false); + print('|'); } else { $data = file_get_contents(urldecode($_POST['file'])); if ($data === false) { - print('|1|' . $alert_danger_html . gettext("Failed to read file") . '</div>' . '|'); + print('|1|'); + print_info_box(gettext("Failed to read file"), 'danger', false); + print('|'); } else { $data = base64_encode($data); print("|0|{$_POST['file']}|{$data}|"); @@ -90,7 +95,9 @@ if ($_POST['action']) { case 'save': if (strlen($_POST['file']) < 1) { - print('|' . $alert_danger_html . gettext("No file name specified") . '</div>' . '|'); + print('|'); + print_info_box(gettext("No file name specified"), 'danger', false); + print('|'); } else { conf_mount_rw(); $_POST['data'] = str_replace("\r", "", base64_decode($_POST['data'])); @@ -103,11 +110,17 @@ if ($_POST['action']) { disable_security_checks(); } if ($ret === false) { - print('|' . $alert_danger_html . gettext("Failed to write file") . '</div>' . '|'); + print('|'); + print_info_box(gettext("Failed to write file"), 'danger', false); + print('|'); } elseif ($ret != strlen($_POST['data'])) { - print('|' . $alert_danger_html . gettext("Error while writing file") . '</div>' . '|'); + print('|'); + print_info_box(gettext("Error while writing file"), 'danger', false); + print('|'); } else { - print('|' . $alert_success_html . gettext("File saved successfully") . '</div>' . '|'); + print('|'); + print_info_box(gettext("File saved successfully"), 'success', false); + print('|'); } } exit; @@ -119,7 +132,7 @@ require("head.inc"); ?> <!-- file status box --> <div style="display:none; background:#eeeeee;" id="fileStatusBox"> - <strong id="fileStatus"></strong> + <div id="fileStatus"></div> </div> <div class="panel panel-default"> diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 7306e68..6a9f0c7 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -784,10 +784,7 @@ if (!is_numeric($pool) && !($act == "newpool")) { $pconfig['enable'] )); } else { - $section->addInput(new Form_StaticText( - null, - '<div class="alert alert-info"> Editing Pool-Specific Options. To return to the Interface, click its tab above. </div>' - )); + print_info_box(gettext('Editing Pool-Specific Options. To return to the Interface, click its tab above.'), 'info', false); } $section->addInput(new Form_Checkbox( |