mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 03:09:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@454 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
825ea283b6
commit
a45441815a
6 changed files with 276 additions and 3 deletions
|
|
@ -7,17 +7,125 @@
|
|||
|
||||
class pagemakerView extends pagemaker {
|
||||
|
||||
var $module_srl = 0;
|
||||
var $list_count = 20;
|
||||
var $page_count = 10;
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// pagemaker 모듈로 등록된 module_srl을 구함
|
||||
$oPagemakerModel = &getModel('pagemaker');
|
||||
$this->module_srl = $oPagemakerModel->getModuleSrl();
|
||||
|
||||
// template path 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl.admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력 (관리자용)
|
||||
* @brief 관리자에서 요청될때 초기화 할 것들을 정리
|
||||
**/
|
||||
function initAdmin() {
|
||||
|
||||
// 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅
|
||||
/*
|
||||
if($this->module_info->use_category=='Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$this->category_list = $oDocumentModel->getCategoryList($this->module_srl);
|
||||
Context::set('category_list', $this->category_list);
|
||||
}
|
||||
*/
|
||||
|
||||
// 에디터 세팅
|
||||
$editor = "default";
|
||||
Context::set('editor', $editor);
|
||||
$editor_path = sprintf("./editor/%s/", $editor);
|
||||
Context::set('editor_path', $editor_path);
|
||||
Context::loadLang($editor_path);
|
||||
|
||||
// 템플릿에서 사용할 변수를 Context::set()
|
||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue