Project

General

Profile

« Previous | Next » 

Revision 28ce79ad

Added by Jim Pingle almost 14 years ago

Simplify this code a bit, should be the same test in both locations since this should be either/or, and with the other code it can apparently fall into a trap where it shows neither.

View differences:

usr/local/www/system_gateways_edit.php
401 401
		<tr>
402 402
		  <td width="22%" valign="top" class="vncell"><?=gettext("Advanced");?></td>
403 403
		  <td width="78%" class="vtable">
404
			<div id="showadvgatewaybox" <? if (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && $pconfig['interval'])) echo "style='display:none'"; ?>>
404
			<?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && $pconfig['interval'])); ?>
405
			<div id="showadvgatewaybox" <? if ($showbutton) echo "style='display:none'"; ?>>
405 406
				<input type="button" onClick="show_advanced_gateway()" value="Advanced"></input> - Show advanced option</a>
406 407
			</div>
407
			<div id="showgatewayadv" <? if (empty($pconfig['latencylow']) && empty($pconfig['latencyhigh']) && empty($pconfig['losslow']) && empty($pconfig['losshigh']) && (empty($pconfig['weight']) || $pconfig['weight'] == 1) && (empty($pconfig['interval']) || $pconfig['interval'] == 1)) echo "style='display:none'"; ?>>
408
			<div id="showgatewayadv" <? if (!$showbutton) echo "style='display:none'"; ?>>
408 409
                        <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="6">
409 410
			<tr>
410 411
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Weight");?></td>

Also available in: Unified diff