Project

General

Profile

« Previous | Next » 

Revision 0716b616

Added by Stephen Beaver over 9 years ago

Display additional ooptions if value not empty

View differences:

src/usr/local/www/services_dhcpv6.php
817 817
$title = 'Show Additional BOOTP/DHCP Options';
818 818

  
819 819
if (!$pconfig['numberoptions']) {
820
	$noopts = true;
820 821
	$pconfig['numberoptions']['item'] = array(0 => array('number' => "", 'value' => ""));
822
} else {
823
	$noopts = false;
821 824
}
822 825

  
823 826
$counter = 0;
......
826 829
foreach ($pconfig['numberoptions']['item'] as $item) {
827 830
	$group = new Form_Group(null);
828 831
	$group->addClass('repeatable');
832
	$group->addClass('adnloptions');
829 833

  
830 834
	$group->add(new Form_Input(
831 835
		'number' . $counter,
......
858 862
	'Add Option'
859 863
);
860 864

  
861
$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm');
865
$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm')->addClass('adnloptions');
862 866

  
863 867
$section->addInput($btnaddopt);
864 868

  
......
1004 1008

  
1005 1009
	// Show additional  controls
1006 1010
	$("#btnadnl").click(function() {
1007
		hideClass('adnlopt', false);
1011
		hideClass('adnloptions', false);
1008 1012
		hideInput('btnaddopt', false);
1009 1013
	});
1010 1014

  
......
1015 1019
	hideInput('ldap', true);
1016 1020
	hideInput('bootfile_url', true);
1017 1021
	hideCheckbox('shownetboot', true);
1018
	hideClass('adnlopt', true);
1022
	hideClass('adnloptions', <?php echo json_encode($noopts); ?>);
1019 1023
	hideInput('btnaddopt', true);
1020 1024
});
1021 1025
//]]>

Also available in: Unified diff