diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 34dd72f1d..cd77a54d8 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -188,8 +188,7 @@ } $tmp_arr[$i] = implode(".",$tmp2_arr); } - if(is_array($tmp_arg)) $arg = implode("/",$tmp_arr); - else $args = $tmp_arr; + $arg = implode("/",$tmp_arr); if(substr($arg,0,2)=='./') $arg = substr($arg,2); // 1단계로 해당 tpl 내의 파일을 체크 diff --git a/modules/pagemaker/conf/module.xml b/modules/pagemaker/conf/module.xml index 4b85f373f..13ddab985 100644 --- a/modules/pagemaker/conf/module.xml +++ b/modules/pagemaker/conf/module.xml @@ -3,5 +3,6 @@ + diff --git a/modules/pagemaker/pagemaker.model.php b/modules/pagemaker/pagemaker.model.php index ae34677ac..30edaa526 100644 --- a/modules/pagemaker/pagemaker.model.php +++ b/modules/pagemaker/pagemaker.model.php @@ -13,5 +13,17 @@ function init() { } + /** + * @brief pagemaker로 등록된 module_srl을 찾아서 return + * pagemaker의 내용은 게시판처럼 document에 저장이 된다. + * 설치시에 pagemaker 모듈을 modules에 등록을 하며 이 module_srl은 sequence값으로 입력되기에 찾아야한다. + **/ + function getModuleSrl() { + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByMid('pagemaker'); + $module_srl = $module_info->module_srl; + return $module_srl; + } + } ?> diff --git a/modules/pagemaker/pagemaker.view.php b/modules/pagemaker/pagemaker.view.php index 196099007..7d8f4df10 100644 --- a/modules/pagemaker/pagemaker.view.php +++ b/modules/pagemaker/pagemaker.view.php @@ -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'); + } + + } ?> diff --git a/modules/pagemaker/tpl.admin/list.html b/modules/pagemaker/tpl.admin/list.html new file mode 100644 index 000000000..8d2a958a3 --- /dev/null +++ b/modules/pagemaker/tpl.admin/list.html @@ -0,0 +1,76 @@ + +
+ {$lang->document_count} : {number_format($total_count)}, + {$lang->page_count} : {number_format($page)} / {number_format($total_page)} +
+ + +
+ + + + + + + + + + + + + + + + + + + +
{$lang->no} +
+ +
+
{$lang->title}{$lang->date}
{$no}{$category_list[$val->category_srl]->title} + {$val->title} + {zdate($val->regdate,"Y-m-d")}
+
+ + +
+ [{$lang->cmd_make}] +
+ + +
+
+ + + + + + +
+
+ + +
+ [{$lang->first_page}] + + + + {$page_no} + + [{$page_no}] + + + + [{$lang->last_page}] +
diff --git a/modules/pagemaker/tpl.admin/write_form.html b/modules/pagemaker/tpl.admin/write_form.html new file mode 100644 index 000000000..0dd16983c --- /dev/null +++ b/modules/pagemaker/tpl.admin/write_form.html @@ -0,0 +1,77 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$lang->category} + +
{$lang->title}
  + is_secret== "Y")-->checked="true" id="is_secret" /> + + + allow_comment != "N")-->checked="true" id="allow_comment" /> + + + lock_comment == "Y")-->checked="true" id="lock_comment" /> + + + allow_trackback != "N")-->checked="true" id="allow_trackback" /> + +
{$lang->content} + + +
{$lang->cmd_send_trackback} + + +
{$lang->tag} +
+ {$lang->about_tag} +
+ + +
+ +