mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Add select box to filter by module in document, comment, and file list
This commit is contained in:
parent
02c2f343cd
commit
e0033ac2fc
9 changed files with 105 additions and 60 deletions
|
|
@ -67,26 +67,12 @@ class CommentAdminView extends Comment
|
||||||
Context::set('secret_name_list', $secretNameList);
|
Context::set('secret_name_list', $secretNameList);
|
||||||
|
|
||||||
// Module List
|
// Module List
|
||||||
$oModuleModel = getModel('module');
|
$module_list = [];
|
||||||
$module_list = array();
|
$mod_output = executeQueryArray('comment.getModuleList');
|
||||||
$mod_srls = array();
|
foreach ($mod_output->data as $item)
|
||||||
foreach($output->data as $val)
|
|
||||||
{
|
{
|
||||||
$mod_srls[] = $val->module_srl;
|
$item->browser_title = Context::replaceUserLang($item->browser_title);
|
||||||
}
|
$module_list[$item->module_srl] = $item;
|
||||||
$mod_srls = array_unique($mod_srls);
|
|
||||||
$mod_srls_count = count($mod_srls);
|
|
||||||
if($mod_srls_count)
|
|
||||||
{
|
|
||||||
$columnList = array('module_srl', 'mid', 'browser_title');
|
|
||||||
$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
|
|
||||||
if($module_output && is_array($module_output))
|
|
||||||
{
|
|
||||||
foreach($module_output as $module)
|
|
||||||
{
|
|
||||||
$module_list[$module->module_srl] = $module;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Context::set('module_list', $module_list);
|
Context::set('module_list', $module_list);
|
||||||
|
|
||||||
|
|
@ -115,8 +101,9 @@ class CommentAdminView extends Comment
|
||||||
}
|
}
|
||||||
Context::set('member_nick_name', $member_nick_name);
|
Context::set('member_nick_name', $member_nick_name);
|
||||||
|
|
||||||
$security = new Security();
|
// Other search options
|
||||||
$security->encodeHTML('search_target', 'search_keyword');
|
Context::set('search_target', escape(Context::get('search_target'), false));
|
||||||
|
Context::set('search_keyword', escape(Context::get('search_keyword'), false));
|
||||||
|
|
||||||
// set the template
|
// set the template
|
||||||
$this->setTemplatePath($this->module_path . 'tpl');
|
$this->setTemplatePath($this->module_path . 'tpl');
|
||||||
|
|
|
||||||
20
modules/comment/queries/getModuleList.xml
Normal file
20
modules/comment/queries/getModuleList.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<query id="getModuleList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="module_srl" />
|
||||||
|
<column name="mid" />
|
||||||
|
<column name="browser_title" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<query operation="in" column="module_srl">
|
||||||
|
<tables>
|
||||||
|
<table name="comments" />
|
||||||
|
</tables>
|
||||||
|
<columns distinct="distinct">
|
||||||
|
<column name="module_srl" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -124,8 +124,13 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||||
<form action="./" method="get" class="search center x_input-append" onsubmit="return checkSearch(this)">
|
<form action="./" method="get" class="search center x_input-append" onsubmit="return checkSearch(this)">
|
||||||
<input type="hidden" name="module" value="{$module}" />
|
<input type="hidden" name="module" value="{$module}" />
|
||||||
<input type="hidden" name="act" value="{$act}" />
|
<input type="hidden" name="act" value="{$act}" />
|
||||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
|
||||||
<input type="hidden" name="error_return_url" value="" />
|
<input type="hidden" name="error_return_url" value="" />
|
||||||
|
<select name="module_srl" style="margin-right:4px">
|
||||||
|
<option value="">{lang('all')}</option>
|
||||||
|
<!--@foreach($module_list as $item)-->
|
||||||
|
<option value="{$item->module_srl}" <!--@if(isset($module_srl) && $module_srl == $item->module_srl)-->selected="selected"<!--@end-->>{$item->browser_title}</option>
|
||||||
|
<!--@endforeach-->
|
||||||
|
</select>
|
||||||
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
||||||
<!--@foreach(lang('comment.search_target_list') as $key => $val)-->
|
<!--@foreach(lang('comment.search_target_list') as $key => $val)-->
|
||||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||||
|
|
|
||||||
|
|
@ -82,26 +82,12 @@ class DocumentAdminView extends Document
|
||||||
Context::set('search_option', $search_option);
|
Context::set('search_option', $search_option);
|
||||||
|
|
||||||
// Module List
|
// Module List
|
||||||
$oModuleModel = getModel('module');
|
$module_list = [];
|
||||||
$module_list = array();
|
$mod_output = executeQueryArray('document.getModuleList');
|
||||||
$mod_srls = array();
|
foreach ($mod_output->data as $item)
|
||||||
foreach($output->data as $oDocument)
|
|
||||||
{
|
{
|
||||||
$mod_srls[] = $oDocument->get('module_srl');
|
$item->browser_title = Context::replaceUserLang($item->browser_title);
|
||||||
}
|
$module_list[$item->module_srl] = $item;
|
||||||
$mod_srls = array_unique($mod_srls);
|
|
||||||
$mod_srls_count = count($mod_srls);
|
|
||||||
if($mod_srls_count)
|
|
||||||
{
|
|
||||||
$columnList = array('module_srl', 'mid', 'browser_title');
|
|
||||||
$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
|
|
||||||
if($module_output && is_array($module_output))
|
|
||||||
{
|
|
||||||
foreach($module_output as $module)
|
|
||||||
{
|
|
||||||
$module_list[$module->module_srl] = $module;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Context::set('module_list', $module_list);
|
Context::set('module_list', $module_list);
|
||||||
|
|
||||||
|
|
@ -130,8 +116,10 @@ class DocumentAdminView extends Document
|
||||||
}
|
}
|
||||||
Context::set('member_nick_name', $member_nick_name);
|
Context::set('member_nick_name', $member_nick_name);
|
||||||
|
|
||||||
$security = new Security();
|
// Other search options
|
||||||
$security->encodeHTML('search_target', 'search_keyword');
|
Context::set('search_target', escape(Context::get('search_target'), false));
|
||||||
|
Context::set('search_keyword', escape(Context::get('search_keyword'), false));
|
||||||
|
Context::set('is_secret', Context::get('is_secret') === 'Y' ? 'Y' : 'N');
|
||||||
|
|
||||||
// Specify a template
|
// Specify a template
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
$this->setTemplatePath($this->module_path.'tpl');
|
||||||
|
|
|
||||||
20
modules/document/queries/getModuleList.xml
Normal file
20
modules/document/queries/getModuleList.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<query id="getModuleList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="module_srl" />
|
||||||
|
<column name="mid" />
|
||||||
|
<column name="browser_title" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<query operation="in" column="module_srl">
|
||||||
|
<tables>
|
||||||
|
<table name="documents" />
|
||||||
|
</tables>
|
||||||
|
<columns distinct="distinct">
|
||||||
|
<column name="module_srl" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -120,8 +120,13 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||||
<form action="./" method="get" class="search center x_input-append x_clearfix">
|
<form action="./" method="get" class="search center x_input-append x_clearfix">
|
||||||
<input type="hidden" name="module" value="{$module}" />
|
<input type="hidden" name="module" value="{$module}" />
|
||||||
<input type="hidden" name="act" value="{$act}" />
|
<input type="hidden" name="act" value="{$act}" />
|
||||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
|
||||||
<input type="hidden" name="error_return_url" value="" />
|
<input type="hidden" name="error_return_url" value="" />
|
||||||
|
<select name="module_srl" style="margin-right:4px">
|
||||||
|
<option value="">{lang('all')}</option>
|
||||||
|
<!--@foreach($module_list as $item)-->
|
||||||
|
<option value="{$item->module_srl}" <!--@if(isset($module_srl) && $module_srl == $item->module_srl)-->selected="selected"<!--@end-->>{$item->browser_title}</option>
|
||||||
|
<!--@endforeach-->
|
||||||
|
</select>
|
||||||
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
||||||
<!--@foreach(lang('document.search_target_list') as $key => $val)-->
|
<!--@foreach(lang('document.search_target_list') as $key => $val)-->
|
||||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class FileAdminView extends File
|
||||||
$file_list = array();
|
$file_list = array();
|
||||||
$document_list = array();
|
$document_list = array();
|
||||||
$comment_list = array();
|
$comment_list = array();
|
||||||
$module_list= array();
|
$module_list = array();
|
||||||
|
|
||||||
$doc_srls = array();
|
$doc_srls = array();
|
||||||
$com_srls = array();
|
$com_srls = array();
|
||||||
|
|
@ -162,20 +162,6 @@ class FileAdminView extends File
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Module List
|
|
||||||
$mod_srls_count = count($mod_srls);
|
|
||||||
if($mod_srls_count)
|
|
||||||
{
|
|
||||||
$columnList = array('module_srl', 'mid', 'browser_title');
|
|
||||||
$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
|
|
||||||
if($module_output && is_array($module_output))
|
|
||||||
{
|
|
||||||
foreach($module_output as $module)
|
|
||||||
{
|
|
||||||
$module_list[$module->module_srl] = $module;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($file_list as $srl => $file)
|
foreach($file_list as $srl => $file)
|
||||||
{
|
{
|
||||||
|
|
@ -186,6 +172,15 @@ class FileAdminView extends File
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Module list
|
||||||
|
$mod_output = executeQueryArray('comment.getModuleList');
|
||||||
|
foreach ($mod_output->data as $item)
|
||||||
|
{
|
||||||
|
$item->browser_title = Context::replaceUserLang($item->browser_title);
|
||||||
|
$module_list[$item->module_srl] = $item;
|
||||||
|
}
|
||||||
|
Context::set('module_list', $module_list);
|
||||||
|
|
||||||
Context::set('file_list', $file_list);
|
Context::set('file_list', $file_list);
|
||||||
Context::set('document_list', $document_list);
|
Context::set('document_list', $document_list);
|
||||||
Context::set('comment_list', $comment_list);
|
Context::set('comment_list', $comment_list);
|
||||||
|
|
|
||||||
20
modules/file/queries/getModuleList.xml
Normal file
20
modules/file/queries/getModuleList.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<query id="getModuleList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="module_srl" />
|
||||||
|
<column name="mid" />
|
||||||
|
<column name="browser_title" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<query operation="in" column="module_srl">
|
||||||
|
<tables>
|
||||||
|
<table name="files" />
|
||||||
|
</tables>
|
||||||
|
<columns distinct="distinct">
|
||||||
|
<column name="module_srl" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -184,8 +184,13 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||||
<form action="./" method="get" onsubmit="return checkSearch(this)" class="search center x_input-append">
|
<form action="./" method="get" onsubmit="return checkSearch(this)" class="search center x_input-append">
|
||||||
<input type="hidden" name="module" value="{$module}" />
|
<input type="hidden" name="module" value="{$module}" />
|
||||||
<input type="hidden" name="act" value="{$act}" />
|
<input type="hidden" name="act" value="{$act}" />
|
||||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
|
||||||
<input type="hidden" name="error_return_url" value="" />
|
<input type="hidden" name="error_return_url" value="" />
|
||||||
|
<select name="module_srl" style="margin-right:4px">
|
||||||
|
<option value="">{lang('all')}</option>
|
||||||
|
<!--@foreach($module_list as $item)-->
|
||||||
|
<option value="{$item->module_srl}" <!--@if(isset($module_srl) && $module_srl == $item->module_srl)-->selected="selected"<!--@end-->>{$item->browser_title}</option>
|
||||||
|
<!--@endforeach-->
|
||||||
|
</select>
|
||||||
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
||||||
<!--@foreach(lang('file.file_search_target_list') as $key => $val)-->
|
<!--@foreach(lang('file.file_search_target_list') as $key => $val)-->
|
||||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue