인쇄 기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/trunk@1912 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-12 09:23:17 +00:00
parent 3d3cd94499
commit d0c8f54ed8
17 changed files with 81 additions and 0 deletions

View file

@ -63,6 +63,8 @@
</div>
</div>
<!--@end-->
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;">{$lang->cmd_print}</a>
</div>
<!-- 댓글/ 엮인글 정보 출력 -->

View file

@ -68,6 +68,8 @@
</div>
<ul class="replyAndTrackback">
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
<!--@if($grant->write_comment && $oDocument->allowComment()) -->
<li class="reply"><a href="#trackback_{$oDocument->document_srl}">{$lang->comment} <strong>{$oDocument->getCommentCount()}</strong></a></li>
<!--@end-->

View file

@ -104,6 +104,7 @@
<!-- 관련 링크 -->
<div>
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;">{$lang->cmd_print}</a>
<a href="{getUrl('document_srl','')}">[{$lang->cmd_list}]</a>
<a href="#" onclick="doVote();return false;">[{$lang->cmd_vote}]</a>

View file

@ -91,6 +91,7 @@
<!--@end-->
<li class="listButton">
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
<a href="{getUrl('document_srl','')}" class="button"><span>{$lang->cmd_list}</span></a>
<a href="#" onclick="doVote();return false;" class="button"><span>{$lang->cmd_vote}</span></a>
</li>

View file

@ -91,6 +91,7 @@
<!--@end-->
<li class="listButton">
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
<a href="{getUrl('document_srl','')}" class="button"><span>{$lang->cmd_list}</span></a>
<a href="#" onclick="doVote();return false;" class="button"><span>{$lang->cmd_vote}</span></a>
</li>

View file

@ -91,6 +91,7 @@
<!--@end-->
<li class="listButton">
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
<a href="{getUrl('document_srl','')}" class="button"><span>{$lang->cmd_list}</span></a>
<a href="#" onclick="doVote();return false;" class="button"><span>{$lang->cmd_vote}</span></a>
</li>

View file

@ -2,6 +2,8 @@
<module>
<grants />
<actions>
<action name="dispDocumentPrint" type="view" standalone="true" />
<action name="dispDocumentAdminList" type="view" admin_index="true" standalone="true" />
<action name="procDocumentAdminDeleteChecked" type="controller" standalone="true" />
</actions>

View file

@ -22,6 +22,7 @@
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminList');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentPrint');
return new Object();
}

View file

@ -0,0 +1,45 @@
<?php
/**
* @class documentView
* @author zero (zero@nzeo.com)
* @brief document 모듈의 View class
**/
class documentView extends document {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 문서 인쇄 기능
* 해당 글만 찾아서 그냥 출력해버린다;;
**/
function dispDocumentPrint() {
// 권한 체크
if(!$this->grant->view) return new Object(-1,'msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
$oDocumentModel = &getModel('document');
// 선택된 문서 표시를 위한 객체 생성
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
// 브라우저 타이틀 설정
Context::setBrowserTitle($oDocument->getTitleText());
Context::set('oDocument', $oDocument);
$this->module_info->layout_srl = null;
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('print_page');
}
}
?>

View file

@ -0,0 +1 @@
body { margin:10px; font-size:.75em; font-family:sans-serif;}

View file

@ -0,0 +1,11 @@
<!--%import("./css/document.css")-->
<!--%import("./css/document.css")-->
<h1>{$oDocument->getTitleText()}</h1><br />
{$oDocument->getContent()}
<script type="text/javascript">//<![CDATA[
xAddEventListener(window,'load',function() { window.print(); } );
//]]></script>