@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | { |
4 | 4 | function init() |
5 | 5 | { |
6 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
6 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
7 | 7 | $this->setTemplateFile(str_replace('dispSeo', '', $this->act)); |
8 | 8 | } |
9 | 9 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | function dispSeoAdminSetting() |
16 | 16 | { |
17 | 17 | $vars = Context::getRequestVars(); |
18 | - if(!$vars->setting_section) Context::set('setting_section', 'general'); |
|
18 | + if (!$vars->setting_section) Context::set('setting_section', 'general'); |
|
19 | 19 | |
20 | 20 | $config = $this->getConfig(); |
21 | 21 |
@@ -15,7 +15,9 @@ |
||
15 | 15 | function dispSeoAdminSetting() |
16 | 16 | { |
17 | 17 | $vars = Context::getRequestVars(); |
18 | - if(!$vars->setting_section) Context::set('setting_section', 'general'); |
|
18 | + if(!$vars->setting_section) { |
|
19 | + Context::set('setting_section', 'general'); |
|
20 | + } |
|
19 | 21 | |
20 | 22 | $config = $this->getConfig(); |
21 | 23 |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | $config->site_keywords = $vars->site_keywords; |
19 | 19 | |
20 | 20 | if ($vars->site_image) { |
21 | - $path = _XE_PATH_ . 'files/attach/site_image/'; |
|
21 | + $path = _XE_PATH_.'files/attach/site_image/'; |
|
22 | 22 | $ext = strtolower(array_pop(explode('.', $vars->site_image['name']))); |
23 | 23 | $timestamp = time(); |
24 | 24 | $filename = "site_image.{$timestamp}.{$ext}"; |
25 | - FileHandler::copyFile($vars->site_image['tmp_name'], $path . $filename); |
|
25 | + FileHandler::copyFile($vars->site_image['tmp_name'], $path.$filename); |
|
26 | 26 | $config->site_image = $filename; |
27 | 27 | |
28 | 28 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
29 | - if($oCacheHandler->isSupport()) { |
|
30 | - list($width, $height) = @getimagesize($path . $filename); |
|
29 | + if ($oCacheHandler->isSupport()) { |
|
30 | + list($width, $height) = @getimagesize($path.$filename); |
|
31 | 31 | $site_image_dimension = array( |
32 | 32 | 'width' => $width, |
33 | 33 | 'height' => $height |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $oModuleController->updateModuleConfig('seo', $config); |
60 | 60 | |
61 | - if($config->enable === 'Y') { |
|
61 | + if ($config->enable === 'Y') { |
|
62 | 62 | $this->moduleUpdate(); |
63 | 63 | } else { |
64 | 64 | // Delete Triggers |
@@ -10,14 +10,14 @@ |
||
10 | 10 | { |
11 | 11 | function updateConfig($args) |
12 | 12 | { |
13 | - if(!$args || !is_object($args)) |
|
13 | + if (!$args || !is_object($args)) |
|
14 | 14 | { |
15 | 15 | $args = new stdClass(); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $oModuleController = getController('module'); |
19 | 19 | $output = $oModuleController->updateModuleConfig('krzip', $args); |
20 | - if($output->toBool()) |
|
20 | + if ($output->toBool()) |
|
21 | 21 | { |
22 | 22 | unset($this->module_config); |
23 | 23 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | function init() |
12 | 12 | { |
13 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
13 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
14 | 14 | $this->setTemplateFile(lcfirst(str_replace('dispKrzipAdmin', '', $this->act))); |
15 | 15 | } |
16 | 16 |
@@ -14,20 +14,20 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function getConfig() |
16 | 16 | { |
17 | - if(!isset($this->module_config)) |
|
17 | + if (!isset($this->module_config)) |
|
18 | 18 | { |
19 | 19 | $oModuleModel = getModel('module'); |
20 | 20 | $module_config = $oModuleModel->getModuleConfig('krzip'); |
21 | - if(!is_object($module_config)) |
|
21 | + if (!is_object($module_config)) |
|
22 | 22 | { |
23 | 23 | $module_config = new stdClass(); |
24 | 24 | } |
25 | 25 | |
26 | 26 | /* 기본 설정 추가 */ |
27 | 27 | $default_config = self::$default_config; |
28 | - foreach($default_config as $key => $val) |
|
28 | + foreach ($default_config as $key => $val) |
|
29 | 29 | { |
30 | - if(!isset($module_config->{$key})) |
|
30 | + if (!isset($module_config->{$key})) |
|
31 | 31 | { |
32 | 32 | $module_config->{$key} = $val; |
33 | 33 | } |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function getMigratedPostcode($values) |
48 | 48 | { |
49 | - if(is_array($values)) |
|
49 | + if (is_array($values)) |
|
50 | 50 | { |
51 | 51 | $values = array_values($values); |
52 | 52 | |
53 | 53 | /* 5자리 우편변호 마이그레이션 */ |
54 | - if(count($values) == 4 && preg_match('/^\(?[0-9a-z\x20-]{5,10}\)?$/i', trim($values[0]))) |
|
54 | + if (count($values) == 4 && preg_match('/^\(?[0-9a-z\x20-]{5,10}\)?$/i', trim($values[0]))) |
|
55 | 55 | { |
56 | 56 | return $values; |
57 | 57 | } |
@@ -62,28 +62,28 @@ discard block |
||
62 | 62 | $output = array('', trim(preg_replace('/\s+/', ' ', $values)), '', '', ''); |
63 | 63 | |
64 | 64 | /* 우편번호 */ |
65 | - if(preg_match('/\(?([0-9-]{5,7})\)?/', $output[1], $matches)) |
|
65 | + if (preg_match('/\(?([0-9-]{5,7})\)?/', $output[1], $matches)) |
|
66 | 66 | { |
67 | 67 | $output[1] = trim(preg_replace('/\s+/', ' ', str_replace($matches[0], '', $output[1]))); |
68 | 68 | $output[0] = $matches[1]; |
69 | 69 | } |
70 | 70 | |
71 | 71 | /* 지번 주소 */ |
72 | - if(preg_match('/\(.+\s.+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/', $output[1], $matches)) |
|
72 | + if (preg_match('/\(.+\s.+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/', $output[1], $matches)) |
|
73 | 73 | { |
74 | 74 | $output[1] = trim(str_replace($matches[0], '', $output[1])); |
75 | 75 | $output[2] = $matches[0]; |
76 | 76 | } |
77 | 77 | |
78 | 78 | /* 부가 정보 */ |
79 | - if(preg_match('/\(.+[읍면동리(마을)(0-9+가)](?:,.*)?\)/u', $output[1], $matches)) |
|
79 | + if (preg_match('/\(.+[읍면동리(마을)(0-9+가)](?:,.*)?\)/u', $output[1], $matches)) |
|
80 | 80 | { |
81 | 81 | $output[1] = trim(str_replace($matches[0], '', $output[1])); |
82 | 82 | $output[4] = $matches[0]; |
83 | 83 | } |
84 | 84 | |
85 | 85 | /* 상세 주소 */ |
86 | - if(preg_match('/^(.+ [가-힝]+[0-9]*[동리로길]\s*[0-9-]+(?:번지?)?),?\s+(.+)$/u', $output[1], $matches)) |
|
86 | + if (preg_match('/^(.+ [가-힝]+[0-9]*[동리로길]\s*[0-9-]+(?:번지?)?),?\s+(.+)$/u', $output[1], $matches)) |
|
87 | 87 | { |
88 | 88 | $output[1] = trim($matches[1]); |
89 | 89 | $output[3] = trim($matches[2]); |
@@ -100,17 +100,17 @@ discard block |
||
100 | 100 | function getKrzipCodeList($query) |
101 | 101 | { |
102 | 102 | $module_config = $this->getConfig(); |
103 | - if($module_config->api_handler != 1) |
|
103 | + if ($module_config->api_handler != 1) |
|
104 | 104 | { |
105 | 105 | return $this->makeObject(-1, 'msg_invalid_request'); |
106 | 106 | } |
107 | - if(!isset($query)) |
|
107 | + if (!isset($query)) |
|
108 | 108 | { |
109 | 109 | $query = Context::get('query'); |
110 | 110 | } |
111 | 111 | |
112 | 112 | $query = trim(strval($query)); |
113 | - if($query === '') |
|
113 | + if ($query === '') |
|
114 | 114 | { |
115 | 115 | return $this->stop('msg_krzip_no_query'); |
116 | 116 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $output = $this->getEpostapiSearch($query); |
119 | 119 | /* XML Request에서는 Array 치환에 대한 문제로 이 함수를 제대로 사용할 수 없음 */ |
120 | 120 | $this->add('address_list', $output->get('address_list')); |
121 | - if(!$output->toBool()) |
|
121 | + if (!$output->toBool()) |
|
122 | 122 | { |
123 | 123 | return $output; |
124 | 124 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @note 우체국 우편번호 API는 검색어를 EUC-KR로 넘겨주어야 함 |
137 | 137 | */ |
138 | 138 | $encoding = strtoupper(mb_detect_encoding($query)); |
139 | - if($encoding !== 'EUC-KR') |
|
139 | + if ($encoding !== 'EUC-KR') |
|
140 | 140 | { |
141 | 141 | $query = iconv($encoding, 'EUC-KR', $query); |
142 | 142 | } |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | |
171 | 171 | $oXmlParser = new XmlParser(); |
172 | 172 | $result = $oXmlParser->parse($buff); |
173 | - if($result->error) |
|
173 | + if ($result->error) |
|
174 | 174 | { |
175 | 175 | $err_msg = trim($result->error->message->body); |
176 | - if(!$err_msg) |
|
176 | + if (!$err_msg) |
|
177 | 177 | { |
178 | 178 | $err_code = intval(str_replace('ERR-', '', $result->error->error_code->body)); |
179 | - switch($err_code) |
|
179 | + switch ($err_code) |
|
180 | 180 | { |
181 | 181 | case 1: |
182 | 182 | $err_msg = 'msg_krzip_is_maintenance'; |
@@ -195,23 +195,23 @@ discard block |
||
195 | 195 | |
196 | 196 | return $this->makeObject(-1, $err_msg); |
197 | 197 | } |
198 | - if(!$result->post) |
|
198 | + if (!$result->post) |
|
199 | 199 | { |
200 | 200 | return $this->makeObject(-1, 'msg_krzip_riddling_wrong'); |
201 | 201 | } |
202 | 202 | |
203 | 203 | $item_list = $result->post->itemlist->item; |
204 | - if(!is_array($item_list)) |
|
204 | + if (!is_array($item_list)) |
|
205 | 205 | { |
206 | 206 | $item_list = array($item_list); |
207 | 207 | } |
208 | - if(!$item_list) |
|
208 | + if (!$item_list) |
|
209 | 209 | { |
210 | 210 | return $this->makeObject(-1, 'msg_krzip_no_result'); |
211 | 211 | } |
212 | 212 | |
213 | 213 | $addr_list = array(); |
214 | - foreach($item_list as $key => $val) |
|
214 | + foreach ($item_list as $key => $val) |
|
215 | 215 | { |
216 | 216 | $postcode = $val->postcd->body; |
217 | 217 | $road_addr = $val->address->body; |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | $detail = ''; |
220 | 220 | $extra = ''; |
221 | 221 | |
222 | - if(preg_match('/\((?<detail>.+[읍면동리(마을)(0-9+가)](?:,.*)?)\)/', $road_addr, $matches)) |
|
222 | + if (preg_match('/\((?<detail>.+[읍면동리(마을)(0-9+가)](?:,.*)?)\)/', $road_addr, $matches)) |
|
223 | 223 | { |
224 | 224 | $road_addr = trim(str_replace($matches[0], '', $road_addr)); |
225 | - $extra = '(' . $matches['detail'] . ')'; |
|
225 | + $extra = '('.$matches['detail'].')'; |
|
226 | 226 | } |
227 | - if(preg_match('/\((?<detail>.+[읍면동리(마을)(빌딩)(0-9+가)](?:,.*)?)\)/', $jibun_addr, $matches)) |
|
227 | + if (preg_match('/\((?<detail>.+[읍면동리(마을)(빌딩)(0-9+가)](?:,.*)?)\)/', $jibun_addr, $matches)) |
|
228 | 228 | { |
229 | - $jibun_addr = '(' . trim(str_replace($matches[0], '', $jibun_addr)) . ')'; |
|
229 | + $jibun_addr = '('.trim(str_replace($matches[0], '', $jibun_addr)).')'; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $addr_list[] = array( |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | $api_name = strval(self::$api_list[$template_config->api_handler]); |
263 | 263 | $oTemplate = TemplateHandler::getInstance(); |
264 | - $output = $oTemplate->compile($this->module_path . 'tpl', 'template.' . $api_name); |
|
264 | + $output = $oTemplate->compile($this->module_path.'tpl', 'template.'.$api_name); |
|
265 | 265 | debugPrint($output); |
266 | 266 | return $output; |
267 | 267 | } |
@@ -19,13 +19,13 @@ |
||
19 | 19 | |
20 | 20 | $oKrzipController = getController('krzip'); |
21 | 21 | $output = $oKrzipController->updateConfig($module_config); |
22 | - if(!$output->toBool()) |
|
22 | + if (!$output->toBool()) |
|
23 | 23 | { |
24 | 24 | return $output; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $success_return_url = Context::get('success_return_url'); |
28 | - if($success_return_url) |
|
28 | + if ($success_return_url) |
|
29 | 29 | { |
30 | 30 | $return_url = $success_return_url; |
31 | 31 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | if($success_return_url) |
29 | 29 | { |
30 | 30 | $return_url = $success_return_url; |
31 | - } |
|
32 | - else |
|
31 | + } else |
|
33 | 32 | { |
34 | 33 | $return_url = getNotEncodedUrl('', 'module', 'krzip', 'act', 'dispKrzipAdminConfig'); |
35 | 34 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | function init() |
12 | 12 | { |
13 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
13 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /** |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | $oKrzipModel = getModel('krzip'); |
24 | 24 | $module_config = $oKrzipModel->getConfig(); |
25 | 25 | $module_config->sequence_id = ++self::$sequence_id; |
26 | - if(!isset($api_handler) || !isset(self::$api_list[$api_handler])) |
|
26 | + if (!isset($api_handler) || !isset(self::$api_list[$api_handler])) |
|
27 | 27 | { |
28 | 28 | $api_handler = $module_config->api_handler; |
29 | 29 | } |
30 | 30 | |
31 | 31 | Context::set('template_config', $module_config); |
32 | - $this->setTemplateFile('searchForm.' . self::$api_list[$api_handler]); |
|
32 | + $this->setTemplateFile('searchForm.'.self::$api_list[$api_handler]); |
|
33 | 33 | $this->setLayoutPath('./common/tpl/'); |
34 | 34 | $this->setLayoutFile('popup_layout'); |
35 | 35 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | $skin = $this->member_config->skin; |
27 | 27 | // Set the template path |
28 | - if(!$skin) |
|
28 | + if (!$skin) |
|
29 | 29 | { |
30 | 30 | $skin = 'default'; |
31 | 31 | $template_path = sprintf('%sskins/%s', $this->module_path, $skin); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $oLayoutModel = getModel('layout'); |
50 | 50 | $layout_info = $oLayoutModel->getLayout($this->member_config->layout_srl); |
51 | - if($layout_info) |
|
51 | + if ($layout_info) |
|
52 | 52 | { |
53 | 53 | $this->module_info->layout_srl = $this->member_config->layout_srl; |
54 | 54 | $this->setLayoutPath($layout_info->path); |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | $oMemberModel = getModel('member'); |
64 | 64 | $logged_info = Context::get('logged_info'); |
65 | 65 | // Don't display member info to non-logged user |
66 | - if(!$logged_info->member_srl) return $this->stop('msg_not_permitted'); |
|
66 | + if (!$logged_info->member_srl) return $this->stop('msg_not_permitted'); |
|
67 | 67 | |
68 | 68 | $member_srl = Context::get('member_srl'); |
69 | - if(!$member_srl && Context::get('is_logged')) |
|
69 | + if (!$member_srl && Context::get('is_logged')) |
|
70 | 70 | { |
71 | 71 | $member_srl = $logged_info->member_srl; |
72 | 72 | } |
73 | - elseif(!$member_srl) |
|
73 | + elseif (!$member_srl) |
|
74 | 74 | { |
75 | 75 | return $this->dispMemberSignUpForm(); |
76 | 76 | } |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | unset($member_info->email_id); |
83 | 83 | unset($member_info->email_host); |
84 | 84 | |
85 | - if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl)) |
|
85 | + if ($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl)) |
|
86 | 86 | { |
87 | - $start = strpos($member_info->email_address, '@')+1; |
|
87 | + $start = strpos($member_info->email_address, '@') + 1; |
|
88 | 88 | $replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start)); |
89 | 89 | $member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start); |
90 | 90 | } |
91 | 91 | |
92 | - if(!$member_info->member_srl) return $this->dispMemberSignUpForm(); |
|
92 | + if (!$member_info->member_srl) return $this->dispMemberSignUpForm(); |
|
93 | 93 | |
94 | 94 | Context::set('memberInfo', get_object_vars($member_info)); |
95 | 95 | |
@@ -107,46 +107,46 @@ discard block |
||
107 | 107 | { |
108 | 108 | $logged_info = Context::get('logged_info'); |
109 | 109 | $displayDatas = array(); |
110 | - foreach($memberConfig->signupForm as $no=>$formInfo) |
|
110 | + foreach ($memberConfig->signupForm as $no=>$formInfo) |
|
111 | 111 | { |
112 | - if(!$formInfo->isUse) |
|
112 | + if (!$formInfo->isUse) |
|
113 | 113 | { |
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | |
117 | - if($formInfo->name == 'password' || $formInfo->name == 'find_account_question') |
|
117 | + if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question') |
|
118 | 118 | { |
119 | 119 | continue; |
120 | 120 | } |
121 | 121 | |
122 | - if($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y') |
|
122 | + if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y') |
|
123 | 123 | { |
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | |
127 | 127 | $item = $formInfo; |
128 | 128 | |
129 | - if($formInfo->isDefaultForm) |
|
129 | + if ($formInfo->isDefaultForm) |
|
130 | 130 | { |
131 | 131 | $item->title = Context::getLang($formInfo->name); |
132 | 132 | $item->value = $memberInfo->{$formInfo->name}; |
133 | 133 | |
134 | - if($formInfo->name == 'profile_image' && $memberInfo->profile_image) |
|
134 | + if ($formInfo->name == 'profile_image' && $memberInfo->profile_image) |
|
135 | 135 | { |
136 | 136 | $target = $memberInfo->profile_image; |
137 | 137 | $item->value = '<img src="'.$target->src.'" />'; |
138 | 138 | } |
139 | - elseif($formInfo->name == 'image_name' && $memberInfo->image_name) |
|
139 | + elseif ($formInfo->name == 'image_name' && $memberInfo->image_name) |
|
140 | 140 | { |
141 | 141 | $target = $memberInfo->image_name; |
142 | 142 | $item->value = '<img src="'.$target->src.'" />'; |
143 | 143 | } |
144 | - elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark) |
|
144 | + elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark) |
|
145 | 145 | { |
146 | 146 | $target = $memberInfo->image_mark; |
147 | 147 | $item->value = '<img src="'.$target->src.'" />'; |
148 | 148 | } |
149 | - elseif($formInfo->name == 'birthday' && $memberInfo->birthday) |
|
149 | + elseif ($formInfo->name == 'birthday' && $memberInfo->birthday) |
|
150 | 150 | { |
151 | 151 | $item->value = zdate($item->value, 'Y-m-d'); |
152 | 152 | } |
@@ -155,19 +155,19 @@ discard block |
||
155 | 155 | { |
156 | 156 | $item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title; |
157 | 157 | $orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value; |
158 | - if($formInfo->type=='tel' && is_array($orgValue)) |
|
158 | + if ($formInfo->type == 'tel' && is_array($orgValue)) |
|
159 | 159 | { |
160 | 160 | $item->value = implode('-', $orgValue); |
161 | 161 | } |
162 | - elseif($formInfo->type=='kr_zip' && is_array($orgValue)) |
|
162 | + elseif ($formInfo->type == 'kr_zip' && is_array($orgValue)) |
|
163 | 163 | { |
164 | 164 | $item->value = implode(' ', $orgValue); |
165 | 165 | } |
166 | - elseif($formInfo->type=='checkbox' && is_array($orgValue)) |
|
166 | + elseif ($formInfo->type == 'checkbox' && is_array($orgValue)) |
|
167 | 167 | { |
168 | - $item->value = implode(", ",$orgValue); |
|
168 | + $item->value = implode(", ", $orgValue); |
|
169 | 169 | } |
170 | - elseif($formInfo->type=='date') |
|
170 | + elseif ($formInfo->type == 'date') |
|
171 | 171 | { |
172 | 172 | $item->value = zdate($orgValue, "Y-m-d"); |
173 | 173 | } |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | |
199 | 199 | $oMemberModel = getModel('member'); |
200 | 200 | // Get the member information if logged-in |
201 | - if($oMemberModel->isLogged()) return $this->stop('msg_already_logged'); |
|
201 | + if ($oMemberModel->isLogged()) return $this->stop('msg_already_logged'); |
|
202 | 202 | // call a trigger (before) |
203 | 203 | $trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config); |
204 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
204 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
205 | 205 | // Error appears if the member is not allowed to join |
206 | - if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled'); |
|
206 | + if ($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled'); |
|
207 | 207 | |
208 | 208 | $oMemberAdminView = getAdminView('member'); |
209 | 209 | $formTags = $oMemberAdminView->_getMemberInputTag($member_info); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | { |
227 | 227 | $logged_info = Context::get('logged_info'); |
228 | 228 | $oMemberModel = getModel('member'); |
229 | - if(!$oMemberModel->isLogged() || empty($logged_info)) |
|
229 | + if (!$oMemberModel->isLogged() || empty($logged_info)) |
|
230 | 230 | { |
231 | 231 | return $this->stop('msg_not_logged'); |
232 | 232 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $_SESSION['rechecked_password_step'] = 'INPUT_PASSWORD'; |
235 | 235 | |
236 | 236 | $templateFile = $this->getTemplatePath().'rechecked_password.html'; |
237 | - if(!is_readable($templateFile)) |
|
237 | + if (!is_readable($templateFile)) |
|
238 | 238 | { |
239 | 239 | $templatePath = sprintf('%sskins/default', $this->module_path); |
240 | 240 | $this->setTemplatePath($templatePath); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | function dispMemberModifyInfo() |
261 | 261 | { |
262 | - if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
262 | + if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
263 | 263 | { |
264 | 264 | $this->dispMemberModifyInfoBefore(); |
265 | 265 | return; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | $oMemberModel = getModel('member'); |
273 | 273 | // A message appears if the user is not logged-in |
274 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
274 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
275 | 275 | |
276 | 276 | $logged_info = Context::get('logged_info'); |
277 | 277 | $member_srl = $logged_info->member_srl; |
@@ -279,13 +279,13 @@ discard block |
||
279 | 279 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address', 'find_account_answer', 'homepage', 'blog', 'birthday', 'allow_mailing'); |
280 | 280 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
281 | 281 | $member_info->signature = $oMemberModel->getSignature($member_srl); |
282 | - Context::set('member_info',$member_info); |
|
282 | + Context::set('member_info', $member_info); |
|
283 | 283 | |
284 | 284 | // Get a list of extend join form |
285 | 285 | Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info)); |
286 | 286 | |
287 | 287 | // Editor of the module set for signing by calling getEditor |
288 | - if($member_info->member_srl) |
|
288 | + if ($member_info->member_srl) |
|
289 | 289 | { |
290 | 290 | $oEditorModel = getModel('editor'); |
291 | 291 | $option = new stdClass(); |
@@ -330,14 +330,14 @@ discard block |
||
330 | 330 | { |
331 | 331 | $oMemberModel = getModel('member'); |
332 | 332 | // A message appears if the user is not logged-in |
333 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
333 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
334 | 334 | |
335 | 335 | $logged_info = Context::get('logged_info'); |
336 | 336 | $member_srl = $logged_info->member_srl; |
337 | 337 | |
338 | 338 | $module_srl = Context::get('module_srl'); |
339 | - Context::set('module_srl',Context::get('selected_module_srl')); |
|
340 | - Context::set('search_target','member_srls'); |
|
339 | + Context::set('module_srl', Context::get('selected_module_srl')); |
|
340 | + Context::set('search_target', 'member_srls'); |
|
341 | 341 | Context::set('search_keyword', implode(',', array($member_srl, $member_srl * -1))); |
342 | 342 | |
343 | 343 | |
@@ -358,12 +358,12 @@ discard block |
||
358 | 358 | { |
359 | 359 | $oMemberModel = getModel('member'); |
360 | 360 | // A message appears if the user is not logged-in |
361 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
361 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
362 | 362 | |
363 | 363 | $logged_info = Context::get('logged_info'); |
364 | 364 | $args = new stdClass(); |
365 | 365 | $args->member_srl = $logged_info->member_srl; |
366 | - $args->page = (int)Context::get('page'); |
|
366 | + $args->page = (int) Context::get('page'); |
|
367 | 367 | |
368 | 368 | $output = executeQuery('member.getScrapDocumentList', $args); |
369 | 369 | Context::set('total_count', $output->total_count); |
@@ -385,12 +385,12 @@ discard block |
||
385 | 385 | { |
386 | 386 | $oMemberModel = getModel('member'); |
387 | 387 | // A message appears if the user is not logged-in |
388 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
388 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
389 | 389 | // Get the saved document(module_srl is set to member_srl instead) |
390 | 390 | $logged_info = Context::get('logged_info'); |
391 | 391 | $args = new stdClass(); |
392 | 392 | $args->member_srl = $logged_info->member_srl; |
393 | - $args->page = (int)Context::get('page'); |
|
393 | + $args->page = (int) Context::get('page'); |
|
394 | 394 | $args->statusList = array('TEMP'); |
395 | 395 | |
396 | 396 | $oDocumentModel = getModel('document'); |
@@ -409,9 +409,9 @@ discard block |
||
409 | 409 | */ |
410 | 410 | function dispMemberLoginForm() |
411 | 411 | { |
412 | - if(Context::get('is_logged')) |
|
412 | + if (Context::get('is_logged')) |
|
413 | 413 | { |
414 | - Context::set('redirect_url', getNotEncodedUrl('act','')); |
|
414 | + Context::set('redirect_url', getNotEncodedUrl('act', '')); |
|
415 | 415 | $this->setTemplatePath($this->module_path.'tpl'); |
416 | 416 | $this->setTemplateFile('redirect.html'); |
417 | 417 | return; |
@@ -424,10 +424,10 @@ discard block |
||
424 | 424 | |
425 | 425 | $XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE'); |
426 | 426 | $XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR'); |
427 | - if($XE_VALIDATOR_ERROR == -11) |
|
428 | - Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description); |
|
427 | + if ($XE_VALIDATOR_ERROR == -11) |
|
428 | + Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE.$config->limit_day_description); |
|
429 | 429 | |
430 | - if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) |
|
430 | + if ($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) |
|
431 | 431 | Context::set('referer_url', getUrl('')); |
432 | 432 | else |
433 | 433 | Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | { |
444 | 444 | $oMemberModel = getModel('member'); |
445 | 445 | // A message appears if the user is not logged-in |
446 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
446 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
447 | 447 | |
448 | 448 | $memberConfig = $this->member_config; |
449 | 449 | |
@@ -452,9 +452,9 @@ discard block |
||
452 | 452 | |
453 | 453 | $columnList = array('member_srl', 'user_id'); |
454 | 454 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
455 | - Context::set('member_info',$member_info); |
|
455 | + Context::set('member_info', $member_info); |
|
456 | 456 | |
457 | - if($memberConfig->identifier == 'user_id') |
|
457 | + if ($memberConfig->identifier == 'user_id') |
|
458 | 458 | { |
459 | 459 | Context::set('identifier', 'user_id'); |
460 | 460 | Context::set('formValue', $member_info->user_id); |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | { |
476 | 476 | $oMemberModel = getModel('member'); |
477 | 477 | // A message appears if the user is not logged-in |
478 | - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
478 | + if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); |
|
479 | 479 | |
480 | 480 | $memberConfig = $this->member_config; |
481 | 481 | |
@@ -483,9 +483,9 @@ discard block |
||
483 | 483 | $member_srl = $logged_info->member_srl; |
484 | 484 | |
485 | 485 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
486 | - Context::set('member_info',$member_info); |
|
486 | + Context::set('member_info', $member_info); |
|
487 | 487 | |
488 | - if($memberConfig->identifier == 'user_id') |
|
488 | + if ($memberConfig->identifier == 'user_id') |
|
489 | 489 | { |
490 | 490 | Context::set('identifier', 'user_id'); |
491 | 491 | Context::set('formValue', $member_info->user_id); |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | { |
507 | 507 | $oMemberController = getController('member'); |
508 | 508 | $output = $oMemberController->procMemberLogout(); |
509 | - if(!$output->redirect_url) |
|
509 | + if (!$output->redirect_url) |
|
510 | 510 | $this->setRedirectUrl(getNotEncodedUrl('act', '')); |
511 | 511 | else |
512 | 512 | $this->setRedirectUrl($output->redirect_url); |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | function dispMemberFindAccount() |
530 | 530 | { |
531 | - if(Context::get('is_logged')) return $this->stop('already_logged'); |
|
531 | + if (Context::get('is_logged')) return $this->stop('already_logged'); |
|
532 | 532 | |
533 | 533 | $config = $this->member_config; |
534 | 534 | |
@@ -542,13 +542,13 @@ discard block |
||
542 | 542 | */ |
543 | 543 | function dispMemberGetTempPassword() |
544 | 544 | { |
545 | - if(Context::get('is_logged')) return $this->stop('already_logged'); |
|
545 | + if (Context::get('is_logged')) return $this->stop('already_logged'); |
|
546 | 546 | |
547 | 547 | $user_id = Context::get('user_id'); |
548 | 548 | $temp_password = $_SESSION['xe_temp_password_'.$user_id]; |
549 | 549 | unset($_SESSION['xe_temp_password_'.$user_id]); |
550 | 550 | |
551 | - if(!$user_id||!$temp_password) return new BaseObject(-1,'msg_invaild_request'); |
|
551 | + if (!$user_id || !$temp_password) return new BaseObject(-1, 'msg_invaild_request'); |
|
552 | 552 | |
553 | 553 | Context::set('temp_password', $temp_password); |
554 | 554 | |
@@ -563,12 +563,12 @@ discard block |
||
563 | 563 | $authMemberSrl = $_SESSION['auth_member_srl']; |
564 | 564 | unset($_SESSION['auth_member_srl']); |
565 | 565 | |
566 | - if(Context::get('is_logged')) |
|
566 | + if (Context::get('is_logged')) |
|
567 | 567 | { |
568 | 568 | return $this->stop('already_logged'); |
569 | 569 | } |
570 | 570 | |
571 | - if($authMemberSrl) |
|
571 | + if ($authMemberSrl) |
|
572 | 572 | { |
573 | 573 | $oMemberModel = getModel('member'); |
574 | 574 | $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($authMemberSrl); |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | |
586 | 586 | function dispMemberModifyEmailAddress() |
587 | 587 | { |
588 | - if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
588 | + if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
589 | 589 | { |
590 | 590 | Context::set('success_return_url', getUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyEmailAddress')); |
591 | 591 | $this->dispMemberModifyInfoBefore(); |
@@ -613,10 +613,10 @@ discard block |
||
613 | 613 | $js_code[] = 'if(!validator) return false;'; |
614 | 614 | |
615 | 615 | $errorLang = array(); |
616 | - foreach($extraList as $val) |
|
616 | + foreach ($extraList as $val) |
|
617 | 617 | { |
618 | 618 | $title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title)); |
619 | - if($val->column_type == 'kr_zip' || $val->column_type == 'tel') |
|
619 | + if ($val->column_type == 'kr_zip' || $val->column_type == 'tel') |
|
620 | 620 | { |
621 | 621 | $js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title); |
622 | 622 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | **/ |
643 | 643 | function dispMemberSpammer() |
644 | 644 | { |
645 | - if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted'); |
|
645 | + if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted'); |
|
646 | 646 | |
647 | 647 | $member_srl = Context::get('member_srl'); |
648 | 648 | $module_srl = Context::get('module_srl'); |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
654 | 654 | $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info')); |
655 | 655 | |
656 | - if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted'); |
|
656 | + if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted'); |
|
657 | 657 | |
658 | 658 | $oMemberModel = getModel('member'); |
659 | 659 |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * setup the module general information |
25 | 25 | **/ |
26 | - if($this->module_info->list_count) |
|
26 | + if ($this->module_info->list_count) |
|
27 | 27 | { |
28 | 28 | $this->list_count = $this->module_info->list_count; |
29 | 29 | } |
30 | - if($this->module_info->search_list_count) |
|
30 | + if ($this->module_info->search_list_count) |
|
31 | 31 | { |
32 | 32 | $this->search_list_count = $this->module_info->search_list_count; |
33 | 33 | } |
34 | - if($this->module_info->page_count) |
|
34 | + if ($this->module_info->page_count) |
|
35 | 35 | { |
36 | 36 | $this->page_count = $this->module_info->page_count; |
37 | 37 | } |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | $oDocumentModel = getModel('document'); |
42 | 42 | |
43 | 43 | $statusList = $this->_getStatusNameList($oDocumentModel); |
44 | - if(isset($statusList['SECRET'])) |
|
44 | + if (isset($statusList['SECRET'])) |
|
45 | 45 | { |
46 | 46 | $this->module_info->secret = 'Y'; |
47 | 47 | } |
48 | 48 | |
49 | 49 | // use_category <=1.5.x, hide_category >=1.7.x |
50 | 50 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
51 | - if($count_category) |
|
51 | + if ($count_category) |
|
52 | 52 | { |
53 | - if($this->module_info->hide_category) |
|
53 | + if ($this->module_info->hide_category) |
|
54 | 54 | { |
55 | 55 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
56 | 56 | } |
57 | - else if($this->module_info->use_category) |
|
57 | + else if ($this->module_info->use_category) |
|
58 | 58 | { |
59 | 59 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
60 | 60 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * check the consultation function, if the user is admin then swich off consultation function |
75 | 75 | * if the user is not logged, then disppear write document/write comment./ view document |
76 | 76 | **/ |
77 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read) |
|
77 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read) |
|
78 | 78 | { |
79 | 79 | $this->consultation = TRUE; |
80 | - if(!Context::get('is_logged')) |
|
80 | + if (!Context::get('is_logged')) |
|
81 | 81 | { |
82 | 82 | $this->grant->list = FALSE; |
83 | 83 | $this->grant->write_document = FALSE; |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * setup the template path based on the skin |
95 | 95 | * the default skin is default |
96 | 96 | **/ |
97 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
98 | - if(!is_dir($template_path)||!$this->module_info->skin) |
|
97 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
98 | + if (!is_dir($template_path) || !$this->module_info->skin) |
|
99 | 99 | { |
100 | 100 | $this->module_info->skin = 'default'; |
101 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
101 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
102 | 102 | } |
103 | 103 | $this->setTemplatePath($template_path); |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | **/ |
115 | 115 | if (is_array($extra_keys)) |
116 | 116 | { |
117 | - foreach($extra_keys as $val) |
|
117 | + foreach ($extra_keys as $val) |
|
118 | 118 | { |
119 | 119 | $this->order_target[] = $val->eid; |
120 | 120 | } |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | |
128 | 128 | // remove [document_srl]_cpage from get_vars |
129 | 129 | $args = Context::getRequestVars(); |
130 | - foreach($args as $name => $value) |
|
130 | + foreach ($args as $name => $value) |
|
131 | 131 | { |
132 | - if(preg_match('/[0-9]+_cpage/', $name)) |
|
132 | + if (preg_match('/[0-9]+_cpage/', $name)) |
|
133 | 133 | { |
134 | 134 | Context::set($name, '', TRUE); |
135 | 135 | Context::set($name, $value); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * check the access grant (all the grant has been set by the module object) |
147 | 147 | **/ |
148 | - if(!$this->grant->access || !$this->grant->list) |
|
148 | + if (!$this->grant->access || !$this->grant->list) |
|
149 | 149 | { |
150 | 150 | return $this->dispBoardMessage('msg_not_permitted'); |
151 | 151 | } |
@@ -160,22 +160,22 @@ discard block |
||
160 | 160 | * add extra vaiables to the search options |
161 | 161 | **/ |
162 | 162 | // use search options on the template (the search options key has been declared, based on the language selected) |
163 | - foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
163 | + foreach ($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
164 | 164 | $extra_keys = Context::get('extra_keys'); |
165 | - if($extra_keys) |
|
165 | + if ($extra_keys) |
|
166 | 166 | { |
167 | - foreach($extra_keys as $key => $val) |
|
167 | + foreach ($extra_keys as $key => $val) |
|
168 | 168 | { |
169 | - if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
169 | + if ($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | // remove a search option that is not public in member config |
173 | 173 | $memberConfig = getModel('module')->getModuleConfig('member'); |
174 | - foreach($memberConfig->signupForm as $signupFormElement) |
|
174 | + foreach ($memberConfig->signupForm as $signupFormElement) |
|
175 | 175 | { |
176 | - if(in_array($signupFormElement->title, $search_option)) |
|
176 | + if (in_array($signupFormElement->title, $search_option)) |
|
177 | 177 | { |
178 | - if($signupFormElement->isPublic == 'N') |
|
178 | + if ($signupFormElement->isPublic == 'N') |
|
179 | 179 | unset($search_option[$signupFormElement->name]); |
180 | 180 | } |
181 | 181 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $oDocumentModel = getModel('document'); |
185 | 185 | $statusNameList = $this->_getStatusNameList($oDocumentModel); |
186 | - if(count($statusNameList) > 0) |
|
186 | + if (count($statusNameList) > 0) |
|
187 | 187 | { |
188 | 188 | Context::set('status_list', $statusNameList); |
189 | 189 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | // list config, columnList setting |
195 | 195 | $oBoardModel = getModel('board'); |
196 | 196 | $this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl); |
197 | - if(!$this->listConfig) $this->listConfig = array(); |
|
197 | + if (!$this->listConfig) $this->listConfig = array(); |
|
198 | 198 | $this->_makeListColumnList(); |
199 | 199 | |
200 | 200 | // display the notice list |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | /** |
219 | 219 | * @brief display the category list |
220 | 220 | **/ |
221 | - function dispBoardCategoryList(){ |
|
221 | + function dispBoardCategoryList() { |
|
222 | 222 | // check if the use_category option is enabled |
223 | - if($this->module_info->use_category=='Y') |
|
223 | + if ($this->module_info->use_category == 'Y') |
|
224 | 224 | { |
225 | 225 | // check the grant |
226 | - if(!$this->grant->list) |
|
226 | + if (!$this->grant->list) |
|
227 | 227 | { |
228 | 228 | Context::set('category_list', array()); |
229 | 229 | return; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * @brief display the board conent view |
242 | 242 | **/ |
243 | - function dispBoardContentView(){ |
|
243 | + function dispBoardContentView() { |
|
244 | 244 | // get the variable value |
245 | 245 | $document_srl = Context::get('document_srl'); |
246 | 246 | $page = Context::get('page'); |
@@ -251,36 +251,36 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * if the document exists, then get the document information |
253 | 253 | **/ |
254 | - if($document_srl) |
|
254 | + if ($document_srl) |
|
255 | 255 | { |
256 | 256 | $oDocument = $oDocumentModel->getDocument($document_srl, false, true); |
257 | 257 | |
258 | 258 | // if the document is existed |
259 | - if($oDocument->isExists()) |
|
259 | + if ($oDocument->isExists()) |
|
260 | 260 | { |
261 | 261 | // if the module srl is not consistent |
262 | - if($oDocument->get('module_srl')!=$this->module_info->module_srl ) |
|
262 | + if ($oDocument->get('module_srl') != $this->module_info->module_srl) |
|
263 | 263 | { |
264 | 264 | return $this->stop('msg_invalid_request'); |
265 | 265 | } |
266 | 266 | |
267 | 267 | // check the manage grant |
268 | - if($this->grant->manager) $oDocument->setGrant(); |
|
268 | + if ($this->grant->manager) $oDocument->setGrant(); |
|
269 | 269 | |
270 | 270 | // if the consultation function is enabled, and the document is not a notice |
271 | - if($this->consultation && !$oDocument->isNotice()) |
|
271 | + if ($this->consultation && !$oDocument->isNotice()) |
|
272 | 272 | { |
273 | 273 | $logged_info = Context::get('logged_info'); |
274 | - if(abs($oDocument->get('member_srl')) != $logged_info->member_srl) |
|
274 | + if (abs($oDocument->get('member_srl')) != $logged_info->member_srl) |
|
275 | 275 | { |
276 | 276 | $oDocument = $oDocumentModel->getDocument(0); |
277 | 277 | } |
278 | 278 | } |
279 | 279 | |
280 | 280 | // if the document is TEMP saved, check Grant |
281 | - if($oDocument->getStatus() == 'TEMP') |
|
281 | + if ($oDocument->getStatus() == 'TEMP') |
|
282 | 282 | { |
283 | - if(!$oDocument->isGranted()) |
|
283 | + if (!$oDocument->isGranted()) |
|
284 | 284 | { |
285 | 285 | $oDocument = $oDocumentModel->getDocument(0); |
286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | else |
291 | 291 | { |
292 | 292 | // if the document is not existed, then alert a warning message |
293 | - Context::set('document_srl','',true); |
|
293 | + Context::set('document_srl', '', true); |
|
294 | 294 | $this->alertMessage('msg_not_founded'); |
295 | 295 | } |
296 | 296 | |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | /** |
307 | 307 | *check the document view grant |
308 | 308 | **/ |
309 | - if($oDocument->isExists()) |
|
309 | + if ($oDocument->isExists()) |
|
310 | 310 | { |
311 | - if(!$this->grant->view && !$oDocument->isGranted()) |
|
311 | + if (!$this->grant->view && !$oDocument->isGranted()) |
|
312 | 312 | { |
313 | 313 | $oDocument = $oDocumentModel->getDocument(0); |
314 | - Context::set('document_srl','',true); |
|
314 | + Context::set('document_srl', '', true); |
|
315 | 315 | $this->alertMessage('msg_not_permitted'); |
316 | 316 | } |
317 | 317 | else |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | Context::addBrowserTitle($oDocument->getTitleText()); |
321 | 321 | |
322 | 322 | // update the document view count (if the document is not secret) |
323 | - if(!$oDocument->isSecret() || $oDocument->isGranted()) |
|
323 | + if (!$oDocument->isSecret() || $oDocument->isGranted()) |
|
324 | 324 | { |
325 | 325 | $oDocument->updateReadedCount(); |
326 | 326 | } |
327 | 327 | |
328 | 328 | // disappear the document if it is secret |
329 | - if($oDocument->isSecret() && !$oDocument->isGranted()) |
|
329 | + if ($oDocument->isSecret() && !$oDocument->isGranted()) |
|
330 | 330 | { |
331 | - $oDocument->add('content',Context::getLang('thisissecret')); |
|
331 | + $oDocument->add('content', Context::getLang('thisissecret')); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | } |
@@ -348,11 +348,11 @@ discard block |
||
348 | 348 | /** |
349 | 349 | * @brief display the document file list (can be used by API) |
350 | 350 | **/ |
351 | - function dispBoardContentFileList(){ |
|
351 | + function dispBoardContentFileList() { |
|
352 | 352 | /** |
353 | 353 | * check the access grant (all the grant has been set by the module object) |
354 | 354 | **/ |
355 | - if(!$this->grant->access) |
|
355 | + if (!$this->grant->access) |
|
356 | 356 | { |
357 | 357 | return $this->dispBoardMessage('msg_not_permitted'); |
358 | 358 | } |
@@ -363,41 +363,41 @@ discard block |
||
363 | 363 | // Check if a permission for file download is granted |
364 | 364 | // Get configurations (using module model object) |
365 | 365 | $oModuleModel = getModel('module'); |
366 | - $file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl); |
|
366 | + $file_module_config = $oModuleModel->getModulePartConfig('file', $this->module_srl); |
|
367 | 367 | |
368 | 368 | $downloadGrantCount = 0; |
369 | - if(is_array($file_module_config->download_grant)) |
|
369 | + if (is_array($file_module_config->download_grant)) |
|
370 | 370 | { |
371 | - foreach($file_module_config->download_grant AS $value) |
|
372 | - if($value) $downloadGrantCount++; |
|
371 | + foreach ($file_module_config->download_grant AS $value) |
|
372 | + if ($value) $downloadGrantCount++; |
|
373 | 373 | } |
374 | 374 | |
375 | - if(is_array($file_module_config->download_grant) && $downloadGrantCount>0) |
|
375 | + if (is_array($file_module_config->download_grant) && $downloadGrantCount > 0) |
|
376 | 376 | { |
377 | - if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
377 | + if (!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
378 | 378 | $logged_info = Context::get('logged_info'); |
379 | - if($logged_info->is_admin != 'Y') |
|
379 | + if ($logged_info->is_admin != 'Y') |
|
380 | 380 | { |
381 | - $oModuleModel =& getModel('module'); |
|
381 | + $oModuleModel = & getModel('module'); |
|
382 | 382 | $columnList = array('module_srl', 'site_srl'); |
383 | 383 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList); |
384 | 384 | |
385 | - if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
385 | + if (!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
386 | 386 | { |
387 | - $oMemberModel =& getModel('member'); |
|
387 | + $oMemberModel = & getModel('member'); |
|
388 | 388 | $member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl); |
389 | 389 | |
390 | 390 | $is_permitted = false; |
391 | - for($i=0;$i<count($file_module_config->download_grant);$i++) |
|
391 | + for ($i = 0; $i < count($file_module_config->download_grant); $i++) |
|
392 | 392 | { |
393 | 393 | $group_srl = $file_module_config->download_grant[$i]; |
394 | - if($member_groups[$group_srl]) |
|
394 | + if ($member_groups[$group_srl]) |
|
395 | 395 | { |
396 | 396 | $is_permitted = true; |
397 | 397 | break; |
398 | 398 | } |
399 | 399 | } |
400 | - if(!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
400 | + if (!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $document_srl = Context::get('document_srl'); |
407 | 407 | $oDocument = $oDocumentModel->getDocument($document_srl); |
408 | 408 | Context::set('oDocument', $oDocument); |
409 | - Context::set('file_list',$oDocument->getUploadedFiles()); |
|
409 | + Context::set('file_list', $oDocument->getUploadedFiles()); |
|
410 | 410 | |
411 | 411 | $oSecurity = new Security(); |
412 | 412 | $oSecurity->encodeHTML('file_list..source_filename'); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | /** |
416 | 416 | * @brief display the document comment list (can be used by API) |
417 | 417 | **/ |
418 | - function dispBoardContentCommentList(){ |
|
418 | + function dispBoardContentCommentList() { |
|
419 | 419 | // check document view grant |
420 | 420 | $this->dispBoardContentView(); |
421 | 421 | |
@@ -425,26 +425,26 @@ discard block |
||
425 | 425 | $comment_list = $oDocument->getComments(); |
426 | 426 | |
427 | 427 | // setup the comment list |
428 | - if(is_array($comment_list)) |
|
428 | + if (is_array($comment_list)) |
|
429 | 429 | { |
430 | - foreach($comment_list as $key => $val) |
|
430 | + foreach ($comment_list as $key => $val) |
|
431 | 431 | { |
432 | - if(!$val->isAccessible()) |
|
432 | + if (!$val->isAccessible()) |
|
433 | 433 | { |
434 | - $val->add('content',Context::getLang('thisissecret')); |
|
434 | + $val->add('content', Context::getLang('thisissecret')); |
|
435 | 435 | } |
436 | 436 | } |
437 | 437 | } |
438 | - Context::set('comment_list',$comment_list); |
|
438 | + Context::set('comment_list', $comment_list); |
|
439 | 439 | |
440 | 440 | } |
441 | 441 | |
442 | 442 | /** |
443 | 443 | * @brief display notice list (can be used by API) |
444 | 444 | **/ |
445 | - function dispBoardNoticeList(){ |
|
445 | + function dispBoardNoticeList() { |
|
446 | 446 | // check the grant |
447 | - if(!$this->grant->list) |
|
447 | + if (!$this->grant->list) |
|
448 | 448 | { |
449 | 449 | Context::set('notice_list', array()); |
450 | 450 | return; |
@@ -460,15 +460,15 @@ discard block |
||
460 | 460 | /** |
461 | 461 | * @brief display board content list |
462 | 462 | **/ |
463 | - function dispBoardContentList(){ |
|
463 | + function dispBoardContentList() { |
|
464 | 464 | // check the grant |
465 | - if(!$this->grant->list) |
|
465 | + if (!$this->grant->list) |
|
466 | 466 | { |
467 | 467 | Context::set('document_list', array()); |
468 | 468 | Context::set('total_count', 0); |
469 | 469 | Context::set('total_page', 1); |
470 | 470 | Context::set('page', 1); |
471 | - Context::set('page_navigation', new PageHandler(0,0,1,10)); |
|
471 | + Context::set('page_navigation', new PageHandler(0, 0, 1, 10)); |
|
472 | 472 | return; |
473 | 473 | } |
474 | 474 | |
@@ -486,17 +486,17 @@ discard block |
||
486 | 486 | $args->search_keyword = Context::get('search_keyword'); |
487 | 487 | |
488 | 488 | $search_option = Context::get('search_option'); |
489 | - if($search_option==FALSE) |
|
489 | + if ($search_option == FALSE) |
|
490 | 490 | { |
491 | 491 | $search_option = $this->search_option; |
492 | 492 | } |
493 | - if(isset($search_option[$args->search_target])==FALSE) |
|
493 | + if (isset($search_option[$args->search_target]) == FALSE) |
|
494 | 494 | { |
495 | 495 | $args->search_target = ''; |
496 | 496 | } |
497 | 497 | |
498 | 498 | // if the category is enabled, then get the category |
499 | - if($this->module_info->use_category=='Y') |
|
499 | + if ($this->module_info->use_category == 'Y') |
|
500 | 500 | { |
501 | 501 | $args->category_srl = Context::get('category'); |
502 | 502 | } |
@@ -504,21 +504,21 @@ discard block |
||
504 | 504 | // setup the sort index and order index |
505 | 505 | $args->sort_index = Context::get('sort_index'); |
506 | 506 | $args->order_type = Context::get('order_type'); |
507 | - if(!in_array($args->sort_index, $this->order_target)) |
|
507 | + if (!in_array($args->sort_index, $this->order_target)) |
|
508 | 508 | { |
509 | - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; |
|
509 | + $args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order'; |
|
510 | 510 | } |
511 | - if(!in_array($args->order_type, array('asc','desc'))) |
|
511 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
512 | 512 | { |
513 | - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; |
|
513 | + $args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc'; |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | // set the current page of documents |
517 | 517 | $document_srl = Context::get('document_srl'); |
518 | - if(!$args->page && $document_srl) |
|
518 | + if (!$args->page && $document_srl) |
|
519 | 519 | { |
520 | 520 | $oDocument = $oDocumentModel->getDocument($document_srl); |
521 | - if($oDocument->isExists() && !$oDocument->isNotice()) |
|
521 | + if ($oDocument->isExists() && !$oDocument->isNotice()) |
|
522 | 522 | { |
523 | 523 | $page = $oDocumentModel->getDocumentPage($oDocument, $args); |
524 | 524 | Context::set('page', $page); |
@@ -527,21 +527,21 @@ discard block |
||
527 | 527 | } |
528 | 528 | |
529 | 529 | // setup the list count to be serach list count, if the category or search keyword has been set |
530 | - if($args->category_srl || $args->search_keyword) |
|
530 | + if ($args->category_srl || $args->search_keyword) |
|
531 | 531 | { |
532 | 532 | $args->list_count = $this->search_list_count; |
533 | 533 | } |
534 | 534 | |
535 | 535 | // if the consultation function is enabled, the get the logged user information |
536 | - if($this->consultation) |
|
536 | + if ($this->consultation) |
|
537 | 537 | { |
538 | 538 | $logged_info = Context::get('logged_info'); |
539 | 539 | $args->member_srl = $logged_info->member_srl; |
540 | 540 | |
541 | - if($this->module_info->use_anonymous === 'Y') |
|
541 | + if ($this->module_info->use_anonymous === 'Y') |
|
542 | 542 | { |
543 | 543 | unset($args->member_srl); |
544 | - $args->member_srls = $logged_info->member_srl . ',' . $logged_info->member_srl * -1; |
|
544 | + $args->member_srls = $logged_info->member_srl.','.$logged_info->member_srl * -1; |
|
545 | 545 | } |
546 | 546 | } |
547 | 547 | |
@@ -567,18 +567,18 @@ discard block |
||
567 | 567 | 'allow_trackback', 'notify_message', 'status', 'comment_status'); |
568 | 568 | $this->columnList = array_intersect($configColumList, $tableColumnList); |
569 | 569 | |
570 | - if(in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
570 | + if (in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
571 | 571 | |
572 | 572 | // default column list add |
573 | 573 | $defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color'); |
574 | 574 | |
575 | 575 | //TODO guestbook, blog style supports legacy codes. |
576 | - if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
576 | + if ($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
577 | 577 | { |
578 | 578 | $defaultColumn = $tableColumnList; |
579 | 579 | } |
580 | 580 | |
581 | - if (in_array('last_post', $configColumList)){ |
|
581 | + if (in_array('last_post', $configColumList)) { |
|
582 | 582 | array_push($this->columnList, 'last_updater'); |
583 | 583 | } |
584 | 584 | |
@@ -590,9 +590,9 @@ discard block |
||
590 | 590 | $this->columnList = array_unique(array_merge($this->columnList, $defaultColumn)); |
591 | 591 | |
592 | 592 | // add table name |
593 | - foreach($this->columnList as $no => $value) |
|
593 | + foreach ($this->columnList as $no => $value) |
|
594 | 594 | { |
595 | - $this->columnList[$no] = 'documents.' . $value; |
|
595 | + $this->columnList[$no] = 'documents.'.$value; |
|
596 | 596 | } |
597 | 597 | } |
598 | 598 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | function dispBoardTagList() |
603 | 603 | { |
604 | 604 | // check if there is not grant fot view list, then alert an warning message |
605 | - if(!$this->grant->list) |
|
605 | + if (!$this->grant->list) |
|
606 | 606 | { |
607 | 607 | return $this->dispBoardMessage('msg_not_permitted'); |
608 | 608 | } |
@@ -616,14 +616,14 @@ discard block |
||
616 | 616 | $output = $oTagModel->getTagList($obj); |
617 | 617 | |
618 | 618 | // automatically order |
619 | - if(count($output->data)) |
|
619 | + if (count($output->data)) |
|
620 | 620 | { |
621 | 621 | $numbers = array_keys($output->data); |
622 | 622 | shuffle($numbers); |
623 | 623 | |
624 | - if(count($output->data)) |
|
624 | + if (count($output->data)) |
|
625 | 625 | { |
626 | - foreach($numbers as $k => $v) |
|
626 | + foreach ($numbers as $k => $v) |
|
627 | 627 | { |
628 | 628 | $tag_list[] = $output->data[$v]; |
629 | 629 | } |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | function dispBoardWrite() |
645 | 645 | { |
646 | 646 | // check grant |
647 | - if(!$this->grant->write_document) |
|
647 | + if (!$this->grant->write_document) |
|
648 | 648 | { |
649 | 649 | return $this->dispBoardMessage('msg_not_permitted'); |
650 | 650 | } |
@@ -654,10 +654,10 @@ discard block |
||
654 | 654 | /** |
655 | 655 | * check if the category option is enabled not not |
656 | 656 | **/ |
657 | - if($this->module_info->use_category=='Y') |
|
657 | + if ($this->module_info->use_category == 'Y') |
|
658 | 658 | { |
659 | 659 | // get the user group information |
660 | - if(Context::get('is_logged')) |
|
660 | + if (Context::get('is_logged')) |
|
661 | 661 | { |
662 | 662 | $logged_info = Context::get('logged_info'); |
663 | 663 | $group_srls = array_keys($logged_info->group_list); |
@@ -670,19 +670,19 @@ discard block |
||
670 | 670 | |
671 | 671 | // check the grant after obtained the category list |
672 | 672 | $normal_category_list = $oDocumentModel->getCategoryList($this->module_srl); |
673 | - if(count($normal_category_list)) |
|
673 | + if (count($normal_category_list)) |
|
674 | 674 | { |
675 | - foreach($normal_category_list as $category_srl => $category) |
|
675 | + foreach ($normal_category_list as $category_srl => $category) |
|
676 | 676 | { |
677 | 677 | $is_granted = TRUE; |
678 | - if($category->group_srls) |
|
678 | + if ($category->group_srls) |
|
679 | 679 | { |
680 | - $category_group_srls = explode(',',$category->group_srls); |
|
680 | + $category_group_srls = explode(',', $category->group_srls); |
|
681 | 681 | $is_granted = FALSE; |
682 | - if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
682 | + if (count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
683 | 683 | |
684 | 684 | } |
685 | - if($is_granted) $category_list[$category_srl] = $category; |
|
685 | + if ($is_granted) $category_list[$category_srl] = $category; |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | Context::set('category_list', $category_list); |
@@ -693,46 +693,46 @@ discard block |
||
693 | 693 | $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager); |
694 | 694 | $oDocument->setDocument($document_srl); |
695 | 695 | |
696 | - if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
696 | + if ($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
697 | 697 | $oDocument->add('module_srl', $this->module_srl); |
698 | 698 | |
699 | - if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
699 | + if ($oDocument->isExists() && $this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
700 | 700 | { |
701 | 701 | return new BaseObject(-1, 'msg_protect_content'); |
702 | 702 | } |
703 | 703 | |
704 | 704 | // if the document is not granted, then back to the password input form |
705 | 705 | $oModuleModel = getModel('module'); |
706 | - if($oDocument->isExists()&&!$oDocument->isGranted()) |
|
706 | + if ($oDocument->isExists() && !$oDocument->isGranted()) |
|
707 | 707 | { |
708 | 708 | return $this->setTemplateFile('input_password_form'); |
709 | 709 | } |
710 | 710 | |
711 | - if(!$oDocument->isExists()) |
|
711 | + if (!$oDocument->isExists()) |
|
712 | 712 | { |
713 | - $point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl); |
|
713 | + $point_config = $oModuleModel->getModulePartConfig('point', $this->module_srl); |
|
714 | 714 | $logged_info = Context::get('logged_info'); |
715 | 715 | $oPointModel = getModel('point'); |
716 | 716 | $pointForInsert = $point_config["insert_document"]; |
717 | - if($pointForInsert < 0) |
|
717 | + if ($pointForInsert < 0) |
|
718 | 718 | { |
719 | - if( !$logged_info ) |
|
719 | + if (!$logged_info) |
|
720 | 720 | { |
721 | 721 | return $this->dispBoardMessage('msg_not_permitted'); |
722 | 722 | } |
723 | - else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 ) |
|
723 | + else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert) < 0) |
|
724 | 724 | { |
725 | 725 | return $this->dispBoardMessage('msg_not_enough_point'); |
726 | 726 | } |
727 | 727 | } |
728 | 728 | } |
729 | - if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
729 | + if (!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
730 | 730 | |
731 | 731 | $statusList = $this->_getStatusNameList($oDocumentModel); |
732 | - if(count($statusList) > 0) Context::set('status_list', $statusList); |
|
732 | + if (count($statusList) > 0) Context::set('status_list', $statusList); |
|
733 | 733 | |
734 | 734 | // get Document status config value |
735 | - Context::set('document_srl',$document_srl); |
|
735 | + Context::set('document_srl', $document_srl); |
|
736 | 736 | Context::set('oDocument', $oDocument); |
737 | 737 | |
738 | 738 | // apply xml_js_filter on header |
@@ -740,12 +740,12 @@ discard block |
||
740 | 740 | $oDocumentController->addXmlJsFilter($this->module_info->module_srl); |
741 | 741 | |
742 | 742 | // if the document exists, then setup extra variabels on context |
743 | - if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
743 | + if ($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
744 | 744 | |
745 | 745 | /** |
746 | 746 | * add JS filters |
747 | 747 | **/ |
748 | - if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
748 | + if (Context::get('logged_info')->is_admin == 'Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
749 | 749 | else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml'); |
750 | 750 | |
751 | 751 | $oSecurity = new Security(); |
@@ -757,14 +757,14 @@ discard block |
||
757 | 757 | function _getStatusNameList(&$oDocumentModel) |
758 | 758 | { |
759 | 759 | $resultList = array(); |
760 | - if(!empty($this->module_info->use_status)) |
|
760 | + if (!empty($this->module_info->use_status)) |
|
761 | 761 | { |
762 | 762 | $statusNameList = $oDocumentModel->getStatusNameList(); |
763 | 763 | $statusList = explode('|@|', $this->module_info->use_status); |
764 | 764 | |
765 | - if(is_array($statusList)) |
|
765 | + if (is_array($statusList)) |
|
766 | 766 | { |
767 | - foreach($statusList as $key => $value) |
|
767 | + foreach ($statusList as $key => $value) |
|
768 | 768 | { |
769 | 769 | $resultList[$value] = $statusNameList[$value]; |
770 | 770 | } |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | function dispBoardDelete() |
780 | 780 | { |
781 | 781 | // check grant |
782 | - if(!$this->grant->write_document) |
|
782 | + if (!$this->grant->write_document) |
|
783 | 783 | { |
784 | 784 | return $this->dispBoardMessage('msg_not_permitted'); |
785 | 785 | } |
@@ -788,30 +788,30 @@ discard block |
||
788 | 788 | $document_srl = Context::get('document_srl'); |
789 | 789 | |
790 | 790 | // if document exists, get the document information |
791 | - if($document_srl) |
|
791 | + if ($document_srl) |
|
792 | 792 | { |
793 | 793 | $oDocumentModel = getModel('document'); |
794 | 794 | $oDocument = $oDocumentModel->getDocument($document_srl); |
795 | 795 | } |
796 | 796 | |
797 | 797 | // if the document is not existed, then back to the board content page |
798 | - if(!$oDocument || !$oDocument->isExists()) |
|
798 | + if (!$oDocument || !$oDocument->isExists()) |
|
799 | 799 | { |
800 | 800 | return $this->dispBoardContent(); |
801 | 801 | } |
802 | 802 | |
803 | 803 | // if the document is not granted, then back to the password input form |
804 | - if(!$oDocument->isGranted()) |
|
804 | + if (!$oDocument->isGranted()) |
|
805 | 805 | { |
806 | 806 | return $this->setTemplateFile('input_password_form'); |
807 | 807 | } |
808 | 808 | |
809 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
809 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
810 | 810 | { |
811 | 811 | return $this->dispBoardMessage('msg_protect_content'); |
812 | 812 | } |
813 | 813 | |
814 | - Context::set('oDocument',$oDocument); |
|
814 | + Context::set('oDocument', $oDocument); |
|
815 | 815 | |
816 | 816 | /** |
817 | 817 | * add JS filters |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $document_srl = Context::get('document_srl'); |
830 | 830 | |
831 | 831 | // check grant |
832 | - if(!$this->grant->write_comment) |
|
832 | + if (!$this->grant->write_comment) |
|
833 | 833 | { |
834 | 834 | return $this->dispBoardMessage('msg_not_permitted'); |
835 | 835 | } |
@@ -837,13 +837,13 @@ discard block |
||
837 | 837 | // get the document information |
838 | 838 | $oDocumentModel = getModel('document'); |
839 | 839 | $oDocument = $oDocumentModel->getDocument($document_srl); |
840 | - if(!$oDocument->isExists()) |
|
840 | + if (!$oDocument->isExists()) |
|
841 | 841 | { |
842 | 842 | return $this->dispBoardMessage('msg_invalid_request'); |
843 | 843 | } |
844 | 844 | |
845 | 845 | // Check allow comment |
846 | - if(!$oDocument->allowComment()) |
|
846 | + if (!$oDocument->allowComment()) |
|
847 | 847 | { |
848 | 848 | return $this->dispBoardMessage('msg_not_allow_comment'); |
849 | 849 | } |
@@ -855,9 +855,9 @@ discard block |
||
855 | 855 | $oComment->add('module_srl', $this->module_srl); |
856 | 856 | |
857 | 857 | // setup document variables on context |
858 | - Context::set('oDocument',$oDocument); |
|
859 | - Context::set('oSourceComment',$oSourceComment); |
|
860 | - Context::set('oComment',$oComment); |
|
858 | + Context::set('oDocument', $oDocument); |
|
859 | + Context::set('oSourceComment', $oSourceComment); |
|
860 | + Context::set('oComment', $oComment); |
|
861 | 861 | |
862 | 862 | /** |
863 | 863 | * add JS filter |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | function dispBoardReplyComment() |
874 | 874 | { |
875 | 875 | // check grant |
876 | - if(!$this->grant->write_comment) |
|
876 | + if (!$this->grant->write_comment) |
|
877 | 877 | { |
878 | 878 | return $this->dispBoardMessage('msg_not_permitted'); |
879 | 879 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | $parent_srl = Context::get('comment_srl'); |
883 | 883 | |
884 | 884 | // if the parent comment is not existed |
885 | - if(!$parent_srl) |
|
885 | + if (!$parent_srl) |
|
886 | 886 | { |
887 | 887 | return new BaseObject(-1, 'msg_invalid_request'); |
888 | 888 | } |
@@ -892,11 +892,11 @@ discard block |
||
892 | 892 | $oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager); |
893 | 893 | |
894 | 894 | // if the comment is not existed, opoup an error message |
895 | - if(!$oSourceComment->isExists()) |
|
895 | + if (!$oSourceComment->isExists()) |
|
896 | 896 | { |
897 | 897 | return $this->dispBoardMessage('msg_invalid_request'); |
898 | 898 | } |
899 | - if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
899 | + if (Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
900 | 900 | { |
901 | 901 | return $this->dispBoardMessage('msg_invalid_request'); |
902 | 902 | } |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | // Check allow comment |
905 | 905 | $oDocumentModel = getModel('document'); |
906 | 906 | $oDocument = $oDocumentModel->getDocument($oSourceComment->get('document_srl')); |
907 | - if(!$oDocument->allowComment()) |
|
907 | + if (!$oDocument->allowComment()) |
|
908 | 908 | { |
909 | 909 | return $this->dispBoardMessage('msg_not_allow_comment'); |
910 | 910 | } |
@@ -915,9 +915,9 @@ discard block |
||
915 | 915 | $oComment->add('document_srl', $oSourceComment->get('document_srl')); |
916 | 916 | |
917 | 917 | // setup comment variables |
918 | - Context::set('oSourceComment',$oSourceComment); |
|
919 | - Context::set('oComment',$oComment); |
|
920 | - Context::set('module_srl',$this->module_info->module_srl); |
|
918 | + Context::set('oSourceComment', $oSourceComment); |
|
919 | + Context::set('oComment', $oComment); |
|
920 | + Context::set('module_srl', $this->module_info->module_srl); |
|
921 | 921 | |
922 | 922 | /** |
923 | 923 | * add JS filters |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | function dispBoardModifyComment() |
934 | 934 | { |
935 | 935 | // check grant |
936 | - if(!$this->grant->write_comment) |
|
936 | + if (!$this->grant->write_comment) |
|
937 | 937 | { |
938 | 938 | return $this->dispBoardMessage('msg_not_permitted'); |
939 | 939 | } |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | $comment_srl = Context::get('comment_srl'); |
944 | 944 | |
945 | 945 | // if the comment is not existed |
946 | - if(!$comment_srl) |
|
946 | + if (!$comment_srl) |
|
947 | 947 | { |
948 | 948 | return new BaseObject(-1, 'msg_invalid_request'); |
949 | 949 | } |
@@ -953,13 +953,13 @@ discard block |
||
953 | 953 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
954 | 954 | |
955 | 955 | // if the comment is not exited, alert an error message |
956 | - if(!$oComment->isExists()) |
|
956 | + if (!$oComment->isExists()) |
|
957 | 957 | { |
958 | 958 | return $this->dispBoardMessage('msg_invalid_request'); |
959 | 959 | } |
960 | 960 | |
961 | 961 | // if the comment is not granted, then back to the password input form |
962 | - if(!$oComment->isGranted()) |
|
962 | + if (!$oComment->isGranted()) |
|
963 | 963 | { |
964 | 964 | return $this->setTemplateFile('input_password_form'); |
965 | 965 | } |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | function dispBoardDeleteComment() |
983 | 983 | { |
984 | 984 | // check grant |
985 | - if(!$this->grant->write_comment) |
|
985 | + if (!$this->grant->write_comment) |
|
986 | 986 | { |
987 | 987 | return $this->dispBoardMessage('msg_not_permitted'); |
988 | 988 | } |
@@ -991,25 +991,25 @@ discard block |
||
991 | 991 | $comment_srl = Context::get('comment_srl'); |
992 | 992 | |
993 | 993 | // if the comment exists, then get the comment information |
994 | - if($comment_srl) |
|
994 | + if ($comment_srl) |
|
995 | 995 | { |
996 | 996 | $oCommentModel = getModel('comment'); |
997 | 997 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
998 | 998 | } |
999 | 999 | |
1000 | 1000 | // if the comment is not existed, then back to the board content page |
1001 | - if(!$oComment->isExists() ) |
|
1001 | + if (!$oComment->isExists()) |
|
1002 | 1002 | { |
1003 | 1003 | return $this->dispBoardContent(); |
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | // if the comment is not granted, then back to the password input form |
1007 | - if(!$oComment->isGranted()) |
|
1007 | + if (!$oComment->isGranted()) |
|
1008 | 1008 | { |
1009 | 1009 | return $this->setTemplateFile('input_password_form'); |
1010 | 1010 | } |
1011 | 1011 | |
1012 | - Context::set('oComment',$oComment); |
|
1012 | + Context::set('oComment', $oComment); |
|
1013 | 1013 | |
1014 | 1014 | /** |
1015 | 1015 | * add JS filters |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | { |
1027 | 1027 | $oTrackbackModel = getModel('trackback'); |
1028 | 1028 | |
1029 | - if(!$oTrackbackModel) |
|
1029 | + if (!$oTrackbackModel) |
|
1030 | 1030 | { |
1031 | 1031 | return; |
1032 | 1032 | } |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | $trackback = $output->data; |
1041 | 1041 | |
1042 | 1042 | // if no trackback, then display the board content |
1043 | - if(!$trackback) |
|
1043 | + if (!$trackback) |
|
1044 | 1044 | { |
1045 | 1045 | return $this->dispBoardContent(); |
1046 | 1046 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | function dispBoardMessage($msg_code) |
1062 | 1062 | { |
1063 | 1063 | $msg = Context::getLang($msg_code); |
1064 | - if(!$msg) $msg = $msg_code; |
|
1064 | + if (!$msg) $msg = $msg_code; |
|
1065 | 1065 | Context::set('message', $msg); |
1066 | 1066 | $this->setTemplateFile('message'); |
1067 | 1067 | } |
@@ -1072,8 +1072,8 @@ discard block |
||
1072 | 1072 | **/ |
1073 | 1073 | function alertMessage($message) |
1074 | 1074 | { |
1075 | - $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
1076 | - Context::addHtmlFooter( $script ); |
|
1075 | + $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
1076 | + Context::addHtmlFooter($script); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | } |