whitespace and add a test for ->Triggers being an array
This commit is contained in:
parent
d1a60dedc8
commit
514c83d3e9
|
@ -768,22 +768,22 @@ switch ( $tab )
|
||||||
<tr><td><?php echo translate('Triggers') ?></td><td>
|
<tr><td><?php echo translate('Triggers') ?></td><td>
|
||||||
<?php
|
<?php
|
||||||
$optTriggers = getSetValues( 'Monitors', 'Triggers' );
|
$optTriggers = getSetValues( 'Monitors', 'Triggers' );
|
||||||
$breakCount = (int)(ceil(count($optTriggers)));
|
$breakCount = (int)(ceil(count($optTriggers)));
|
||||||
$breakCount = min( 3, $breakCount );
|
$breakCount = min( 3, $breakCount );
|
||||||
$optCount = 0;
|
$optCount = 0;
|
||||||
foreach( $optTriggers as $optTrigger )
|
foreach( $optTriggers as $optTrigger ) {
|
||||||
{
|
if ( ( ! ZM_OPT_X10 ) && ( $optTrigger == 'X10' ) )
|
||||||
if ( !ZM_OPT_X10 && $optTrigger == 'X10' )
|
continue;
|
||||||
continue;
|
if ( $optCount && ($optCount%$breakCount == 0) )
|
||||||
if ( $optCount && ($optCount%$breakCount == 0) )
|
echo '</br>';
|
||||||
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 ) ) {
|
||||||
<input type="checkbox" name="newMonitor[Triggers][]" value="<?php echo $optTrigger ?>"<?php if ( isset($monitor->Triggers) && in_array( $optTrigger, $monitor->Triggers ) ) { ?> checked="checked"<?php } ?>/> <?php echo $optTrigger ?>
|
echo ' checked="checked"';
|
||||||
<?php
|
}
|
||||||
|
echo '/> '. $optTrigger ;
|
||||||
$optCount ++;
|
$optCount ++;
|
||||||
}
|
}
|
||||||
if ( !$optCount )
|
if ( !$optCount ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<em><?php echo translate('NoneAvailable') ?></em>
|
<em><?php echo translate('NoneAvailable') ?></em>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue