Triggers cannot be null, it is '' instead

This commit is contained in:
Isaac Connor 2020-03-08 17:23:48 -04:00
parent bb72e3000c
commit e56976c800
1 changed files with 9 additions and 12 deletions

View File

@ -724,22 +724,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 ( $optTrigger == 'X10' and !ZM_OPT_X10 )
continue;
if ( $optCount && ($optCount%$breakCount == 0) )
echo '</br>';
?>
<input type="checkbox" name="newMonitor[Triggers][]" value="<?php echo $optTrigger ?>"<?php if ( ( null !== $monitor->Triggers() ) && in_array( $optTrigger, $monitor->Triggers() ) ) { ?> checked="checked"<?php } ?>/>&nbsp;<?php echo $optTrigger ?>
<?php
echo '<input type="checkbox" name="newMonitor[Triggers][]" value="'. $optTrigger '"'.
( ( '' !== $monitor->Triggers()) && in_array($optTrigger, $monitor->Triggers()) ) ? ' checked="checked"':''). '/> '. $optTrigger;
$optCount ++;
}
} # end foreach trigger option
if ( !$optCount ) {
?>
<em><?php echo translate('NoneAvailable') ?></em>
<?php
echo '<em>'. translate('NoneAvailable') .'</em>';
}
?>
?>
</td></tr>
<?php
}