fix x10 device edit

This commit is contained in:
Andrew Bauer 2020-10-01 16:03:58 -05:00
parent 186b8ac947
commit a80b4b91fb
1 changed files with 12 additions and 15 deletions

View File

@ -55,23 +55,20 @@ xhtmlHeaders(__FILE__, translate('Devices') );
<table id="contentTable" class="major" cellspacing="0"> <table id="contentTable" class="major" cellspacing="0">
<tbody> <tbody>
<?php <?php
foreach( $devices as $device ) foreach( $devices as $device ) {
{
if ( $device['Status'] == 'ON' ) if ( $device['Status'] == 'ON' ) {
{ $fclass = "infoText";
$fclass = "deviceCol infoText"; } else if ( $device['Status'] == 'OFF' ) {
} $fclass = "warnText";
elseif ( $device['Status'] == 'OFF' ) } else {
{ $fclass = "errorText";
$fclass = "deviceCol warnText"; }
}
else $str_opt = 'class="deviceCol" data-did="'.$device['Id'].'"';
{
$fclass = "deviceCol errorText";
}
?> ?>
<tr> <tr>
<td><?php echo makeLink( '?view=device&amp;did='.$device['Id'], '<span class="'.$fclass.'">'.validHtmlStr($device['Name']).' ('.validHtmlStr($device['KeyString']).')</span>', canEdit( 'Devices' ) ) ?></td> <td><?php echo makeLink( '#', '<span class="'.$fclass.'">'.validHtmlStr($device['Name']).' ('.validHtmlStr($device['KeyString']).')</span>', canEdit( 'Devices' ), $str_opt ) ?></td>
<td><input type="button" value="<?php echo translate('On') ?>"<?php echo ($device['Status'] != 'ON')?' class="set"':'' ?> onclick="switchDeviceOn( this, '<?php echo validHtmlStr($device['KeyString']) ?>' )"<?php echo canEdit( 'Devices' )?"":' disabled="disabled"' ?>/></td> <td><input type="button" value="<?php echo translate('On') ?>"<?php echo ($device['Status'] != 'ON')?' class="set"':'' ?> onclick="switchDeviceOn( this, '<?php echo validHtmlStr($device['KeyString']) ?>' )"<?php echo canEdit( 'Devices' )?"":' disabled="disabled"' ?>/></td>
<td><input type="button" value="<?php echo translate('Off') ?>"<?php echo ($device['Status'] != 'OFF')?' class="set"':'' ?> onclick="switchDeviceOff( this, '<?php echo validHtmlStr($device['KeyString']) ?>' )"<?php echo canEdit( 'Devices' )?"":' disabled="disabled"' ?>/></td> <td><input type="button" value="<?php echo translate('Off') ?>"<?php echo ($device['Status'] != 'OFF')?' class="set"':'' ?> onclick="switchDeviceOff( this, '<?php echo validHtmlStr($device['KeyString']) ?>' )"<?php echo canEdit( 'Devices' )?"":' disabled="disabled"' ?>/></td>
<td><input type="checkbox" name="markDids[]" value="<?php echo $device['Id'] ?>" onclick="configureButtons( this, 'markDids' );"<?php if ( !canEdit( 'Devices' ) ) {?> disabled="disabled"<?php } ?>/></td> <td><input type="checkbox" name="markDids[]" value="<?php echo $device['Id'] ?>" onclick="configureButtons( this, 'markDids' );"<?php if ( !canEdit( 'Devices' ) ) {?> disabled="disabled"<?php } ?>/></td>