whitespace and add a test for ->Triggers being an array

This commit is contained in:
Isaac Connor 2017-03-31 12:01:37 -04:00
parent d1a60dedc8
commit 514c83d3e9
1 changed files with 14 additions and 14 deletions

View File

@ -771,19 +771,19 @@ switch ( $tab )
$breakCount = (int)(ceil(count($optTriggers)));
$breakCount = min( 3, $breakCount );
$optCount = 0;
foreach( $optTriggers as $optTrigger )
{
if ( !ZM_OPT_X10 && $optTrigger == 'X10' )
foreach( $optTriggers as $optTrigger ) {
if ( ( ! ZM_OPT_X10 ) && ( $optTrigger == 'X10' ) )
continue;
if ( $optCount && ($optCount%$breakCount == 0) )
echo "</br>";
?>
<input type="checkbox" name="newMonitor[Triggers][]" value="<?php echo $optTrigger ?>"<?php if ( isset($monitor->Triggers) && in_array( $optTrigger, $monitor->Triggers ) ) { ?> checked="checked"<?php } ?>/>&nbsp;<?php echo $optTrigger ?>
<?php
echo '</br>';
echo '<input type="checkbox" name="newMonitor[Triggers][]" value="'. $optTrigger .'"';
if ( isset($monitor->Triggers) && is_array( $monitor->Triggers ) and in_array( $optTrigger, $monitor->Triggers ) ) {
echo ' checked="checked"';
}
echo '/>&nbsp;'. $optTrigger ;
$optCount ++;
}
if ( !$optCount )
{
if ( !$optCount ) {
?>
<em><?php echo translate('NoneAvailable') ?></em>
<?php