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

This commit is contained in:
zero 2007-03-06 02:48:55 +00:00
parent 6e781c4f14
commit 847c335901
6 changed files with 196 additions and 0 deletions

View file

@ -0,0 +1,64 @@
<?php
/**
* @class commentView
* @author zero (zero@nzeo.com)
* @brief comment 모듈의 view 클래스
**/
class commentView extends comment {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 목록 출력 (관리자용)
**/
function dispList() {
// 목록을 구하기 위한 옵션
$args->page = $page; ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
$args->sort_index = 'list_order'; ///< 소팅 값
// 목록 구함, comment->getCommentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
$oCommentModel = &getModel('comment');
$output = $oCommentModel->getCommentList($args);
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
$comment_count = count($output->data);
if($comment_count) {
foreach($output->data as $key => $val) {
$module_srl = $val->module_srl;
if(!in_array($module_srl, $module_srl_list)) $module_srl_list[] = $module_srl;
}
if(count($module_srl_list)) {
$oDB = &DB::getInstance();
$args->module_srls = implode(',',$module_srl_list);
$mid_output = $oDB->executeQuery('comment.getModuleInfoByModuleSrl', $args);
if($mid_output->data && !is_array($mid_output->data)) $mid_output->data = array($mid_output->data);
for($i=0;$i<count($mid_output->data);$i++) {
$mid_info = $mid_output->data[$i];
$module_list[$mid_info->module_srl] = $mid_info;
}
}
}
// 템플릿에 쓰기 위해서 comment_model::getCommentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('comment_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl.admin');
$this->setTemplateFile('comment_list');
}
}
?>

View file

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

View file

@ -0,0 +1,87 @@
<!--%import("filter/search.xml")-->
<!--%import("filter/delete_checked.xml")-->
<!--%import("js/document.js")-->
<!--#include("header.html")-->
<!-- 게시판 정보 -->
<div>
{$lang->document_count} : {number_format($total_count)},
{$lang->page_count} : {number_format($page)} / {number_format($total_page)}
</div>
<form action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
<input type="hidden" name="page" value="{$page}" />
<!-- 목록 -->
<div>
<table>
<tr>
<th colspan="2">{$lang->no}</th>
<th>{$lang->module}</th>
<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>
<td><input type="checkbox" name="cart" value="{$val->document_srl}" /></td>
<td><a href="#" onclick="window.open('./?mid={$val->mid}');return false">{$module_list[$val->module_srl]->browser_title}</a></td>
<td>
<a href="#" onclick="window.open('./?document_srl={$val->document_srl}');return false">{$val->title}</a>
<!--@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>
<input type="submit" value="{$lang->cmd_delete_checked_document}" />
</div>
</form>
<!-- 검색 -->
<div>
<form action="./" method="get" onsubmit="return procFilter(this, search)">
<input type="hidden" name="module" value="admin" />
<input type="hidden" name="mo" value="document" />
<input type="hidden" name="act" value="dispList" />
<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>

View file

@ -0,0 +1,13 @@
<filter name="delete_checked" module="document" act="procDeleteChecked" confirm_msg_code="confirm_delete">
<form>
<node target="cart" required="true" />
</form>
<parameter>
<param name="cart" target="cart" />
<param name="search_keyword" target="search_keyword" />
</parameter>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,14 @@
<filter name="search" module="document">
<form>
<node target="search_target" required="true" />
<node target="search_keyword" minlegnth="2" maxlength="40" required="true" />
</form>
<parameter>
<param name="search_target" target="search_target" />
<param name="search_keyword" target="search_keyword" />
</parameter>
<response callback_func="completeSearch">
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,10 @@
/**
* @file modules/document/tpl.admin/js/board.js
* @author zero <zero@nzeo.com>
* @biref board 모듈의 javascript
**/
/* 검색 실행 */
function completeSearch(fo_obj) {
fo_obj.submit();
}