* Adjust code style.

This commit is contained in:
qiyu-xie
2021-07-28 11:37:59 +08:00
parent e2e4d0931b
commit b1eb2ca377
+76 -79
View File
@@ -13,75 +13,72 @@
<?php include '../../common/view/header.html.php';?>
<div class="main-row fade" id="mainRow">
<div class="main-col" data-min-width="400">
<div class="panel block-files block-sm no-margin">
<?php if($viewType == 'list'):?>
<?php if(!empty($files)):?>
<form class='main-table' id='fileForm' method='post' action='<?php echo inLink('batchDownload');?>' data-ride='table'>
<table class="table has-sort-head">
<thead>
<?php if($viewType == 'list'):?>
<?php if(!empty($files)):?>
<form class='main-table' id='fileForm' method='post' action='<?php echo inLink('batchDownload');?>' data-ride='table'>
<table class="table has-sort-head">
<thead>
<tr>
<?php $this->app->rawMethod = 'showfiles';?>
<?php $vars = "type=$type&objectID=$objectID&viewType=$viewType&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<th class="c-id">
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>"><label></label></div>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->doc->id);?>
</th>
<th class="c-name"><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->fileTitle);?></th>
<th class="w-300px"><?php common::printOrderLink('objectID', $orderBy, $vars, $lang->doc->source);?></th>
<th class="w-100px"><?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?></th>
<th class="w-100px"><?php common::printOrderLink('size', $orderBy, $vars, $lang->doc->size);?></th>
<th class="w-100px"><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?></th>
<th class="w-160px"><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
<th class="c-actions-1"><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($files as $file):?>
<?php if(empty($file->pathname)) continue;?>
<tr>
<?php $this->app->rawMethod = 'showfiles';?>
<?php $vars = "type=$type&objectID=$objectID&viewType=$viewType&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
<th class="c-id">
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
<td class="c-id">
<div class="checkbox-primary">
<input type='checkbox' name='fileIDList[<?php echo $file->id;?>]' value='<?php echo $file->id;?>' autocomplete='off' /><label></label>
</div>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->doc->id);?>
</th>
<th class="c-name"><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->fileTitle);?></th>
<th class="w-300px"><?php common::printOrderLink('objectID', $orderBy, $vars, $lang->doc->source);?></th>
<th class="w-100px"><?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?></th>
<th class="w-100px"><?php common::printOrderLink('size', $orderBy, $vars, $lang->doc->size);?></th>
<th class="w-100px"><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?></th>
<th class="w-160px"><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
<th class="c-actions-1"><?php echo $lang->actions;?></th>
<?php echo sprintf('%03d', $file->id);?>
</td>
<td>
<?php
if(in_array($file->extension, $config->file->imageExtensions))
{
echo "<div style='display: inline-block'><img width='19' height='19' src='$file->webPath'/></div>";
}
else
{
echo $fileIcon[$file->id];
}
?>
<?php echo str_replace('.' . $file->extension, '', $file->title);?>
</td>
<td><?php echo $lang->{$file->objectType}->common . ' : ';?><a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></td>
<td><?php echo $file->extension;?></td>
<td><?php echo number_format($file->size / 1024, 1) . 'K';?></td>
<td><?php echo isset($file->addedBy) ? zget($users, $file->addedBy) : '';?></td>
<td><?php echo isset($file->addedDate) ? substr($file->addedDate, 0, 10) : '';?></td>
<td class="c-actions"><?php common::printLink('file', 'download', "fileID=$file->id", '<i class="icon-import"></i>', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file);?></td>
</tr>
</thead>
<tbody>
<?php foreach($files as $file):?>
<?php if(empty($file->pathname)) continue;?>
<tr>
<td class="c-id">
<div class="checkbox-primary">
<input type='checkbox' name='fileIDList[<?php echo $file->id;?>]' value='<?php echo $file->id;?>' autocomplete='off' />
<label></label>
</div>
<?php echo sprintf('%03d', $file->id);?>
</td>
<td>
<?php
if(in_array($file->extension, $config->file->imageExtensions))
{
echo "<div style='display: inline-block'><img width='19' height='19' src='$file->webPath'/></div>";
}
else
{
echo $fileIcon[$file->id];
}
?>
<?php echo str_replace('.' . $file->extension, '', $file->title);?>
</td>
<td class="c-url"><?php echo $lang->{$file->objectType}->common . ' : ';?><a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></td>
<td><?php echo $file->extension;?></td>
<td><?php echo number_format($file->size / 1024 , 1) . 'K';?></td>
<td><?php echo isset($file->addedBy) ? zget($users, $file->addedBy) : '';?></td>
<td><?php echo isset($file->addedDate) ? substr($file->addedDate, 0, 10) : '';?></td>
<td class="c-actions"><?php common::printLink('file', 'download', "fileID=$file->id", '<i class="icon-import"></i>', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file);?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->doc->download, '', 'btn');?></div>
<div class="table-statistic"><?php echo $summary;?></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<?php else:?>
<div class='table-empty-tip text-muted'><?php echo $lang->pager->noRecord;?></div>
<?php endif?>
<?php else:?>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->doc->download, '', 'btn');?></div>
<div class="table-statistic"><?php echo $summary;?></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<?php else:?>
<div class='table-empty-tip text-muted'><?php echo $lang->pager->noRecord;?></div>
<?php endif?>
<?php else:?>
<div class="panel block-files block-sm no-margin">
<div class="panel-body">
<div class="row row-grid files-grid" data-size="300">
<?php foreach($files as $file):?>
@@ -103,20 +100,20 @@
?>
<div class='file'>
<a href='<?php echo $url;?>' title='<?php echo $file->title;?>' target='_blank' onclick="return downloadFile(<?php echo $file->id?>, '<?php echo $file->extension?>', <?php echo $imageWidth?>)">
<?php
$downloadLink = $this->createLink('file', 'download', "fileID=$file->id&mouse=left");
if(in_array($file->extension, $config->file->imageExtensions))
{
echo "<div class='img-holder' style='background-image: url($file->webPath)'><img src='$file->webPath'/></div>";
}
else
{
echo $fileIcon[$file->id];
}
?>
<?php
$downloadLink = $this->createLink('file', 'download', "fileID=$file->id&mouse=left");
if(in_array($file->extension, $config->file->imageExtensions))
{
echo "<div class='img-holder' style='background-image: url($file->webPath)'><img src='$file->webPath'/></div>";
}
else
{
echo $fileIcon[$file->id];
}
?>
</a>
<div class='file-name'><?php echo $file->title;?></a></div>
<div class='file-name text-muted'><?php echo $lang->{$file->objectType}->common . ' : ';?><a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>' title='<?php echo $sourcePairs[$file->objectType][$file->objectID];?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></div>
<div class='text-muted'><?php echo $lang->{$file->objectType}->common . ' : ';?><a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>' title='<?php echo $sourcePairs[$file->objectType][$file->objectID];?>'><?php echo $sourcePairs[$file->objectType][$file->objectID];?></a></div>
</div>
</div>
</div>
@@ -129,8 +126,8 @@
<?php endif?>
</div>
</div>
<?php endif?>
</div>
<?php endif?>
</div>
</div>