change layout from a table to something more bootstrappy. Use the new html_radio function generate the radio buttons for Format and Compression. Remove the data-on-click from the export button because we added setting up the click event in the javascript already

pull/2804/head
Isaac Connor 2019-12-02 13:38:23 -05:00
parent 2713565c84
commit 09a6e06132
1 changed files with 94 additions and 67 deletions

View File

@ -138,11 +138,13 @@ $disk_space_total = 0;
$event_count = 0;
while ( $event_row = dbFetchNext($results) ) {
$event = new ZM\Event($event_row);
$scale = max( reScale( SCALE_BASE, $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
echo '<input type="hidden" name="eids[]" value="'.validInt($event->Id())."\"/>\n";
$scale = max(reScale(SCALE_BASE, $event->DefaultScale(), ZM_WEB_DEFAULT_SCALE), SCALE_BASE);
?>
<tr<?php echo $event->Archived() ? ' class="archived"' : '' ?>>
<td class="colId"><a href="?view=event&amp;eid=<?php echo $event->Id().$filterQuery.$sortQuery ?>&amp;page=1"><?php echo $event->Id().($event->Archived()?'*':'') ?></a></td>
<td class="colId">
<input type="hidden" name="eids[]" value="<?php echo $event->Id()?>"/>
<a href="?view=event&amp;eid=<?php echo $event->Id().$filterQuery.$sortQuery ?>&amp;page=1"><?php echo $event->Id().($event->Archived()?'*':'') ?></a>
</td>
<td class="colName"><a href="?view=event&amp;eid=<?php echo $event->Id().$filterQuery.$sortQuery ?>&amp;page=1"><?php echo validHtmlStr($event->Name()).($event->Archived()?'*':'') ?></a></td>
<td class="colMonitorName"><?php echo makePopupLink( '?view=monitor&amp;mid='.$event->MonitorId(), 'zmMonitor'.$event->MonitorId(), 'monitor', $event->MonitorName(), canEdit( 'Monitors' ) ) ?></td>
<td class="colCause"><?php echo makePopupLink( '?view=eventdetail&amp;eid='.$event->Id(), 'zmEventDetail', 'eventdetail', validHtmlStr($event->Cause()), canEdit( 'Events' ), 'title="'.htmlspecialchars($event->Notes()).'"' ) ?></td>
@ -161,65 +163,90 @@ while ( $event_row = dbFetchNext($results) ) {
if ( ZM_WEB_EVENT_DISK_SPACE ) {
$disk_space_total += $event->DiskSpace();
$event_count += 1;
?>
<td class="colDiskSpace"><?php echo human_filesize($event->DiskSpace()) ?></td>
<?php
echo '<td class="colDiskSpace">'.human_filesize($event->DiskSpace()).'</td>';
}
unset($event);
echo '
</tr>
';
} # end foreach event
?>
</tbody>
<tfoot>
<td colspan="11"><?php echo $event_count ?> events</td>
<td class="colDiskSpace"><?php echo human_filesize($disk_space_total);?></td>
<tr>
<td colspan="11"><?php echo $event_count ?> events</td>
<?php
if ( ZM_WEB_EVENT_DISK_SPACE ) {
?>
<td class="colDiskSpace"><?php echo human_filesize($disk_space_total);?></td>
<?php
}
?>
</tr>
</tfoot>
</table>
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="exportDetail"><?php echo translate('ExportDetails') ?>
<input type="checkbox" name="exportDetail" value="1"<?php if ( !empty($_REQUEST['exportDetail']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/>
</label>
</div>
<div class="form-group">
<label for="exportFrames"><?php echo translate('ExportFrames') ?>
<input type="checkbox" name="exportFrames" value="1"<?php if ( !empty($_REQUEST['exportFrames']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/>
</label>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exportImages"><?php echo translate('ExportImageFiles') ?>
<input type="checkbox" name="exportImages" value="1"<?php if ( !empty($_REQUEST['exportImages']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/>
<table id="contentTable" class="minor">
<tbody>
<tr>
<th scope="row"><?php echo translate('ExportDetails') ?></th>
<td><input type="checkbox" name="exportDetail" value="1"<?php if ( !empty($_REQUEST['exportDetail']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportFrames') ?></th>
<td><input type="checkbox" name="exportFrames" value="1"<?php if ( !empty($_REQUEST['exportFrames']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportImageFiles') ?></th>
<td><input type="checkbox" name="exportImages" value="1"<?php if ( !empty($_REQUEST['exportImages']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportVideoFiles') ?></th>
<td><input type="checkbox" name="exportVideo" value="1"<?php if ( !empty($_REQUEST['exportVideo']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportMiscFiles') ?></th>
<td><input type="checkbox" name="exportMisc" value="1"<?php if ( !empty($_REQUEST['exportMisc']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportFormat') ?></th>
<td>
<input type="radio" id="exportFormatTar" name="exportFormat" value="tar"<?php if ( isset($_REQUEST['exportFormat']) && $_REQUEST['exportFormat'] == "tar" ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/><label for="exportFormatTar"><?php echo translate('ExportFormatTar') ?></label>
<input type="radio" id="exportFormatZip" name="exportFormat" value="zip"<?php if ( isset($_REQUEST['exportFormat']) && $_REQUEST['exportFormat'] == "zip" ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/><label for="exportFormatZip"><?php echo translate('ExportFormatZip') ?></label>
</td>
</tr>
<tr>
<th scope="row"><?php echo translate('ExportCompress') ?></th>
<td>
<input type="radio" id="exportCompress1" name="exportCompress" value="1"<?php echo ( isset($_REQUEST['exportCompress']) && $_REQUEST['exportCompress'] ) ? ' checked="checked"' : '' ?> data-on-click-this="configureExportButton"/>
<label for="exportCompress1"><?php echo translate('Yes') ?></label>
<input type="radio" id="exportCompress0" name="exportCompress" value="0"<?php echo ( isset($_REQUEST['exportCompress']) && $_REQUEST['exportCompress'] ) ? '' : ' checked="checked"' ?> data-on-click-this="configureExportButton"/>
<label for="exportCompress0"><?php echo translate('No') ?></label>
</td>
</tr>
</tbody>
</table>
<button type="button" id="exportButton" name="exportButton" value="Export" disabled="disabled" data-on-click="exportEvent"><?php echo translate('Export') ?></button>
</label>
</div>
<div class="form-group">
<label for="exportVideo"><?php echo translate('ExportVideoFiles') ?>
<input type="checkbox" name="exportVideo" value="1"<?php if ( !empty($_REQUEST['exportVideo']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/>
</label>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exportMisc"><?php echo translate('ExportMiscFiles') ?>
<input type="checkbox" name="exportMisc" value="1"<?php if ( !empty($_REQUEST['exportMisc']) ) { ?> checked="checked"<?php } ?> data-on-click-this="configureExportButton"/>
</label>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exportFormat"><?php echo translate('ExportFormat') ?>
<?php echo html_radio('exportFormat',
array('tar'=>translate('ExportFormatTar'), 'zip' => translate('ExportFormatZip')),
(isset($_REQUEST['exportFormat'])?$_REQUEST['exportFormat']:'zip'), # default to zip
array(),
array('data-on-click-this'=>'configureExportButton')
); ?>
</label>
</div>
<div class="form-group">
<label for="exportCompress"><?php echo translate('ExportCompress') ?>
<?php echo html_radio('exportCompress',
array('1'=>translate('Yes'), '0' => translate('No')),
(isset($_REQUEST['exportCompress'])?$_REQUEST['exportCompress']:'0'), # default to no
array(),
array('data-on-click-this'=>'configureExportButton')
); ?>
</label>
</div>
</div>
</div><!--row-->
<button type="button" id="exportButton" name="exportButton" value="Export" disabled="disabled"><?php echo translate('Export') ?></button>
</div><!--container-->
<?php
?>
<h2 id="exportProgress" class="
<?php
<h2 id="exportProgress" class="<?php
if ( isset($_REQUEST['generated']) ) {
if ( $_REQUEST['generated'] )
echo 'infoText';
@ -229,22 +256,22 @@ while ( $event_row = dbFetchNext($results) ) {
echo 'hidden warnText';
}
?>">
<span id="exportProgressText">
<?php
if ( isset($_REQUEST['generated']) ) {
if ( $_REQUEST['generated'] )
echo translate('ExportSucceeded');
else
echo translate('ExportFailed');
}
?></span>
<span id="exportProgressTicker"></span>
</h2>
<button type="button" data-on-click-this="startDownload" <?php echo empty($_REQUEST['generated'])? ' class="hidden"' : '' ?>><?php echo translate('Download') ?></button>
<input type="hidden" name="exportFile" value="<?php echo isset($_REQUEST['exportFile']) ? validHtmlStr($_REQUEST['exportFile']) : '' ?>"/>
<input type="hidden" name="generated" value="<?php echo isset($_REQUEST['generated']) ? validHtmlStr($_REQUEST['generated']) : '' ?>"/>
</form>
</div>
<span id="exportProgressText">
<?php
if ( isset($_REQUEST['generated']) ) {
if ( $_REQUEST['generated'] )
echo translate('ExportSucceeded');
else
echo translate('ExportFailed');
}
?></span>
<span id="exportProgressTicker"></span>
</h2>
<button type="button" data-on-click-this="startDownload" <?php echo empty($_REQUEST['generated'])? ' class="hidden"' : '' ?>><?php echo translate('Download') ?></button>
<input type="hidden" name="exportFile" value="<?php echo isset($_REQUEST['exportFile']) ? validHtmlStr($_REQUEST['exportFile']) : '' ?>"/>
<input type="hidden" name="generated" value="<?php echo isset($_REQUEST['generated']) ? validHtmlStr($_REQUEST['generated']) : '' ?>"/>
</form>
</div>
</div>
</body>
</html>