From f78bbe1679140cf6a42fa9b55624b1f54466dd1e Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 11 Jan 2016 23:25:01 +0545 Subject: Redmine #5759 print_info_box style Define the 'success' 'info' etc style of calls to print_info_box() --- src/usr/local/www/firewall_shaper_vinterface.php | 2 +- src/usr/local/www/head.inc | 8 ++++---- src/usr/local/www/load_balancer_pool.php | 2 +- src/usr/local/www/pkg_edit.php | 2 +- src/usr/local/www/pkg_mgr_install.php | 2 +- src/usr/local/www/services_captiveportal_hostname.php | 4 ++-- src/usr/local/www/services_captiveportal_ip.php | 2 +- src/usr/local/www/services_captiveportal_vouchers.php | 2 +- src/usr/local/www/services_dhcpv6.php | 9 ++++++--- src/usr/local/www/services_rfc2136_edit.php | 2 +- src/usr/local/www/services_snmp.php | 2 +- src/usr/local/www/services_wol.php | 15 +++++++++++---- src/usr/local/www/status_logs_filter.php | 3 ++- src/usr/local/www/status_logs_filter_dynamic.php | 3 ++- src/usr/local/www/status_queues.php | 12 ++++-------- src/usr/local/www/status_wireless.php | 6 ++++-- src/usr/local/www/system_advanced_firewall.php | 4 +++- src/usr/local/www/system_advanced_network.php | 4 +++- src/usr/local/www/system_groupmanager.php | 2 +- src/usr/local/www/system_groupmanager_addprivs.php | 2 +- src/usr/local/www/system_routes.php | 2 +- src/usr/local/www/system_usermanager_addprivs.php | 2 +- src/usr/local/www/system_usermanager_passwordmg.php | 2 +- src/usr/local/www/vpn_ipsec_mobile.php | 2 +- src/usr/local/www/vpn_ipsec_settings.php | 4 +++- src/usr/local/www/vpn_l2tp.php | 4 ++-- 26 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/usr/local/www/firewall_shaper_vinterface.php b/src/usr/local/www/firewall_shaper_vinterface.php index ef0ddae..f1e7165 100644 --- a/src/usr/local/www/firewall_shaper_vinterface.php +++ b/src/usr/local/www/firewall_shaper_vinterface.php @@ -433,7 +433,7 @@ display_top_tabs($tab_array); '. get_shortcut_log_link($shortcut_section, false). ''; /* if upgrade in progress, alert user */ if (is_subsystem_dirty('packagelock') || file_exists('/conf/needs_package_sync' && platform_booting())) { if (file_exists('/conf/needs_package_sync') && platform_booting()) { - $info_text = sprintf(gettext("%s is booting then packages will be reinstalled in the background.

Do not make changes in the GUI until this is complete."), $g['product_name']); + $warning_text = sprintf(gettext("%s is booting then packages will be reinstalled in the background.

Do not make changes in the GUI until this is complete."), $g['product_name']); } else { $pgtitle = array(gettext("System"), gettext("Package Manager")); - $info_text = gettext("Packages are currently being reinstalled in the background.

Do not make changes in the GUI until this is complete."); - $info_text .= gettext("

If the above message is still displayed after a couple of hours, use the 'Clear Package Lock' button on the Backup/Restore page and reinstall packages manually."); + $warning_text = gettext("Packages are currently being reinstalled in the background.

Do not make changes in the GUI until this is complete."); + $warning_text .= gettext("

