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

This commit is contained in:
zero 2007-03-06 02:23:10 +00:00
parent 0c844db533
commit f79b18f6cc
8 changed files with 131 additions and 152 deletions

View file

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

View file

@ -31,12 +31,32 @@
$oDocumentModel = &getModel('document'); $oDocumentModel = &getModel('document');
$output = $oDocumentModel->getDocumentList($args); $output = $oDocumentModel->getDocumentList($args);
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
$document_count = count($output->data);
if($document_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('document.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;
}
}
}
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count); Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page); Context::set('total_page', $output->total_page);
Context::set('page', $output->page); Context::set('page', $output->page);
Context::set('document_list', $output->data); Context::set('document_list', $output->data);
Context::set('page_navigation', $output->page_navigation); Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
// 템플릿에서 사용할 검색옵션 세팅 // 템플릿에서 사용할 검색옵션 세팅
$count_search_option = count($this->search_option); $count_search_option = count($this->search_option);

View file

@ -1,10 +1,12 @@
<?php <?php
/** /**
* @file : modules/document/lang/ko.lang.php * @file modules/document/lang/ko.lang.php
* @author : zero <zero@nzeo.com> * @author zero <zero@nzeo.com>
* @desc : 문서(document) 모듈의 기본 언어팩 * @brief 문서(document) 모듈의 기본 언어팩
**/ **/
$lang->msg_category_not_moved = "이동할 수가 없습니다";
$lang->msg_is_secret = '비밀글입니다'; $lang->module = "모듈";
$lang->msg_category_not_moved = "이동할 수가 없습니다";
$lang->msg_is_secret = '비밀글입니다';
?> ?>

View file

@ -6,7 +6,7 @@
<column name="*" /> <column name="*" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="category_srl" var="category_srl" /> <condition operation="equal" column="category_srl" var="category_srl" />
<group pipe="and"> <group pipe="and">
<condition operation="like" column="title" var="s_title" /> <condition operation="like" column="title" var="s_title" />

View file

@ -0,0 +1,76 @@
<!--%import("filter/search.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>
<!-- 목록 -->
<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>
<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,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>
* @desc : board 모듈의 javascript
**/
/* 검색 실행 */
function completeSearch(fo_obj) {
fo_obj.submit();
}

View file

@ -1,143 +0,0 @@
<!--%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}