파일목록에 정렬 기능 추가

This commit is contained in:
BJRambo 2022-12-18 00:58:46 +09:00
parent 90f6b8aad6
commit 5a2fe66063
3 changed files with 27 additions and 4 deletions

View file

@ -81,6 +81,7 @@ class fileAdminModel extends file
// Set variables
$args->sort_index = $obj->sort_index ?? null;
$args->order_type = $obj->order_type ?? 'desc';
$args->page = isset($obj->page) ? ($obj->page ? $obj->page : 1) : 1;
$args->list_count = isset($obj->list_count) ? ($obj->list_count? $obj->list_count : 20) : 20;
$args->page_count = isset($obj->page_count) ? ($obj->page_count? $obj->page_count : 10) : 10;

View file

@ -27,7 +27,8 @@ class fileAdminView extends file
$args->list_count = 30; // /< Number of documents that appear on a single page
$args->page_count = 10; // /< Number of pages that appear in the page navigation
$args->sort_index = 'file_srl'; // /< Sorting values
$args->sort_index = Context::get('sort_index') ?? 'file_srl'; // /< Sorting values
$args->order_type = Context::get('order_type') ?? null;
$args->isvalid = Context::get('isvalid');
$args->module_srl = Context::get('module_srl');
// Get a list

View file

@ -23,10 +23,31 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
<thead>
<tr>
<th scope="col">{$lang->file}</th>
<th scope="col" class="nowr">{$lang->file_size}</th>
<th scope="col" class="nowr">{$lang->cmd_download}</th>
<th scope="col" class="nowr">
<a href="{getUrl('', 'module', 'admin', 'act', 'dispFileAdminList', 'sort_index', 'file_size', 'order_type', ($order_type == 'asc') ? 'desc' : 'asc')}">
{$lang->file_size}
<block cond="$sort_index == 'file_size'">
<em cond="$order_type=='asc'"></em><em cond="$order_type != 'asc'"></em>
</block>
</a>
</th>
<th scope="col" class="nowr">
<a href="{getUrl('', 'module', 'admin', 'act', 'dispFileAdminList', 'sort_index', 'download_count', 'order_type', ($order_type == 'asc') ? 'desc' : 'asc')}">
{$lang->cmd_download}
<block cond="$sort_index == 'download_count'">
<em cond="$order_type=='asc'"></em><em cond="$order_type != 'asc'"></em>
</block>
</a>
</th>
<th scope="col" class="nowr">{$lang->author}</th>
<th scope="col" class="nowr">{$lang->date}</th>
<th scope="col" class="nowr">
<a href="{getUrl('', 'module', 'admin', 'act', 'dispFileAdminList', 'sort_index', 'regdate', 'order_type', ($order_type == 'asc') ? 'desc' : 'asc')}">
{$lang->date}
<block cond="$sort_index == 'regdate'">
<em cond="$order_type=='asc'"></em><em cond="$order_type != 'asc'"></em>
</block>
</a>
</th>
<th scope="col" class="nowr">{$lang->ipaddress}</th>
<th scope="col" class="nowr">{$lang->status}</th>
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>