git-svn-id: http://xe-core.googlecode.com/svn/trunk@266 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-06 01:55:01 +00:00
parent d67ed7f81f
commit 0c844db533
4 changed files with 191 additions and 0 deletions

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<grants />
<actions>
<action name="dispList" type="view" admin_index="true" standalone="true" />
</actions>
</module>

View file

@ -10,5 +10,8 @@
// 공지사항용 값
var $notice_list_order = -2100000000;
// 관리자페이지에서 사용할 검색 옵션
var $search_option = array('title','content','title_content','user_name','user_id'); ///< 검색 옵션
}
?>

View file

@ -13,5 +13,43 @@
function init() {
}
/**
* @brief 목록 출력 (관리자용)
**/
function dispList() {
// 목록을 구하기 위한 옵션
$args->page = $page; ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
$args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...)
$args->search_keyword = Context::get('search_keyword'); ///< 검색어
$args->sort_index = 'list_order'; ///< 소팅 값
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
$oDocumentModel = &getModel('document');
$output = $oDocumentModel->getDocumentList($args);
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('document_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 템플릿에서 사용할 검색옵션 세팅
$count_search_option = count($this->search_option);
for($i=0;$i<$count_search_option;$i++) {
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
}
Context::set('search_option', $search_option);
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl.admin');
$this->setTemplateFile('document_list');
}
}
?>

View file

@ -0,0 +1,143 @@
<!--%import("filter/search.xml")-->
<!--#include("header.html")-->
{$module_info->header_text}
<!-- 게시판 제목/ 설명 -->
<!--@if($module_info->title || $module_info->desc)-->
<div>
<table>
<tr>
<td>{$module_info->title}</td>
</tr>
<!--@if($module_info->desc)-->
<tr>
<td>{nl2br($module_info->desc)}</td>
</tr>
<!--@end-->
</table>
</div>
<!--@end-->
<!-- 게시판 정보 -->
<div>
{$lang->document_count} : {number_format($total_count)},
{$lang->page_count} : {number_format($page)} / {number_format($total_page)}
<!--@if($grant->view)-->
<a href="{getUrl('act','dispRss')}">rss</a>
<!--@end-->
<!--@if($is_logged)-->
[
<a href="{getUrl('act','dispSignUpForm')}">{$lang->cmd_modify_member_info}</a> |
<a href="{getUrl('act','dispLogout')}">{$lang->cmd_logout}</a>
]
<!--@else-->
[
<a href="{getUrl('act','dispSignUpForm')}">{$lang->cmd_signup}</a> |
<a href="{getUrl('act','dispLogin')}">{$lang->cmd_login}</a>
]
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
<a href="{getUrl('module','admin','mo','board','act','dispAdminBoardInfo','module_srl',$module_srl,'mid','')}" target="_blank">[{$lang->cmd_management}]</a>
<!--@end-->
</div>
<!-- 게시물 내용 include -->
<!--@if($document && $grant->view)-->
<!--#include("./view_document.html")-->
<!--@end-->
<!-- 목록 -->
<div>
<table>
<tr>
<th>{$lang->no}</th>
<!--@if($category_list)-->
<th>
<form action="./" method="get">
<select name="category" onchange="doChangeCategory(this, '{getUrl('category','')}')" >
<option value="">{$lang->category}</option>
<!--@foreach($category_list as $val)-->
<option value="{$val->category_srl}" <!--@if($category==$val->category_srl)-->selected="true"<!--@end-->>{$val->title} <!--@if($val->document_count)-->({$val->document_count})<!--@end--></option>
<!--@end-->
</select>
</form>
</th>
<!--@end-->
<th>{$lang->title}</th>
<th>{$lang->user_name}</th>
<th>{$lang->readed_count}</th>
<th>{$lang->voted_count}</th>
<th>{$lang->date}</th>
</tr>
<!--@foreach($document_list as $no => $val)-->
<tr>
<td>{$no}</td>
<!--@if($category_list)-->
<td>{$category_list[$val->category_srl]->title}</td>
<!--@end-->
<td>
<!--@if($grant->view)-->
<a href="{getUrl('document_srl',$val->document_srl)}">{$val->title}</a>
<!--@else-->
{$val->title}
<!--@end-->
<!--@if($val->comment_count>0)-->
[{$val->comment_count}]
<!--@end-->
<!--@if($val->trackback_count>0)-->
[{$val->trackback_count}]
<!--@end-->
</td>
<td>{$val->user_name}</td>
<td>{$val->readed_count}</td>
<td>{$val->voted_count}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
</tr>
<!--@end-->
</table>
</div>
<!-- 버튼 -->
<div>
<!--@if($grant->write_document)-->
<a href="{getUrl('act','dispWrite','document_srl','')}">[{$lang->cmd_write}]</a>
<!--@end-->
</div>
<!--@if($grant->view)-->
<!-- 검색 -->
<div>
<form action="./" method="get" onsubmit="return procFilter(this, search)">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="category" value="{$category}" />
<select name="search_target">
<!--@foreach($search_option as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" />
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('search_target','','search_keyword','','page','1','document_srl','')}'"/>
</form>
</div>
<!-- 페이지 네비게이션 -->
<div>
<a href="{getUrl('page','','document_srl','')}">[{$lang->first_page}]</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
{$page_no}
<!--@else-->
<a href="{getUrl('page',$page_no,'document_srl','')}">[{$page_no}]</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}">[{$lang->last_page}]</a>
</div>
<!--@end-->
{$module_info->footer_text}