From 94cdcb2e7c1b070fb04469f475f9677eb2c472dc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 21 Nov 2017 15:56:17 +0900 Subject: [PATCH] Allow dispBoardCategory() and dispBoardCommentPage() to be used in PC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 모바일에서만 사용할 수 있었던 dispBoardCategory() 액션을 PC에서도 사용할 수 있도록 변경함. (PC용 스킨에서 category.html 템플릿을 제공하는 경우에 한함) 모바일에서만 사용할 수 있었던 getBoardCommentPage() 액션의 이름을 dispBoardCommentPage()로 바꾸어 PC에서도 사용할 수 있도록 변경하고 기존의 모바일 getBoardCommentPage() 액션은 dispBoardCommentPage()로 연결함. (get으로 시작하는 액션명은 원래 model에서 써야 하는데 잘못 지정됨) 누가 모바일 스킨을 만들다가 필요해서 추가한 액션인 것 같은데 왜 PC에서는 사용할 수 없도록 해놓았는지 의문임. 비슷한 기능을 PC에서 사용하기 위해 getBoardCommentPageForPC() 등의 액션을 임의로 추가하여 사용하는 사이트가 은근히 많이 보임. --- modules/board/board.mobile.php | 31 ++------------------------- modules/board/board.view.php | 39 ++++++++++++++++++++++++++++++++-- modules/board/conf/module.xml | 3 ++- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/modules/board/board.mobile.php b/modules/board/board.mobile.php index 67ed1108d..8419078f1 100644 --- a/modules/board/board.mobile.php +++ b/modules/board/board.mobile.php @@ -87,36 +87,9 @@ class boardMobile extends boardView Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml'); } - function dispBoardCategory() - { - $this->dispBoardCategoryList(); - $category_list = Context::get('category_list'); - $this->setTemplateFile('category.html'); - } - function getBoardCommentPage() - { - $document_srl = Context::get('document_srl'); - $oDocumentModel =& getModel('document'); - if(!$document_srl) - { - return new Object(-1, "msg_invalid_request"); - } - - if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)) - { - return new Object(-1, "msg_not_permitted"); - } - - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) - { - return new Object(-1, "msg_invalid_request"); - } - Context::set('oDocument', $oDocument); - $oTemplate = TemplateHandler::getInstance(); - $html = $oTemplate->compile($this->getTemplatePath(), "comment.html"); - $this->add("html", $html); + { + $this->dispBoardCommentPage(); } function dispBoardMessage($msg_code) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 25f9b14a8..e0131824b 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -351,8 +351,6 @@ class boardView extends board * add javascript filters **/ Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml'); - -// return new Object(); } /** @@ -642,6 +640,43 @@ class boardView extends board $this->setTemplateFile('tag_list'); } + /** + * @brief display category list + */ + function dispBoardCategory() + { + $this->dispBoardCategoryList(); + $this->setTemplateFile('category.html'); + } + + /** + * @brief display comment page + */ + function dispBoardCommentPage() + { + $document_srl = Context::get('document_srl'); + if(!$document_srl) + { + return new Object(-1, "msg_invalid_request"); + } + + if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)) + { + return new Object(-1, "msg_not_permitted"); + } + + $oDocument = getModel('document')->getDocument($document_srl); + if(!$oDocument->isExists()) + { + return new Object(-1, "msg_invalid_request"); + } + Context::set('oDocument', $oDocument); + + $oTemplate = TemplateHandler::getInstance(); + $html = $oTemplate->compile($this->getTemplatePath(), 'comment.html'); + $this->add('html', $html); + } + /** * @brief display document write form **/ diff --git a/modules/board/conf/module.xml b/modules/board/conf/module.xml index a35626d44..e8850f127 100644 --- a/modules/board/conf/module.xml +++ b/modules/board/conf/module.xml @@ -75,7 +75,8 @@ - + +