mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 15:21:40 +09:00
102 lines
3.8 KiB
PHP
102 lines
3.8 KiB
PHP
<?php
|
|
/**
|
|
* @class pagemakerView
|
|
* @author zero (zero@nzeo.com)
|
|
* @brief pagemaker 모듈의 view 클래스
|
|
**/
|
|
|
|
class pagemakerView extends pagemaker {
|
|
|
|
var $module_srl = 0;
|
|
var $list_count = 20;
|
|
var $page_count = 10;
|
|
|
|
/**
|
|
* @brief 초기화
|
|
**/
|
|
function init() {
|
|
// template path 지정
|
|
$this->setTemplatePath($this->module_path.'tpl.admin');
|
|
}
|
|
|
|
/**
|
|
* @brief 목록 출력
|
|
**/
|
|
function dispList() {
|
|
$this->initAdmin();
|
|
|
|
// 목록 구현에 필요한 변수들을 가져온다
|
|
$page_srl = Context::get('page_srl');
|
|
$page = Context::get('page');
|
|
|
|
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
|
|
$oDocumentModel = &getModel('document');
|
|
|
|
// 목록을 구하기 위한 옵션
|
|
$args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl
|
|
$args->page = $page; ///< 페이지
|
|
$args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수
|
|
$args->page_count = $this->page_count; ///< 페이지 네비게이션에 나타날 페이지의 수
|
|
|
|
$args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...)
|
|
$args->search_keyword = Context::get('search_keyword'); ///< 검색어
|
|
if($this->module_info->use_category=='Y') $args->category_srl = Context::get('category'); ///< 카테고리 사용시 선택된 카테고리
|
|
|
|
$args->sort_index = 'list_order'; ///< 소팅 값
|
|
|
|
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
|
|
$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->setTemplateFile('list');
|
|
}
|
|
|
|
/**
|
|
* @brief 작성 화면 출력
|
|
**/
|
|
function dispWrite() {
|
|
$this->initAdmin();
|
|
|
|
// GET parameter에서 document_srl을 가져옴
|
|
$document_srl = Context::get('document_srl');
|
|
|
|
// document 모듈 객체 생성
|
|
$oDocumentModel = &getModel('document');
|
|
|
|
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다
|
|
if($document_srl) {
|
|
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
|
if(!$document) {
|
|
unset($document_srl);
|
|
Context::set('document_srl','');
|
|
}
|
|
}
|
|
|
|
// 문서 번호가 없으면 새로운 값을 받아옴
|
|
if(!$document_srl) {
|
|
$oDB = &DB::getInstance();
|
|
$document_srl = $oDB->getNextSequence();
|
|
}
|
|
|
|
Context::set('document_srl',$document_srl);
|
|
Context::set('document', $document);
|
|
|
|
$this->setTemplateFile('write_form');
|
|
}
|
|
|
|
|
|
}
|
|
?>
|