summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2007-10-17 04:48:18 +0000
committerBill Marquette <billm@pfsense.org>2007-10-17 04:48:18 +0000
commita2dab9bc71c9365c22f8ed4d7e1047b257965fee (patch)
treee60d5b8fe097b8f0e83927c26570a3a00446b422 /usr
parentae2ea68c424a93ce467da4eb32cd2402e798c26b (diff)
downloadpfsense-a2dab9bc71c9365c22f8ed4d7e1047b257965fee.zip
pfsense-a2dab9bc71c9365c22f8ed4d7e1047b257965fee.tar.gz
Ticket #1462: Make the save button only appear if you change an assignment
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/guiconfig.inc6
-rwxr-xr-xusr/local/www/interfaces_assign.php5
2 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 1df8a66..5952f41 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -231,7 +231,7 @@ function verify_gzip_file($fname) {
return 1;
}
-function print_info_box_np($msg) {
+function print_info_box_np($msg, $name="apply",$value="Apply changes") {
global $g;
echo "<table height=\"32\" width=\"100%\">\n";
echo " <tr>\n";
@@ -242,9 +242,9 @@ function print_info_box_np($msg) {
echo " </td>\n";
echo " <td width='70%'><font color='white'><b>{$msg}</b></font>\n";
echo " </td>";
- if(stristr($msg, "apply") == true) {
+ if(stristr($msg, "apply") == true || stristr($msg, "save")) {
echo " <td>";
- echo " <input name=\"apply\" type=\"submit\" class=\"formbtn\" id=\"apply\" value=\"Apply changes\">\n";
+ echo " <input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\">\n";
echo " </td>";
}
echo " </tr></table>\n";
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 0349f62..d13bdfa 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -208,6 +208,8 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
<p class="pgtitle"><?=$pgtitle?></p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
+<div id="save_button" style="display:none"><?php print_info_box_np("Assignment change detected, changes are not yet saved.", "save", "Save Changes"); ?></div>
+
<form action="interfaces_assign.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
@@ -236,7 +238,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
<tr>
<td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
<td valign="middle" class="listr">
- <select name="<?=$ifname;?>" class="formfld" id="<?=$ifname;?>">
+ <select onChange="document.getElementById('save_button').style.display='inline';" name="<?=$ifname;?>" class="formfld" id="<?=$ifname;?>">
<?php foreach ($portlist as $portname => $portinfo): ?>
<option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo "selected";?>>
<?php if ($portinfo['isvlan']) {
@@ -273,7 +275,6 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
</table>
</div>
<br>
-<input name="Submit" type="submit" class="formbtn" value="Save"><br><br>
<p>
</p>
<ul>
OpenPOWER on IntegriCloud