From 3b3a95e5511ef5f60f8142480ddf5adcaed88cb1 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 22 Jan 2016 22:42:28 +0545 Subject: Fix #5794 remove print_info_box_np chackes for gettext("apply") 1) Get rid of the stristr() checks to "guess" if an apply button should be used. 2) Change print_info_box() so it can take a button name of "close" , "apply" or none to decide which button to show. 3) Delete function print_info_box_np_undo() - nothing calls it. 4) Add new function print_apply_box() to provide an easy wrapper for print_info_box() with the parameters to be 'warning' level and 'apply' button. 5) Change print_info_box_np() calls to just print_info_box() or print_apply_box() as appropriate. There is 1 direct call to print_info_box_np() from vpn_ipsec_mobile.php remaining. That tries to make a "create" button. It was not working before this change. It needs to be sorted out and fixed separately. After this change there is no dependency on a string containing text like "apply" to make the apply button appear. Then we can work on re-engineering the internal code of print_info_box_np() print_info_box() and print_apply_box() to fit together however we like. It should be easy to preserving the current API to print_info_box() and print_apply_box(). --- src/usr/local/www/interfaces.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/usr/local/www/interfaces.php') diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 465bf2f..73755ca 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -1699,8 +1699,8 @@ if ($input_errors) { } if (is_subsystem_dirty('interfaces')) { - print_info_box_np(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "
" . - gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying.")); + print_apply_box(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "
" . + gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying.")); } if ($savemsg) { -- cgit v1.1