rhymix/modules/board/board.mobile.php
Kijin Sung 94cdcb2e7c Allow dispBoardCategory() and dispBoardCommentPage() to be used in PC
모바일에서만 사용할 수 있었던 dispBoardCategory() 액션을 PC에서도 사용할 수
있도록 변경함. (PC용 스킨에서 category.html 템플릿을 제공하는 경우에 한함)

모바일에서만 사용할 수 있었던 getBoardCommentPage() 액션의 이름을
dispBoardCommentPage()로 바꾸어 PC에서도 사용할 수 있도록 변경하고
기존의 모바일 getBoardCommentPage() 액션은 dispBoardCommentPage()로 연결함.
(get으로 시작하는 액션명은 원래 model에서 써야 하는데 잘못 지정됨)

누가 모바일 스킨을 만들다가 필요해서 추가한 액션인 것 같은데
왜 PC에서는 사용할 수 없도록 해놓았는지 의문임.
비슷한 기능을 PC에서 사용하기 위해 getBoardCommentPageForPC() 등의 액션을
임의로 추가하여 사용하는 사이트가 은근히 많이 보임.
2017-11-21 15:56:17 +09:00

106 lines
3.8 KiB
PHP

<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
require_once(_XE_PATH_.'modules/board/board.view.php');
class boardMobile extends boardView
{
function init()
{
$oSecurity = new Security();
$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
if($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
// $this->_getStatusNameListecret option backward compatibility
$oDocumentModel = getModel('document');
$statusList = $this->_getStatusNameList($oDocumentModel);
if(isset($statusList['SECRET']))
{
$this->module_info->secret = 'Y';
}
// use_category <=1.5.x, hide_category >=1.7.x
$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
if($count_category)
{
if($this->module_info->hide_category)
{
$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
}
else if($this->module_info->use_category)
{
$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
}
else
{
$this->module_info->hide_category = 'N';
$this->module_info->use_category = 'Y';
}
}
else
{
$this->module_info->hide_category = 'Y';
$this->module_info->use_category = 'N';
}
/**
* check the consultation function, if the user is admin then swich off consultation function
* if the user is not logged, then disppear write document/write comment./ view document
**/
if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
{
$this->consultation = true;
if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
} else {
$this->consultation = false;
}
$oDocumentModel = getModel('document');
$extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
Context::set('extra_keys', $extra_keys);
if($this->module_info->mskin === '/USE_RESPONSIVE/')
{
$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
if(!is_dir($template_path)||!$this->module_info->skin)
{
$template_path = sprintf("%sskins/%s/",$this->module_path, 'default');
}
}
else
{
$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
if(!is_dir($template_path)||!$this->module_info->mskin)
{
$template_path = sprintf("%sm.skins/%s/",$this->module_path, 'default');
}
}
$this->setTemplatePath($template_path);
Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
}
function getBoardCommentPage()
{
$this->dispBoardCommentPage();
}
function dispBoardMessage($msg_code)
{
$msg = lang($msg_code);
$oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
$oMessageObject->setError(-1);
$oMessageObject->setMessage($msg);
$oMessageObject->dispMessage();
$this->setTemplatePath($oMessageObject->getTemplatePath());
$this->setTemplateFile($oMessageObject->getTemplateFile());
}
}