#580 관리자>컨텐츠의 문서/댓글 리스트에 모듈 정보 추가

This commit is contained in:
akasima 2014-03-18 17:06:11 +09:00
parent 1729c87aa7
commit 43fa3c0263
4 changed files with 62 additions and 4 deletions

View file

@ -52,7 +52,7 @@ class commentAdminView extends comment
// get a list by using comment->getCommentList.
$oCommentModel = getModel('comment');
$secretNameList = $oCommentModel->getSecretNameList();
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
$columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
$output = $oCommentModel->getTotalCommentList($args, $columnList);
// $modules = $oCommentModel->getDistinctModules();
@ -66,6 +66,31 @@ class commentAdminView extends comment
// Context::set('modules_list', $modules_list);
Context::set('page_navigation', $output->page_navigation);
Context::set('secret_name_list', $secretNameList);
$oModuleModel = getModel('module');
$module_list = array();
$mod_srls = array();
foreach($output->data as $val)
{
$mod_srls[] = $val->module_srl;
}
$mod_srls = array_unique($mod_srls);
// 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;
}
}
}
Context::set('module_list', $module_list);
// set the template
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('comment_list');

View file

@ -47,7 +47,12 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
<tbody>
<tr loop="$comment_list => $no, $val">
{@ $comment = $val->getContentText(200)}
<td><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
<td>
<block cond="isset($module_list[$val->module_srl])">
<a href="{getUrl('', 'mid', $module_list[$val->module_srl]->mid)}" target="_blank">{$module_list[$val->module_srl]->browser_title}</a> -
</block>
<a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a>
</td>
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->getNickName()}</a></td>
<td class="nowr">{number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))}</td>
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>