Project

General

Profile

« Previous | Next » 

Revision a361a19b

Added by Stephen Beaver over 9 years ago

Fixed issue with separator bar at very top of floating rule list

View differences:

src/usr/local/www/firewall_rules.php
235 235

  
236 236
		$a_filter = $a_filter_new;
237 237

  
238
		$config['filter']['separator'][$if] = "";
238
		$config['filter']['separator'][strtolower($if)] = "";
239 239

  
240 240
		if ($_POST['separator']) {
241 241
			$idx = 0;
242 242
			foreach ($_POST['separator'] as $separator) {
243
				$config['filter']['separator'][$separator['if']]['sep' . $idx++] = $separator;
243
				$config['filter']['separator'][strtolower($separator['if'])]['sep' . $idx++] = $separator;
244 244
			}
245 245
		}
246 246

  
......
371 371
<?php
372 372
$nrules = 0;
373 373
$seps = 0;
374

  
375
if (isset($config['filter']['separator'][strtolower($if)]['sep0'])) {
376
	foreach ($config['filter']['separator'][strtolower($if)] as $rulesep) {
377
		if ($rulesep['row']['0'] == "fr-1") {
378
			print('<tr class="ui-sortable-handle separator">' .
379
				'<td bgcolor="#cce5ff" colspan="11">' . '<font color="#002699">' . $rulesep['text'] . '</font></td>' .
380
				'<td  bgcolor="#cce5ff"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
381
				'</tr>' . "\n");
382
		}
383
	}
384
}
385

  
374 386
for ($i = 0; isset($a_filter[$i]); $i++):
375 387
	$filterent = $a_filter[$i];
376 388

  
......
821 833
		$('#ruletable > tbody > tr').each(function() {
822 834
			if ($(this).hasClass('separator')) {
823 835
				seprow = $(this).prev('tr').attr("id");
824
				if (isNaN(seprow)) {
825
					seprow = 0;
836
				if (seprow == undefined) {
837
					seprow = "fr-1";
826 838
				}
827 839

  
828 840
				sepinput = '<input type="hidden" name="separator[' + sepnum + '][row]" value="' + seprow + '"></input>';
......
831 843
				$('form').append(sepinput);
832 844
				sepinput = '<input type="hidden" name="separator[' + sepnum + '][color]" value="' + 'blue' + '"></input>';
833 845
				$('form').append(sepinput);
834
				sepinput = '<input type="hidden" name="separator[' + sepnum + '][if]" value="<?=$if?>"></input>';
846
				sepinput = '<input type="hidden" name="separator[' + sepnum + '][if]" value="<?=strtolower($if)?>"></input>';
835 847
				$('form').append(sepinput);
836 848
				sepnum++;
837 849
			}

Also available in: Unified diff