If the above message is still displayed after a couple of hours, use the 'Clear Package Lock' button on the Backup/Restore page and reinstall packages manually."); } - print_info_box($info_text); + print_info_box($warning_text); } $pgtitle_output = true; diff --git a/src/usr/local/www/load_balancer_pool.php b/src/usr/local/www/load_balancer_pool.php index fee5f4b..cb82855 100644 --- a/src/usr/local/www/load_balancer_pool.php +++ b/src/usr/local/www/load_balancer_pool.php @@ -128,7 +128,7 @@ if ($input_errors) { } if ($savemsg) { - print_info_box($savemsg); + print_info_box($savemsg, 'success'); } if (is_subsystem_dirty('loadbalancer')) { diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php index 57e51ef..0f6384c 100644 --- a/src/usr/local/www/pkg_edit.php +++ b/src/usr/local/www/pkg_edit.php @@ -1471,7 +1471,7 @@ if (!empty($advanced)) { print($form); if ($pkg['note'] != "") { - print_info_box($pkg['note']); + print_info_box($pkg['note'], 'info'); } if ($pkg['custom_php_after_form_command']) { diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php index d702beb..b603b06 100644 --- a/src/usr/local/www/pkg_mgr_install.php +++ b/src/usr/local/www/pkg_mgr_install.php @@ -374,7 +374,7 @@ if ($input_errors) {

- +
addInput(new Form_Input( )); print($form); - +?> +
+' . gettext(' System: General setup') . '' . gettext(' (or the ') . '' . gettext('DNS forwarder') . ', ' . gettext('if enabled) ') . gettext('will be assigned to clients by the DHCP server.') . '
' . gettext('The DHCP lease table can be viewed on the ') . '' . - gettext('Status: DHCPv6 leases') . '' . gettext(' page.')); + gettext('Status: DHCPv6 leases') . '' . gettext(' page.'), + 'info'); ?> - +

DHCPv6 Static Mappings for this interface.

diff --git a/src/usr/local/www/services_rfc2136_edit.php b/src/usr/local/www/services_rfc2136_edit.php index 88da96f..6456072 100644 --- a/src/usr/local/www/services_rfc2136_edit.php +++ b/src/usr/local/www/services_rfc2136_edit.php @@ -165,7 +165,7 @@ if ($input_errors) { } if ($savemsg) { - print_info_box($savemsg); + print_info_box($savemsg, 'success'); } $form = new Form; diff --git a/src/usr/local/www/services_snmp.php b/src/usr/local/www/services_snmp.php index 58e1b44..16ef69f 100644 --- a/src/usr/local/www/services_snmp.php +++ b/src/usr/local/www/services_snmp.php @@ -217,7 +217,7 @@ if ($input_errors) { } if ($savemsg) { - print_info_box($savemsg); + print_info_box($savemsg, 'success'); } $form = new Form(); diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php index 8d91c19..606234f 100644 --- a/src/usr/local/www/services_wol.php +++ b/src/usr/local/www/services_wol.php @@ -84,8 +84,10 @@ if ($_GET['wakeall'] != "") { /* Execute wol command and check return code. */ if (!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}")) { $savemsg .= sprintf(gettext('Sent magic packet to %1$s (%2$s)%3$s'), $mac, $description, ".
"); + $class = 'success'; } else { $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s (%4$s) did not complete successfully%5$s'), '', '', $description, $mac, ".
"); + $class = 'warning'; } } } @@ -123,8 +125,10 @@ if ($_POST || $_GET['mac']) { /* Execute wol command and check return code. */ if (!mwexec("/usr/local/bin/wol -i {$bcip} " . escapeshellarg($mac))) { $savemsg .= sprintf(gettext("Sent magic packet to %s."), $mac); + $class = 'success'; } else { $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s did not complete successfully%4$s'), '', '', $mac, ".
"); + $class = 'warning'; } } } @@ -141,12 +145,15 @@ if ($_GET['act'] == "del") { $pgtitle = array(gettext("Services"), gettext("Wake on LAN")); include("head.inc"); - +?> +
+' . - gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).')); + gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).'), + 'info'); ?> - +
' . gettext("TCP Flags") . ': F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR' . '
' . - ' = Add to block list., = Pass traffic, = Resolve'); + ' = Add to block list., = Pass traffic, = Resolve', + 'info'); ?>
diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php index c72b2f8..dd71150 100755 --- a/src/usr/local/www/status_logs_filter_dynamic.php +++ b/src/usr/local/www/status_logs_filter_dynamic.php @@ -480,7 +480,8 @@ if ($tcpcnt > 0) {
' . - gettext("TCP Flags") . ': F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR'); + gettext("TCP Flags") . ': F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR', + 'info'); ?>
-
+
+
+

- -