summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-10-20 11:27:39 -0400
committerStephen Beaver <sbeaver@netgate.com>2015-10-20 12:52:52 -0400
commit03b53522b6709f2eb346e906817c9f77a9549090 (patch)
tree4e32091003498700af146ac3466c6fcf3b67beac /src
parent0cdb94e1cbf726063d1e9be30782c0fbe4c8fdc4 (diff)
downloadpfsense-03b53522b6709f2eb346e906817c9f77a9549090.zip
pfsense-03b53522b6709f2eb346e906817c9f77a9549090.tar.gz
Partial fix for #5045
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/firewall_rules_edit.php20
-rw-r--r--src/usr/local/www/jquery/pfSense.js8
2 files changed, 19 insertions, 9 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index c65ec85..d7bbdb8 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -98,6 +98,7 @@ function is_aoadv_used($rule_config) {
($rule_config['statetimeout'] != "")) {
return true;
}
+
return false;
}
@@ -1376,17 +1377,21 @@ $section->addInput(new Form_Input(
$pconfig['descr']
))->setHelp('You may enter a description here for your reference.');
+$adv_open = is_aoadv_used($pconfig);
+
$btnadvanced = new Form_Button(
'toggle-advanced',
'Advanced options'
);
-$btnadvanced->removeClass('btn-primary')->addClass('btn-info');
+$btnadvanced->removeClass('btn-primary')->addClass('btn-default');
-$section->addInput(new Form_StaticText(
- null,
- $btnadvanced
-));
+if(!$adv_open) {
+ $section->addInput(new Form_StaticText(
+ null,
+ $btnadvanced
+ ));
+}
$form->add($section);
@@ -1844,11 +1849,13 @@ events.push(function(){
typesel_change();
- hideClass('advanced-options', true);
+ hideClass('advanced-options', ! "<?=$adv_open?>");
hideClass('srcportrange', true);
<?php if ((!empty($pconfig['srcbeginport']) && $pconfig['srcbeginport'] != "any") || (!empty($pconfig['srcendport']) && $pconfig['srcendport'] != "any")): ?>
+ srcportsvisible = true;
show_source_port_range();
+ hideInput('btnsrcadv', true);
<?php endif; ?>
// Make it a regular button, not a submit
@@ -1896,7 +1903,6 @@ events.push(function(){
proto_change();
});
-
$('#toggle-advanced').click(function() {
optionsvisible = 1;
hideClass('advanced-options', false);
diff --git a/src/usr/local/www/jquery/pfSense.js b/src/usr/local/www/jquery/pfSense.js
index 1b1398d..a82e6b1 100644
--- a/src/usr/local/www/jquery/pfSense.js
+++ b/src/usr/local/www/jquery/pfSense.js
@@ -154,8 +154,12 @@ $(function() {
}
});
+ // The need to NOT hide the advanced options if the elements therein are not set to the system
+ // default values makes it better to handle advanced option hiding in each PHP file so this is being
+ // disabled for now changing hte class name it acts on to "auto-advanced"
+
// Hide advanced inputs by default
- if ($('.advanced').length > 0)
+ if ($('.auto-advanced').length > 0)
{
var advButt = $('<a id="toggle-advanced" class="btn btn-default">toggle advanced options</a>');
advButt.on('click', function() {
@@ -164,7 +168,7 @@ $(function() {
advButt.insertAfter($('#save'));
- $('.advanced').parents('.form-group').collapse({toggle: true});
+ $('.auto-advanced').parents('.form-group').collapse({toggle: true});
}
// Enable popovers globally
OpenPOWER on IntegriCloud