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

This commit is contained in:
zero 2007-02-07 07:09:44 +00:00
parent 299ee5fecb
commit 6a41163404
6 changed files with 45 additions and 11 deletions

View file

@ -85,6 +85,7 @@
// 권한변수 설정
Context::set('grant',$grant);
$this->grant = $grant;
// 모듈의 init method 실행
$this->init();

View file

@ -32,7 +32,6 @@
'write_document',
'write_comment',
'fileupload',
'management',
);
// 에디터
@ -78,7 +77,7 @@
// proc 초기화
function procInit() {/*{{{*/
// 파일 업로드일 경우 $act값을 procUploadFile() 로 변경
if(Context::isUploaded()) $this->act = 'procUploadFile';
if(Context::isUploaded() && $this->grant->fileupload) $this->act = 'procUploadFile';
return true;
}/*}}}*/
@ -93,6 +92,9 @@
// 출력 부분
function dispContent() {/*{{{*/
// 권한 체크
if(!$this->grant->list) return $this->dispMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$page = Context::get('page');
@ -101,7 +103,7 @@
$oDocument = getModule('document');
// document_srl이 있다면 해당 글을 구해오자
if($document_srl) {
if($this->grant->view && $document_srl) {
$document = $oDocument->getDocument($document_srl);
// 글이 찾아지지 않으면 무효화
@ -198,6 +200,9 @@
}/*}}}*/
function dispWriteForm() {/*{{{*/
// 권한 체크
if(!$this->grant->write_document) return $this->dispMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
@ -228,6 +233,9 @@
}/*}}}*/
function dispDeleteForm() {/*{{{*/
// 권한 체크
if(!$this->grant->write_document) return $this->dispMessage('msg_not_permitted');
// 삭제할 문서번호를 가져온다
$document_srl = Context::get('document_srl');
@ -249,6 +257,9 @@
}/*}}}*/
function dispCommentModifyForm() {/*{{{*/
// 권한 체크
if(!$this->grant->write_comment) return $this->dispMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$comment_srl = Context::get('comment_srl');
@ -275,6 +286,9 @@
}/*}}}*/
function dispCommentDeleteForm() {/*{{{*/
// 권한 체크
if(!$this->grant->write_comment) return $this->dispMessage('msg_not_permitted');
// 삭제할 댓글번호를 가져온다
$comment_srl = Context::get('comment_srl');
@ -296,6 +310,9 @@
}/*}}}*/
function dispCommentReplyForm() {/*{{{*/
// 권한 체크
if(!$this->grant->write_comment) return $this->dispMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$parent_srl = Context::get('comment_srl');
@ -346,10 +363,17 @@
$this->setTemplateFile('logout');
}/*}}}*/
function dispError() {/*{{{*/
function dispMessage($msg_code) {/*{{{*/
$msg = Context::getLang($msg_code);
if(!$msg) $msg = $msg_code;
Context::set('message', $msg);
$this->setTemplateFile('message');
}/*}}}*/
function dispRss() {/*{{{*/
// 권한 체크
if(!$this->grant->list) return $this->dispMessage('msg_not_permitted');
$page = Context::get('page');
// rss 제목 및 정보등을 추출
@ -370,10 +394,6 @@
exit();
}/*}}}*/
function dispAdminIndex() {/*{{{*/
$this->setTemplateFile('module_list');
}/*}}}*/
// 실행 부분
function procInsertDocument() {/*{{{*/
// 글작성시 필요한 변수를 가져옴

View file

@ -34,8 +34,8 @@
'write_document' => "게시물 작성 권한",
'write_comment' => "코멘트 작성 권한",
'fileupload' => "파일첨부 권한",
'management' => "관리 권한",
);
$lang->msg_not_permitted = "권한이 없습니다";
// 주절 주절..
$lang->about_mid = "모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자만 가능)";

View file

@ -23,7 +23,9 @@
<div>
{$lang->document_count} : {number_format($total_count)},
{$lang->page_count} : {number_format($page)} / {number_format($total_page)}
<!--@if($grant->view)-->
<a href="./rss.php?mid={$mid}">rss</a>
<!--@end-->
<!--@if($is_logged)-->
<a href="{getUrl('act','dispLogout')}">[{$lang->cmd_logout}]</a>
<!--@else-->
@ -35,7 +37,7 @@
</div>
<!-- 게시물 내용 include -->
<!--@if($document)-->
<!--@if($document && $grant->view)-->
<!--#include("./view_document.html")-->
<!--@end-->
@ -69,7 +71,11 @@
<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-->
@ -88,9 +94,13 @@
<!-- 버튼 -->
<div>
<!--@if($grant->write_document)-->
<a href="{getUrl('act','dispWriteForm','document_srl','')}">[{$lang->cmd_write}]</a>
<!--@end-->
</div>
<!--@if($grant->view)-->
<!-- 검색 -->
<div>
<form action="./" method="get" onsubmit="return procFormFilter(this, search, procSearch)">
@ -121,4 +131,6 @@
<a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}">[{$lang->last_page}]</a>
</div>
<!--@end-->
{$module_info->footer_text}

View file

@ -0,0 +1 @@
{$message}

View file

@ -103,6 +103,6 @@
<!--@end-->
<!-- 댓글 파일 include -->
<!--@if($document->allow_comment=='Y')-->
<!--@if($grant->write_comment&&$document->allow_comment=='Y')-->
<!--#include("./comment.html")-->
<!--@end-->