Merge branch 'iconnor-updated-console' into storageareas

This commit is contained in:
Isaac Connor 2016-05-06 11:42:46 -04:00
commit be4f155160
2 changed files with 13 additions and 24 deletions

View File

@ -222,8 +222,19 @@ echo $Storage->Name();
{ {
?> ?>
<td class="colOrder"> <td class="colOrder">
<?php echo makeLink( '?view='.$view.'&amp;action=sequence&amp;mid='.$monitor['Id'].'&amp;smid='.$seqIdUpList[$monitor['Id']], '<img src="'.$seqUpFile.'" alt="Up"/>', $monitor_i > 0 ) ?> <?php
<?php echo makeLink( '?view='.$view.'&amp;action=sequence&amp;mid='.$monitor['Id'].'&amp;smid='.$seqIdDownList[$monitor['Id']], '<img src="'.$seqDownFile.'" alt="Down"/>', $monitor_i<count($displayMonitors)-1 ) ?></td> if ( $monitor_i ) {
echo makeLink( '?view='.$view.'&amp;action=sequence&amp;mid='.$monitor['Id'].'&amp;smid='.$displayMonitors[$monitor_i-1]['Id'], '<img src="'.$seqUpFile.'" alt="Up"/>' );
} else {
echo '<img src="'.$seqUpFile.'" alt="Up"/>';
}
if ( $monitor_i<count($displayMonitors)-1 ) {
echo makeLink( '?view='.$view.'&amp;action=sequence&amp;mid='.$monitor['Id'].'&amp;smid='.$displayMonitors[$monitor_i+1]['Id'], '<img src="'.$seqDownFile.'" alt="Down"/>' );
} else {
echo '<img src="'.$seqDownFile.'" alt="Down"/>';
}
?>
</td>
<?php <?php
} }
?> ?>

View File

@ -36,7 +36,6 @@ $cycleCount = 0;
# Seems to me, we shouldn't need it, we could just test for # Seems to me, we shouldn't need it, we could just test for
$minSequence = 0; $minSequence = 0;
$maxSequence = 1; $maxSequence = 1;
$seqIdList = array();
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); $monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
$displayMonitors = array(); $displayMonitors = array();
for ( $i = 0; $i < count($monitors); $i++ ) for ( $i = 0; $i < count($monitors); $i++ )
@ -80,29 +79,8 @@ for ( $i = 0; $i < count($monitors); $i++ )
if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight;
} }
if ( $counts ) $monitors[$i] = array_merge( $monitors[$i], $counts ); if ( $counts ) $monitors[$i] = array_merge( $monitors[$i], $counts );
$seqIdList[] = $monitors[$i]['Id'];
$displayMonitors[] = $monitors[$i]; $displayMonitors[] = $monitors[$i];
} }
$lastId = 0;
$seqIdUpList = array();
foreach ( $seqIdList as $seqId )
{
if ( !empty($lastId) )
$seqIdUpList[$seqId] = $lastId;
else
$seqIdUpList[$seqId] = $seqId;
$lastId = $seqId;
}
$lastId = 0;
$seqIdDownList = array();
foreach ( array_reverse($seqIdList) as $seqId )
{
if ( !empty($lastId) )
$seqIdDownList[$seqId] = $lastId;
else
$seqIdDownList[$seqId] = $seqId;
$lastId = $seqId;
}
$cycleWidth = $maxWidth; $cycleWidth = $maxWidth;
$cycleHeight = $maxHeight; $cycleHeight = $maxHeight;