1
|
|
|
<?php
|
2
|
|
|
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
3
|
|
|
|
4
|
|
|
require_once(_XE_PATH_.'modules/board/board.view.php');
|
5
|
|
|
|
6
|
|
|
class boardMobile extends boardView
|
7
|
|
|
{
|
8
|
|
|
function init()
|
9
|
|
|
{
|
10
|
|
|
$oSecurity = new Security();
|
11
|
|
|
$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
|
12
|
|
|
|
13
|
|
|
if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
|
14
|
|
|
if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
|
15
|
|
|
if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
|
|
|
|
|
16
|
|
|
if($this->module_info->mobile_search_list_count) $this->search_list_count = $this->module_info->mobile_search_list_count;
|
|
|
|
|
17
|
|
|
if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
|
18
|
|
|
if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
|
19
|
|
|
$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
|
|
|
|
|
20
|
|
|
|
21
|
|
|
// $this->_getStatusNameListecret option backward compatibility
|
22
|
|
|
$oDocumentModel = getModel('document');
|
23
|
|
|
|
24
|
|
|
$statusList = $this->_getStatusNameList($oDocumentModel);
|
25
|
|
|
if(isset($statusList['SECRET']))
|
26
|
|
|
{
|
27
|
|
|
$this->module_info->secret = 'Y';
|
28
|
|
|
}
|
29
|
|
|
|
30
|
|
|
// use_category <=1.5.x, hide_category >=1.7.x
|
31
|
|
|
$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
|
32
|
|
View Code Duplication |
if($count_category)
|
33
|
|
|
{
|
34
|
|
|
if($this->module_info->hide_category)
|
35
|
|
|
{
|
36
|
|
|
$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
|
37
|
|
|
}
|
38
|
|
|
else if($this->module_info->use_category)
|
39
|
|
|
{
|
40
|
|
|
$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
|
41
|
|
|
}
|
42
|
|
|
else
|
43
|
|
|
{
|
44
|
|
|
$this->module_info->hide_category = 'N';
|
45
|
|
|
$this->module_info->use_category = 'Y';
|
46
|
|
|
}
|
47
|
|
|
}
|
48
|
|
|
else
|
49
|
|
|
{
|
50
|
|
|
$this->module_info->hide_category = 'Y';
|
51
|
|
|
$this->module_info->use_category = 'N';
|
52
|
|
|
}
|
53
|
|
|
|
54
|
|
|
/**
|
55
|
|
|
* check the consultation function, if the user is admin then swich off consultation function
|
56
|
|
|
* if the user is not logged, then disppear write document/write comment./ view document
|
57
|
|
|
**/
|
58
|
|
|
if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
|
59
|
|
|
{
|
60
|
|
|
$this->consultation = true;
|
|
|
|
|
61
|
|
|
if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
|
|
|
|
|
62
|
|
|
} else {
|
63
|
|
|
$this->consultation = false;
|
64
|
|
|
}
|
65
|
|
|
|
66
|
|
|
$oDocumentModel = getModel('document');
|
67
|
|
|
$extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
|
68
|
|
|
Context::set('extra_keys', $extra_keys);
|
69
|
|
|
|
70
|
|
|
$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
|
71
|
|
View Code Duplication |
if(!is_dir($template_path)||!$this->module_info->mskin)
|
72
|
|
|
{
|
73
|
|
|
$this->module_info->mskin = 'default';
|
74
|
|
|
$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
|
75
|
|
|
}
|
76
|
|
|
$this->setTemplatePath($template_path);
|
77
|
|
|
Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
|
78
|
|
|
}
|
79
|
|
|
|
80
|
|
|
function dispBoardCategory()
|
81
|
|
|
{
|
82
|
|
|
$this->dispBoardCategoryList();
|
83
|
|
|
$category_list = Context::get('category_list');
|
|
|
|
|
84
|
|
|
$this->setTemplateFile('category.html');
|
85
|
|
|
}
|
86
|
|
|
|
87
|
|
|
function getBoardCommentPage()
|
88
|
|
|
{
|
89
|
|
|
$document_srl = Context::get('document_srl');
|
90
|
|
|
$oDocumentModel =& getModel('document');
|
91
|
|
|
if(!$document_srl)
|
92
|
|
|
{
|
93
|
|
|
return new Object(-1, "msg_invalid_request");
|
94
|
|
|
}
|
95
|
|
|
|
96
|
|
|
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
|
97
|
|
|
{
|
98
|
|
|
return new Object(-1, "msg_not_permitted");
|
99
|
|
|
}
|
100
|
|
|
|
101
|
|
|
$oDocument = $oDocumentModel->getDocument($document_srl);
|
102
|
|
|
if(!$oDocument->isExists())
|
103
|
|
|
{
|
104
|
|
|
return new Object(-1, "msg_invalid_request");
|
105
|
|
|
}
|
106
|
|
|
Context::set('oDocument', $oDocument);
|
107
|
|
|
$oTemplate = TemplateHandler::getInstance();
|
108
|
|
|
$html = $oTemplate->compile($this->getTemplatePath(), "comment.html");
|
109
|
|
|
$this->add("html", $html);
|
110
|
|
|
}
|
111
|
|
|
|
112
|
|
|
function dispBoardMessage($msg_code)
|
113
|
|
|
{
|
114
|
|
|
$msg = Context::getLang($msg_code);
|
115
|
|
|
$oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
|
116
|
|
|
$oMessageObject->setError(-1);
|
117
|
|
|
$oMessageObject->setMessage($msg);
|
118
|
|
|
$oMessageObject->dispMessage();
|
119
|
|
|
|
120
|
|
|
$this->setTemplatePath($oMessageObject->getTemplatePath());
|
121
|
|
|
$this->setTemplateFile($oMessageObject->getTemplateFile());
|
122
|
|
|
}
|
123
|
|
|
}
|
124
|
|
|
|
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.