@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pageAdminController |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief page of the module admin controller class |
|
7 | - */ |
|
4 | + * @class pageAdminController |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief page of the module admin controller class |
|
7 | + */ |
|
8 | 8 | class pageAdminController extends page |
9 | 9 | { |
10 | 10 | /** |
@@ -25,24 +25,24 @@ discard block |
||
25 | 25 | // Set board module |
26 | 26 | $args = Context::getRequestVars(); |
27 | 27 | $args->module = 'page'; |
28 | - $args->mid = $args->page_name; //because if mid is empty in context, set start page mid |
|
28 | + $args->mid = $args->page_name; //because if mid is empty in context, set start page mid |
|
29 | 29 | $args->path = (!$args->path) ? '' : $args->path; |
30 | 30 | $args->mpath = (!$args->mpath) ? '' : $args->mpath; |
31 | 31 | unset($args->page_name); |
32 | 32 | |
33 | - if($args->use_mobile != 'Y') $args->use_mobile = ''; |
|
33 | + if ($args->use_mobile != 'Y') $args->use_mobile = ''; |
|
34 | 34 | // Check if an original module exists by using module_srl |
35 | - if($args->module_srl) |
|
35 | + if ($args->module_srl) |
|
36 | 36 | { |
37 | 37 | $columnList = array('module_srl'); |
38 | 38 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList); |
39 | - if($module_info->module_srl != $args->module_srl) |
|
39 | + if ($module_info->module_srl != $args->module_srl) |
|
40 | 40 | { |
41 | 41 | unset($args->module_srl); |
42 | 42 | } |
43 | 43 | else |
44 | 44 | { |
45 | - foreach($args as $key=>$val) |
|
45 | + foreach ($args as $key=>$val) |
|
46 | 46 | { |
47 | 47 | $module_info->{$key} = $val; |
48 | 48 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | } |
77 | 77 | // Insert/update depending on module_srl |
78 | - if(!$args->module_srl) |
|
78 | + if (!$args->module_srl) |
|
79 | 79 | { |
80 | 80 | $output = $oModuleController->insertModule($args); |
81 | 81 | $msg_code = 'success_registed'; |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | $msg_code = 'success_updated'; |
87 | 87 | } |
88 | 88 | |
89 | - if(!$output->toBool()) return $output; |
|
89 | + if (!$output->toBool()) return $output; |
|
90 | 90 | |
91 | 91 | $this->add("page", Context::get('page')); |
92 | - $this->add('module_srl',$output->get('module_srl')); |
|
92 | + $this->add('module_srl', $output->get('module_srl')); |
|
93 | 93 | $this->setMessage($msg_code); |
94 | 94 | |
95 | 95 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'module_srl', $output->get('module_srl'), 'act', 'dispPageAdminInfo'); |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | |
107 | 107 | function putDocumentsInPageToArray($target, &$array) |
108 | 108 | { |
109 | - if(!$target) return; |
|
109 | + if (!$target) return; |
|
110 | 110 | preg_match_all('!<img hasContent="true" ([^>]+)!is', $target, $matches); |
111 | 111 | $pattern = '!document_srl="(\d+)"!'; |
112 | - foreach($matches[1] as $match) |
|
112 | + foreach ($matches[1] as $match) |
|
113 | 113 | { |
114 | 114 | $match2 = null; |
115 | 115 | preg_match($pattern, $match, $match2); |
116 | - if(count($match2)) |
|
116 | + if (count($match2)) |
|
117 | 117 | { |
118 | - $array[(int)$match2[1]] = 1; |
|
118 | + $array[(int) $match2[1]] = 1; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | } |
@@ -127,20 +127,20 @@ discard block |
||
127 | 127 | { |
128 | 128 | $module_srl = Context::get('module_srl'); |
129 | 129 | $content = Context::get('content'); |
130 | - if(!$module_srl) return new Object(-1,'msg_invalid_request'); |
|
130 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
131 | 131 | $mcontent = Context::get('mcontent'); |
132 | 132 | $type = Context::get('type'); |
133 | 133 | // Guhaeom won information page |
134 | 134 | $oModuleModel = getModel('module'); |
135 | 135 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
136 | - if($type == "mobile") |
|
136 | + if ($type == "mobile") |
|
137 | 137 | { |
138 | - if(!$mcontent) $mcontent = ''; |
|
138 | + if (!$mcontent) $mcontent = ''; |
|
139 | 139 | $module_info->mcontent = $mcontent; |
140 | 140 | } |
141 | 141 | else |
142 | 142 | { |
143 | - if(!isset($content)) $content =''; |
|
143 | + if (!isset($content)) $content = ''; |
|
144 | 144 | $module_info->content = $content; |
145 | 145 | } |
146 | 146 | |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | $obj->module_srl = $module_srl; |
155 | 155 | $obj->list_count = 99999999; |
156 | 156 | $output = $oDocumentModel->getDocumentList($obj); |
157 | - if(count($output->data)) |
|
157 | + if (count($output->data)) |
|
158 | 158 | { |
159 | - foreach($output->data as $document) |
|
159 | + foreach ($output->data as $document) |
|
160 | 160 | { |
161 | - if($document_srls[$document->document_srl]) continue; |
|
161 | + if ($document_srls[$document->document_srl]) continue; |
|
162 | 162 | $oDocumentController->deleteDocument($document->document_srl, true); |
163 | 163 | } |
164 | 164 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $oModuleController = getController('module'); |
167 | 167 | // Save |
168 | 168 | $output = $oModuleController->updateModule($module_info); |
169 | - if(!$output->toBool()) return $output; |
|
169 | + if (!$output->toBool()) return $output; |
|
170 | 170 | // On the page, change the validity status of the attached file |
171 | 171 | $oFileController = getController('file'); |
172 | 172 | $oFileController->setFilesValid($module_info->module_srl); |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | // Get an original |
190 | 190 | $oModuleController = getController('module'); |
191 | 191 | $output = $oModuleController->deleteModule($module_srl); |
192 | - if(!$output->toBool()) return $output; |
|
192 | + if (!$output->toBool()) return $output; |
|
193 | 193 | |
194 | - $this->add('module','page'); |
|
195 | - $this->add('page',Context::get('page')); |
|
194 | + $this->add('module', 'page'); |
|
195 | + $this->add('page', Context::get('page')); |
|
196 | 196 | $this->setMessage('success_deleted'); |
197 | 197 | |
198 | 198 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPageAdminContent'); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $args = Context::getRequestVars(); |
209 | 209 | // Insert by creating the module Controller object |
210 | 210 | $oModuleController = getController('module'); |
211 | - $output = $oModuleController->insertModuleConfig('page',$args); |
|
211 | + $output = $oModuleController->insertModuleConfig('page', $args); |
|
212 | 212 | return $output; |
213 | 213 | } |
214 | 214 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $file_srl = Context::get('file_srl'); |
240 | 240 | // Create the controller object file class |
241 | 241 | $oFileController = getController('file'); |
242 | - if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); |
|
242 | + if ($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); |
|
243 | 243 | // Attachment to the output of the list, java script |
244 | 244 | $oFileController->printUploadedFileList($upload_target_srl); |
245 | 245 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | { |
252 | 252 | $module_srl = Context::get('module_srl'); |
253 | 253 | |
254 | - if(!$module_srl) return; |
|
254 | + if (!$module_srl) return; |
|
255 | 255 | |
256 | 256 | $oModuleModel = getModel('module'); |
257 | 257 | $columnList = array('module_srl', 'content'); |
@@ -263,27 +263,27 @@ discard block |
||
263 | 263 | $oWidgetController = getController('widget'); |
264 | 264 | $oWidgetController->recompileWidget($content); |
265 | 265 | |
266 | - if($module_info->page_type == 'WIDGET') |
|
266 | + if ($module_info->page_type == 'WIDGET') |
|
267 | 267 | { |
268 | 268 | $path = _XE_PATH_ . 'files/cache/page/'; |
269 | 269 | $cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . '\./'); |
270 | - foreach($cache_files as $file_name) |
|
270 | + foreach ($cache_files as $file_name) |
|
271 | 271 | { |
272 | 272 | FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name); |
273 | 273 | } |
274 | 274 | } |
275 | - else if($module_info->page_type == 'OUTSIDE') |
|
275 | + else if ($module_info->page_type == 'OUTSIDE') |
|
276 | 276 | { |
277 | 277 | $path = _XE_PATH_ . 'files/cache/page/'; |
278 | 278 | $cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . './'); |
279 | - foreach($cache_files as $file_name) |
|
279 | + foreach ($cache_files as $file_name) |
|
280 | 280 | { |
281 | 281 | FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name); |
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
285 | 285 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
286 | - if($oCacheHandler->isSupport()) |
|
286 | + if ($oCacheHandler->isSupport()) |
|
287 | 287 | { |
288 | 288 | $object_key = 'mid_info:' . $module_info->module_srl; |
289 | 289 | $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $oModuleModel = getModel('module'); |
302 | 302 | $grant = $oModuleModel->getGrant($this->module_info, $logged_info); |
303 | 303 | |
304 | - if(!$grant->manager) |
|
304 | + if (!$grant->manager) |
|
305 | 305 | { |
306 | 306 | return new Object(-1, 'msg_not_permitted'); |
307 | 307 | } |
@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | $obj->is_notice = 'N'; |
312 | 312 | |
313 | 313 | settype($obj->title, "string"); |
314 | - if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...'); |
|
314 | + if ($obj->title == '') $obj->title = cut_str(strip_tags($obj->content), 20, '...'); |
|
315 | 315 | //그래도 없으면 Untitled |
316 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
316 | + if ($obj->title == '') $obj->title = 'Untitled'; |
|
317 | 317 | |
318 | 318 | $document_srl = $obj->document_srl; |
319 | 319 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $target = ($obj->ismobile == 'Y') ? 'mdocument_srl' : 'document_srl'; |
325 | 325 | |
326 | 326 | // 이미 존재하는 경우 수정 |
327 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
327 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
328 | 328 | { |
329 | 329 | $output = $oDocumentController->updateDocument($oDocument, $obj); |
330 | 330 | $msg_code = 'success_updated'; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $document_srl = $output->get('document_srl'); |
338 | 338 | } |
339 | 339 | |
340 | - if(!isset($this->module_info->{$target}) || (isset($this->module_info->{$target}) && $this->module_info->{$target} !== $document_srl)) |
|
340 | + if (!isset($this->module_info->{$target}) || (isset($this->module_info->{$target}) && $this->module_info->{$target} !== $document_srl)) |
|
341 | 341 | { |
342 | 342 | $oModuleController = getController('module'); |
343 | 343 | $this->module_info->{$target} = $document_srl; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | // 오류 발생시 멈춤 |
348 | - if(!$output->toBool()) return $output; |
|
348 | + if (!$output->toBool()) return $output; |
|
349 | 349 | |
350 | 350 | // 결과를 리턴 |
351 | 351 | $this->add('mid', Context::get('mid')); |
@@ -30,7 +30,9 @@ discard block |
||
30 | 30 | $args->mpath = (!$args->mpath) ? '' : $args->mpath; |
31 | 31 | unset($args->page_name); |
32 | 32 | |
33 | - if($args->use_mobile != 'Y') $args->use_mobile = ''; |
|
33 | + if($args->use_mobile != 'Y') { |
|
34 | + $args->use_mobile = ''; |
|
35 | + } |
|
34 | 36 | // Check if an original module exists by using module_srl |
35 | 37 | if($args->module_srl) |
36 | 38 | { |
@@ -39,8 +41,7 @@ discard block |
||
39 | 41 | if($module_info->module_srl != $args->module_srl) |
40 | 42 | { |
41 | 43 | unset($args->module_srl); |
42 | - } |
|
43 | - else |
|
44 | + } else |
|
44 | 45 | { |
45 | 46 | foreach($args as $key=>$val) |
46 | 47 | { |
@@ -79,14 +80,15 @@ discard block |
||
79 | 80 | { |
80 | 81 | $output = $oModuleController->insertModule($args); |
81 | 82 | $msg_code = 'success_registed'; |
82 | - } |
|
83 | - else |
|
83 | + } else |
|
84 | 84 | { |
85 | 85 | $output = $oModuleController->updateModule($args); |
86 | 86 | $msg_code = 'success_updated'; |
87 | 87 | } |
88 | 88 | |
89 | - if(!$output->toBool()) return $output; |
|
89 | + if(!$output->toBool()) { |
|
90 | + return $output; |
|
91 | + } |
|
90 | 92 | |
91 | 93 | $this->add("page", Context::get('page')); |
92 | 94 | $this->add('module_srl',$output->get('module_srl')); |
@@ -106,7 +108,9 @@ discard block |
||
106 | 108 | |
107 | 109 | function putDocumentsInPageToArray($target, &$array) |
108 | 110 | { |
109 | - if(!$target) return; |
|
111 | + if(!$target) { |
|
112 | + return; |
|
113 | + } |
|
110 | 114 | preg_match_all('!<img hasContent="true" ([^>]+)!is', $target, $matches); |
111 | 115 | $pattern = '!document_srl="(\d+)"!'; |
112 | 116 | foreach($matches[1] as $match) |
@@ -127,7 +131,9 @@ discard block |
||
127 | 131 | { |
128 | 132 | $module_srl = Context::get('module_srl'); |
129 | 133 | $content = Context::get('content'); |
130 | - if(!$module_srl) return new Object(-1,'msg_invalid_request'); |
|
134 | + if(!$module_srl) { |
|
135 | + return new Object(-1,'msg_invalid_request'); |
|
136 | + } |
|
131 | 137 | $mcontent = Context::get('mcontent'); |
132 | 138 | $type = Context::get('type'); |
133 | 139 | // Guhaeom won information page |
@@ -135,12 +141,15 @@ discard block |
||
135 | 141 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
136 | 142 | if($type == "mobile") |
137 | 143 | { |
138 | - if(!$mcontent) $mcontent = ''; |
|
144 | + if(!$mcontent) { |
|
145 | + $mcontent = ''; |
|
146 | + } |
|
139 | 147 | $module_info->mcontent = $mcontent; |
140 | - } |
|
141 | - else |
|
148 | + } else |
|
142 | 149 | { |
143 | - if(!isset($content)) $content =''; |
|
150 | + if(!isset($content)) { |
|
151 | + $content =''; |
|
152 | + } |
|
144 | 153 | $module_info->content = $content; |
145 | 154 | } |
146 | 155 | |
@@ -158,7 +167,9 @@ discard block |
||
158 | 167 | { |
159 | 168 | foreach($output->data as $document) |
160 | 169 | { |
161 | - if($document_srls[$document->document_srl]) continue; |
|
170 | + if($document_srls[$document->document_srl]) { |
|
171 | + continue; |
|
172 | + } |
|
162 | 173 | $oDocumentController->deleteDocument($document->document_srl, true); |
163 | 174 | } |
164 | 175 | } |
@@ -166,7 +177,9 @@ discard block |
||
166 | 177 | $oModuleController = getController('module'); |
167 | 178 | // Save |
168 | 179 | $output = $oModuleController->updateModule($module_info); |
169 | - if(!$output->toBool()) return $output; |
|
180 | + if(!$output->toBool()) { |
|
181 | + return $output; |
|
182 | + } |
|
170 | 183 | // On the page, change the validity status of the attached file |
171 | 184 | $oFileController = getController('file'); |
172 | 185 | $oFileController->setFilesValid($module_info->module_srl); |
@@ -189,7 +202,9 @@ discard block |
||
189 | 202 | // Get an original |
190 | 203 | $oModuleController = getController('module'); |
191 | 204 | $output = $oModuleController->deleteModule($module_srl); |
192 | - if(!$output->toBool()) return $output; |
|
205 | + if(!$output->toBool()) { |
|
206 | + return $output; |
|
207 | + } |
|
193 | 208 | |
194 | 209 | $this->add('module','page'); |
195 | 210 | $this->add('page',Context::get('page')); |
@@ -239,7 +254,9 @@ discard block |
||
239 | 254 | $file_srl = Context::get('file_srl'); |
240 | 255 | // Create the controller object file class |
241 | 256 | $oFileController = getController('file'); |
242 | - if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); |
|
257 | + if($file_srl) { |
|
258 | + $output = $oFileController->deleteFile($file_srl, $this->grant->manager); |
|
259 | + } |
|
243 | 260 | // Attachment to the output of the list, java script |
244 | 261 | $oFileController->printUploadedFileList($upload_target_srl); |
245 | 262 | } |
@@ -251,7 +268,9 @@ discard block |
||
251 | 268 | { |
252 | 269 | $module_srl = Context::get('module_srl'); |
253 | 270 | |
254 | - if(!$module_srl) return; |
|
271 | + if(!$module_srl) { |
|
272 | + return; |
|
273 | + } |
|
255 | 274 | |
256 | 275 | $oModuleModel = getModel('module'); |
257 | 276 | $columnList = array('module_srl', 'content'); |
@@ -271,8 +290,7 @@ discard block |
||
271 | 290 | { |
272 | 291 | FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name); |
273 | 292 | } |
274 | - } |
|
275 | - else if($module_info->page_type == 'OUTSIDE') |
|
293 | + } else if($module_info->page_type == 'OUTSIDE') |
|
276 | 294 | { |
277 | 295 | $path = _XE_PATH_ . 'files/cache/page/'; |
278 | 296 | $cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . './'); |
@@ -311,9 +329,13 @@ discard block |
||
311 | 329 | $obj->is_notice = 'N'; |
312 | 330 | |
313 | 331 | settype($obj->title, "string"); |
314 | - if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...'); |
|
332 | + if($obj->title == '') { |
|
333 | + $obj->title = cut_str(strip_tags($obj->content),20,'...'); |
|
334 | + } |
|
315 | 335 | //그래도 없으면 Untitled |
316 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
336 | + if($obj->title == '') { |
|
337 | + $obj->title = 'Untitled'; |
|
338 | + } |
|
317 | 339 | |
318 | 340 | $document_srl = $obj->document_srl; |
319 | 341 | |
@@ -328,8 +350,7 @@ discard block |
||
328 | 350 | { |
329 | 351 | $output = $oDocumentController->updateDocument($oDocument, $obj); |
330 | 352 | $msg_code = 'success_updated'; |
331 | - } |
|
332 | - else |
|
353 | + } else |
|
333 | 354 | { |
334 | 355 | // 그렇지 않으면 신규 등록 |
335 | 356 | $output = $oDocumentController->insertDocument($obj, $bAnonymous); |
@@ -345,7 +366,9 @@ discard block |
||
345 | 366 | } |
346 | 367 | |
347 | 368 | // 오류 발생시 멈춤 |
348 | - if(!$output->toBool()) return $output; |
|
369 | + if(!$output->toBool()) { |
|
370 | + return $output; |
|
371 | + } |
|
349 | 372 | |
350 | 373 | // 결과를 리턴 |
351 | 374 | $this->add('mid', Context::get('mid')); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pageAdminView |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief page admin view of the module class |
|
7 | - */ |
|
4 | + * @class pageAdminView |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief page admin view of the module class |
|
7 | + */ |
|
8 | 8 | class pageAdminView extends page |
9 | 9 | { |
10 | 10 | var $module_srl = 0; |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | // Create module model object |
22 | 22 | $oModuleModel = getModel('module'); |
23 | 23 | // module_srl two come over to save the module, putting the information in advance |
24 | - if($module_srl) |
|
24 | + if ($module_srl) |
|
25 | 25 | { |
26 | 26 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
27 | - if(!$module_info) |
|
27 | + if (!$module_info) |
|
28 | 28 | { |
29 | - Context::set('module_srl',''); |
|
29 | + Context::set('module_srl', ''); |
|
30 | 30 | $this->act = 'list'; |
31 | 31 | } |
32 | 32 | else |
33 | 33 | { |
34 | 34 | ModuleModel::syncModuleToSite($module_info); |
35 | 35 | $this->module_info = $module_info; |
36 | - Context::set('module_info',$module_info); |
|
36 | + Context::set('module_info', $module_info); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | // Get a list of module categories |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $security->encodeHTML('module_category..title'); |
45 | 45 | |
46 | 46 | // Get a template path (page in the administrative template tpl putting together) |
47 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
47 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | $args->page_count = 10; |
60 | 60 | $args->s_module_category_srl = Context::get('module_category_srl'); |
61 | 61 | |
62 | - $search_target_list = array('s_mid','s_browser_title'); |
|
62 | + $search_target_list = array('s_mid', 's_browser_title'); |
|
63 | 63 | $search_target = Context::get('search_target'); |
64 | 64 | $search_keyword = Context::get('search_keyword'); |
65 | - if(in_array($search_target,$search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
65 | + if (in_array($search_target, $search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
66 | 66 | |
67 | 67 | $output = executeQuery('page.getPageList', $args); |
68 | 68 | $oModuleModel = getModel('module'); |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | $module_srl = Context::get('module_srl'); |
102 | 102 | $module_info = Context::get('module_info'); |
103 | 103 | // If you do not value module_srl just showing the index page |
104 | - if(!$module_srl) return $this->dispPageAdminContent(); |
|
104 | + if (!$module_srl) return $this->dispPageAdminContent(); |
|
105 | 105 | // If the layout is destined to add layout information haejum (layout_title, layout) |
106 | - if($module_info->layout_srl) |
|
106 | + if ($module_info->layout_srl) |
|
107 | 107 | { |
108 | 108 | $oLayoutModel = getModel('layout'); |
109 | 109 | $layout_info = $oLayoutModel->getLayout($module_info->layout_srl); |
@@ -115,15 +115,15 @@ discard block |
||
115 | 115 | $layout_list = $oLayoutModel->getLayoutList(); |
116 | 116 | Context::set('layout_list', $layout_list); |
117 | 117 | |
118 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
118 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
119 | 119 | Context::set('mlayout_list', $mobile_layout_list); |
120 | 120 | // Set a template file |
121 | 121 | |
122 | - if($this->module_info->page_type == 'ARTICLE') |
|
122 | + if ($this->module_info->page_type == 'ARTICLE') |
|
123 | 123 | { |
124 | 124 | $oModuleModel = getModel('module'); |
125 | 125 | $skin_list = $oModuleModel->getSkins($this->module_path); |
126 | - Context::set('skin_list',$skin_list); |
|
126 | + Context::set('skin_list', $skin_list); |
|
127 | 127 | |
128 | 128 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
129 | 129 | Context::set('mskin_list', $mskin_list); |
@@ -161,23 +161,23 @@ discard block |
||
161 | 161 | |
162 | 162 | function dispPageAdminMobileContent() |
163 | 163 | { |
164 | - if($this->module_info->page_type == 'OUTSIDE') |
|
164 | + if ($this->module_info->page_type == 'OUTSIDE') |
|
165 | 165 | { |
166 | 166 | return $this->stop(-1, 'msg_invalid_request'); |
167 | 167 | } |
168 | 168 | |
169 | - if($this->module_srl) |
|
169 | + if ($this->module_srl) |
|
170 | 170 | { |
171 | - Context::set('module_srl',$this->module_srl); |
|
171 | + Context::set('module_srl', $this->module_srl); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $oPageMobile = &getMobile('page'); |
175 | 175 | $oPageMobile->module_info = $this->module_info; |
176 | 176 | $page_type_name = strtolower($this->module_info->page_type); |
177 | 177 | $method = '_get' . ucfirst($page_type_name) . 'Content'; |
178 | - if(method_exists($oPageMobile, $method)) |
|
178 | + if (method_exists($oPageMobile, $method)) |
|
179 | 179 | { |
180 | - if($method == '_getArticleContent' && $this->module_info->is_mskin_fix == 'N') |
|
180 | + if ($method == '_getArticleContent' && $this->module_info->is_mskin_fix == 'N') |
|
181 | 181 | { |
182 | 182 | $oModuleModel = getModel('module'); |
183 | 183 | $oPageMobile->module_info->mskin = $oModuleModel->getModuleDefaultSkin('page', 'M'); |
@@ -230,16 +230,16 @@ discard block |
||
230 | 230 | function _setWidgetTypeContentModify($isMobile = false) |
231 | 231 | { |
232 | 232 | // Setting contents |
233 | - if($isMobile) |
|
233 | + if ($isMobile) |
|
234 | 234 | { |
235 | 235 | $content = Context::get('mcontent'); |
236 | - if(!$content) $content = $this->module_info->mcontent; |
|
236 | + if (!$content) $content = $this->module_info->mcontent; |
|
237 | 237 | $templateFile = 'page_mobile_content_modify'; |
238 | 238 | } |
239 | 239 | else |
240 | 240 | { |
241 | 241 | $content = Context::get('content'); |
242 | - if(!$content) $content = $this->module_info->content; |
|
242 | + if (!$content) $content = $this->module_info->content; |
|
243 | 243 | $templateFile = 'page_content_modify'; |
244 | 244 | } |
245 | 245 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | //Security |
258 | 258 | $security = new Security(); |
259 | - $security->encodeHTML('widget_list..title','module_info.mid'); |
|
259 | + $security->encodeHTML('widget_list..title', 'module_info.mid'); |
|
260 | 260 | |
261 | 261 | // Set a template file |
262 | 262 | $this->setTemplateFile($templateFile); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $oDocumentModel = getModel('document'); |
268 | 268 | $oDocument = $oDocumentModel->getDocument(0, true); |
269 | 269 | |
270 | - if($isMobile) |
|
270 | + if ($isMobile) |
|
271 | 271 | { |
272 | 272 | Context::set('isMobile', 'Y'); |
273 | 273 | $target = 'mdocument_srl'; |
@@ -278,13 +278,13 @@ discard block |
||
278 | 278 | $target = 'document_srl'; |
279 | 279 | } |
280 | 280 | |
281 | - if($this->module_info->{$target}) |
|
281 | + if ($this->module_info->{$target}) |
|
282 | 282 | { |
283 | 283 | $document_srl = $this->module_info->{$target}; |
284 | 284 | $oDocument->setDocument($document_srl); |
285 | 285 | Context::set('document_srl', $document_srl); |
286 | 286 | } |
287 | - else if(Context::get('document_srl')) |
|
287 | + else if (Context::get('document_srl')) |
|
288 | 288 | { |
289 | 289 | $document_srl = Context::get('document_srl'); |
290 | 290 | $oDocument->setDocument($document_srl); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | $oDocument->add('module_srl', $this->module_info->module_srl); |
296 | 296 | } |
297 | 297 | |
298 | - Context::addJsFilter($this->module_path.'tpl/filter', 'insert_article.xml'); |
|
298 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_article.xml'); |
|
299 | 299 | Context::set('oDocument', $oDocument); |
300 | 300 | Context::set('mid', $this->module_info->mid); |
301 | 301 | $this->setTemplateFile('article_content_modify'); |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | function dispPageAdminDelete() |
308 | 308 | { |
309 | 309 | $module_srl = Context::get('module_srl'); |
310 | - if(!$module_srl) return $this->dispContent(); |
|
310 | + if (!$module_srl) return $this->dispContent(); |
|
311 | 311 | |
312 | 312 | $oModuleModel = getModel('module'); |
313 | 313 | $columnList = array('module_srl', 'module', 'mid'); |
314 | 314 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
315 | - Context::set('module_info',$module_info); |
|
315 | + Context::set('module_info', $module_info); |
|
316 | 316 | // Set a template file |
317 | 317 | $this->setTemplateFile('page_delete'); |
318 | 318 |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | Context::set('module_srl',''); |
30 | 30 | $this->act = 'list'; |
31 | - } |
|
32 | - else |
|
31 | + } else |
|
33 | 32 | { |
34 | 33 | ModuleModel::syncModuleToSite($module_info); |
35 | 34 | $this->module_info = $module_info; |
@@ -62,7 +61,9 @@ discard block |
||
62 | 61 | $search_target_list = array('s_mid','s_browser_title'); |
63 | 62 | $search_target = Context::get('search_target'); |
64 | 63 | $search_keyword = Context::get('search_keyword'); |
65 | - if(in_array($search_target,$search_target_list) && $search_keyword) $args->{$search_target} = $search_keyword; |
|
64 | + if(in_array($search_target,$search_target_list) && $search_keyword) { |
|
65 | + $args->{$search_target} = $search_keyword; |
|
66 | + } |
|
66 | 67 | |
67 | 68 | $output = executeQuery('page.getPageList', $args); |
68 | 69 | $oModuleModel = getModel('module'); |
@@ -101,7 +102,9 @@ discard block |
||
101 | 102 | $module_srl = Context::get('module_srl'); |
102 | 103 | $module_info = Context::get('module_info'); |
103 | 104 | // If you do not value module_srl just showing the index page |
104 | - if(!$module_srl) return $this->dispPageAdminContent(); |
|
105 | + if(!$module_srl) { |
|
106 | + return $this->dispPageAdminContent(); |
|
107 | + } |
|
105 | 108 | // If the layout is destined to add layout information haejum (layout_title, layout) |
106 | 109 | if($module_info->layout_srl) |
107 | 110 | { |
@@ -183,8 +186,7 @@ discard block |
||
183 | 186 | $oPageMobile->module_info->mskin = $oModuleModel->getModuleDefaultSkin('page', 'M'); |
184 | 187 | } |
185 | 188 | $page_content = $oPageMobile->{$method}(); |
186 | - } |
|
187 | - else |
|
189 | + } else |
|
188 | 190 | { |
189 | 191 | return new Object(-1, sprintf('%s method is not exists', $method)); |
190 | 192 | } |
@@ -202,8 +204,7 @@ discard block |
||
202 | 204 | if ($this->module_info->page_type == 'WIDGET') |
203 | 205 | { |
204 | 206 | $this->_setWidgetTypeContentModify(true); |
205 | - } |
|
206 | - else if ($this->module_info->page_type == 'ARTICLE') |
|
207 | + } else if ($this->module_info->page_type == 'ARTICLE') |
|
207 | 208 | { |
208 | 209 | $this->_setArticleTypeContentModify(true); |
209 | 210 | } |
@@ -220,8 +221,7 @@ discard block |
||
220 | 221 | if ($this->module_info->page_type == 'WIDGET') |
221 | 222 | { |
222 | 223 | $this->_setWidgetTypeContentModify(); |
223 | - } |
|
224 | - else if ($this->module_info->page_type == 'ARTICLE') |
|
224 | + } else if ($this->module_info->page_type == 'ARTICLE') |
|
225 | 225 | { |
226 | 226 | $this->_setArticleTypeContentModify(); |
227 | 227 | } |
@@ -233,13 +233,16 @@ discard block |
||
233 | 233 | if($isMobile) |
234 | 234 | { |
235 | 235 | $content = Context::get('mcontent'); |
236 | - if(!$content) $content = $this->module_info->mcontent; |
|
236 | + if(!$content) { |
|
237 | + $content = $this->module_info->mcontent; |
|
238 | + } |
|
237 | 239 | $templateFile = 'page_mobile_content_modify'; |
238 | - } |
|
239 | - else |
|
240 | + } else |
|
240 | 241 | { |
241 | 242 | $content = Context::get('content'); |
242 | - if(!$content) $content = $this->module_info->content; |
|
243 | + if(!$content) { |
|
244 | + $content = $this->module_info->content; |
|
245 | + } |
|
243 | 246 | $templateFile = 'page_content_modify'; |
244 | 247 | } |
245 | 248 | |
@@ -271,8 +274,7 @@ discard block |
||
271 | 274 | { |
272 | 275 | Context::set('isMobile', 'Y'); |
273 | 276 | $target = 'mdocument_srl'; |
274 | - } |
|
275 | - else |
|
277 | + } else |
|
276 | 278 | { |
277 | 279 | Context::set('isMobile', 'N'); |
278 | 280 | $target = 'document_srl'; |
@@ -283,14 +285,12 @@ discard block |
||
283 | 285 | $document_srl = $this->module_info->{$target}; |
284 | 286 | $oDocument->setDocument($document_srl); |
285 | 287 | Context::set('document_srl', $document_srl); |
286 | - } |
|
287 | - else if(Context::get('document_srl')) |
|
288 | + } else if(Context::get('document_srl')) |
|
288 | 289 | { |
289 | 290 | $document_srl = Context::get('document_srl'); |
290 | 291 | $oDocument->setDocument($document_srl); |
291 | 292 | Context::set('document_srl', $document_srl); |
292 | - } |
|
293 | - else |
|
293 | + } else |
|
294 | 294 | { |
295 | 295 | $oDocument->add('module_srl', $this->module_info->module_srl); |
296 | 296 | } |
@@ -307,7 +307,9 @@ discard block |
||
307 | 307 | function dispPageAdminDelete() |
308 | 308 | { |
309 | 309 | $module_srl = Context::get('module_srl'); |
310 | - if(!$module_srl) return $this->dispContent(); |
|
310 | + if(!$module_srl) { |
|
311 | + return $this->dispContent(); |
|
312 | + } |
|
311 | 313 | |
312 | 314 | $oModuleModel = getModel('module'); |
313 | 315 | $columnList = array('module_srl', 'module', 'mid'); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pageAPI |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief View Action page for the module API processing |
|
7 | - */ |
|
4 | + * @class pageAPI |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief View Action page for the module API processing |
|
7 | + */ |
|
8 | 8 | class pageAPI extends page |
9 | 9 | { |
10 | 10 | /** |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $oWidgetController->triggerWidgetCompile($page_content); |
21 | 21 | Context::setResponseMethod($requestMethod); |
22 | 22 | |
23 | - $oModule->add('page_content',$page_content); |
|
23 | + $oModule->add('page_content', $page_content); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | /* End of file page.api.php */ |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class page |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief high class of the module page |
|
7 | - */ |
|
4 | + * @class page |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief high class of the module page |
|
7 | + */ |
|
8 | 8 | class page extends ModuleObject |
9 | 9 | { |
10 | 10 | /** |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | function checkUpdate() |
25 | 25 | { |
26 | 26 | $output = executeQuery('page.pageTypeOpageCheck'); |
27 | - if($output->toBool() && $output->data) return true; |
|
27 | + if ($output->toBool() && $output->data) return true; |
|
28 | 28 | |
29 | 29 | $output = executeQuery('page.pageTypeNullCheck'); |
30 | - if($output->toBool() && $output->data) return true; |
|
30 | + if ($output->toBool() && $output->data) return true; |
|
31 | 31 | |
32 | 32 | return false; |
33 | 33 | } |
@@ -40,43 +40,43 @@ discard block |
||
40 | 40 | $args = new stdClass; |
41 | 41 | // opage module instance update |
42 | 42 | $output = executeQueryArray('page.pageTypeOpageCheck'); |
43 | - if($output->toBool() && count($output->data) > 0) |
|
43 | + if ($output->toBool() && count($output->data) > 0) |
|
44 | 44 | { |
45 | - foreach($output->data as $val) |
|
45 | + foreach ($output->data as $val) |
|
46 | 46 | { |
47 | 47 | $args->module_srl = $val->module_srl; |
48 | 48 | $args->name = 'page_type'; |
49 | - $args->value= 'OUTSIDE'; |
|
49 | + $args->value = 'OUTSIDE'; |
|
50 | 50 | $in_out = executeQuery('page.insertPageType', $args); |
51 | 51 | } |
52 | 52 | $output = executeQuery('page.updateAllOpage'); |
53 | - if(!$output->toBool()) return $output; |
|
53 | + if (!$output->toBool()) return $output; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // old page module instance update |
57 | 57 | $output = executeQueryArray('page.pageTypeNullCheck'); |
58 | 58 | $skin_update_srls = array(); |
59 | - if($output->toBool() && $output->data) |
|
59 | + if ($output->toBool() && $output->data) |
|
60 | 60 | { |
61 | - foreach($output->data as $val) |
|
61 | + foreach ($output->data as $val) |
|
62 | 62 | { |
63 | 63 | $args->module_srl = $val->module_srl; |
64 | 64 | $args->name = 'page_type'; |
65 | - $args->value= 'WIDGET'; |
|
65 | + $args->value = 'WIDGET'; |
|
66 | 66 | $in_out = executeQuery('page.insertPageType', $args); |
67 | 67 | |
68 | 68 | $skin_update_srls[] = $val->module_srl; |
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if(count($skin_update_srls)>0) |
|
72 | + if (count($skin_update_srls) > 0) |
|
73 | 73 | { |
74 | 74 | $skin_args = new stdClass; |
75 | - $skin_args->module_srls = implode(',',$skin_update_srls); |
|
75 | + $skin_args->module_srls = implode(',', $skin_update_srls); |
|
76 | 76 | $skin_args->is_skin_fix = "Y"; |
77 | 77 | $ouput = executeQuery('page.updateSkinFix', $skin_args); |
78 | 78 | } |
79 | - return new Object(0,'success_updated'); |
|
79 | + return new Object(0, 'success_updated'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -24,10 +24,14 @@ discard block |
||
24 | 24 | function checkUpdate() |
25 | 25 | { |
26 | 26 | $output = executeQuery('page.pageTypeOpageCheck'); |
27 | - if($output->toBool() && $output->data) return true; |
|
27 | + if($output->toBool() && $output->data) { |
|
28 | + return true; |
|
29 | + } |
|
28 | 30 | |
29 | 31 | $output = executeQuery('page.pageTypeNullCheck'); |
30 | - if($output->toBool() && $output->data) return true; |
|
32 | + if($output->toBool() && $output->data) { |
|
33 | + return true; |
|
34 | + } |
|
31 | 35 | |
32 | 36 | return false; |
33 | 37 | } |
@@ -50,7 +54,9 @@ discard block |
||
50 | 54 | $in_out = executeQuery('page.insertPageType', $args); |
51 | 55 | } |
52 | 56 | $output = executeQuery('page.updateAllOpage'); |
53 | - if(!$output->toBool()) return $output; |
|
57 | + if(!$output->toBool()) { |
|
58 | + return $output; |
|
59 | + } |
|
54 | 60 | } |
55 | 61 | |
56 | 62 | // old page module instance update |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class documentController |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief controller class of the document module |
|
7 | - */ |
|
4 | + * @class documentController |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief controller class of the document module |
|
7 | + */ |
|
8 | 8 | class pageController extends page |
9 | 9 | { |
10 | 10 | var $target_path = ''; |
@@ -29,24 +29,24 @@ discard block |
||
29 | 29 | function getHeadScript($content) |
30 | 30 | { |
31 | 31 | // remove the title tag |
32 | - $content = preg_replace('!<title([^>]*)>(.*?)<\/title>!is','', $content); |
|
32 | + $content = preg_replace('!<title([^>]*)>(.*?)<\/title>!is', '', $content); |
|
33 | 33 | // Remove meta tags |
34 | - $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is','', $content); |
|
34 | + $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is', '', $content); |
|
35 | 35 | // Extract information such as <link, <style, <script and so on |
36 | 36 | preg_match_all('!<link([^>]*)>!is', $content, $link_buff); |
37 | - for($i=0;$i<count($link_buff[0]);$i++) |
|
37 | + for ($i = 0; $i < count($link_buff[0]); $i++) |
|
38 | 38 | { |
39 | 39 | $tmp_str = trim($link_buff[0][$i]); |
40 | - if(!$tmp_str) continue; |
|
41 | - $header_script .= $tmp_str."\n"; |
|
40 | + if (!$tmp_str) continue; |
|
41 | + $header_script .= $tmp_str . "\n"; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | preg_match_all('!<(style|script)(.*?)<\/(style|script)>!is', $content, $script_buff); |
45 | - for($i=0;$i<count($script_buff[0]);$i++) |
|
45 | + for ($i = 0; $i < count($script_buff[0]); $i++) |
|
46 | 46 | { |
47 | 47 | $tmp_str = trim($script_buff[0][$i]); |
48 | - if(!$tmp_str) continue; |
|
49 | - $header_script .= $tmp_str."\n"; |
|
48 | + if (!$tmp_str) continue; |
|
49 | + $header_script .= $tmp_str . "\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $header_script; |
@@ -72,22 +72,22 @@ discard block |
||
72 | 72 | function replaceSrc($content, $path) |
73 | 73 | { |
74 | 74 | $url_info = parse_url($path); |
75 | - $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); |
|
76 | - $this->host = $host.'/'; |
|
75 | + $host = sprintf("%s://%s%s", $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : ''); |
|
76 | + $this->host = $host . '/'; |
|
77 | 77 | $path = $url_info['path']; |
78 | - if(substr($path,-1)=='/') $path = substr($path,-1); |
|
79 | - $t = explode('/',$path); |
|
78 | + if (substr($path, -1) == '/') $path = substr($path, -1); |
|
79 | + $t = explode('/', $path); |
|
80 | 80 | $_t = array(); |
81 | - for($i=0,$c=count($t)-1;$i<$c;$i++) |
|
81 | + for ($i = 0, $c = count($t) - 1; $i < $c; $i++) |
|
82 | 82 | { |
83 | 83 | $v = trim($t[$i]); |
84 | - if(!$v) continue; |
|
84 | + if (!$v) continue; |
|
85 | 85 | $_t[] = $v; |
86 | 86 | } |
87 | - $path = $host.'/'.implode('/',$_t); |
|
88 | - if(substr($path,-1)!='/') $path .= '/'; |
|
87 | + $path = $host . '/' . implode('/', $_t); |
|
88 | + if (substr($path, -1) != '/') $path .= '/'; |
|
89 | 89 | $this->path = $path; |
90 | - $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); |
|
90 | + $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is', array($this, '_replacePath'), $content); |
|
91 | 91 | |
92 | 92 | return $content; |
93 | 93 | } |
@@ -95,18 +95,18 @@ discard block |
||
95 | 95 | function _replacePath($matches) |
96 | 96 | { |
97 | 97 | $val = trim($matches[3]); |
98 | - if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; |
|
99 | - if(substr($val,0,2)=='./') |
|
98 | + if (preg_match('/^(http|https|ftp|telnet|mms|mailto)/i', $val)) return $matches[0]; |
|
99 | + if (substr($val, 0, 2) == './') |
|
100 | 100 | { |
101 | - $path = $this->path.substr($val,2); |
|
101 | + $path = $this->path . substr($val, 2); |
|
102 | 102 | } |
103 | - elseif(substr($val,0,1)=='/') |
|
103 | + elseif (substr($val, 0, 1) == '/') |
|
104 | 104 | { |
105 | - $path = $this->host.substr($val,1); |
|
105 | + $path = $this->host . substr($val, 1); |
|
106 | 106 | } |
107 | 107 | else |
108 | 108 | { |
109 | - $path = $this->path.$val; |
|
109 | + $path = $this->path . $val; |
|
110 | 110 | } |
111 | 111 | return sprintf("%s%s%s%s", $matches[1], $matches[2], $path, $matches[4]); |
112 | 112 | } |
@@ -37,7 +37,9 @@ discard block |
||
37 | 37 | for($i=0;$i<count($link_buff[0]);$i++) |
38 | 38 | { |
39 | 39 | $tmp_str = trim($link_buff[0][$i]); |
40 | - if(!$tmp_str) continue; |
|
40 | + if(!$tmp_str) { |
|
41 | + continue; |
|
42 | + } |
|
41 | 43 | $header_script .= $tmp_str."\n"; |
42 | 44 | } |
43 | 45 | |
@@ -45,7 +47,9 @@ discard block |
||
45 | 47 | for($i=0;$i<count($script_buff[0]);$i++) |
46 | 48 | { |
47 | 49 | $tmp_str = trim($script_buff[0][$i]); |
48 | - if(!$tmp_str) continue; |
|
50 | + if(!$tmp_str) { |
|
51 | + continue; |
|
52 | + } |
|
49 | 53 | $header_script .= $tmp_str."\n"; |
50 | 54 | } |
51 | 55 | |
@@ -75,17 +79,23 @@ discard block |
||
75 | 79 | $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); |
76 | 80 | $this->host = $host.'/'; |
77 | 81 | $path = $url_info['path']; |
78 | - if(substr($path,-1)=='/') $path = substr($path,-1); |
|
82 | + if(substr($path,-1)=='/') { |
|
83 | + $path = substr($path,-1); |
|
84 | + } |
|
79 | 85 | $t = explode('/',$path); |
80 | 86 | $_t = array(); |
81 | 87 | for($i=0,$c=count($t)-1;$i<$c;$i++) |
82 | 88 | { |
83 | 89 | $v = trim($t[$i]); |
84 | - if(!$v) continue; |
|
90 | + if(!$v) { |
|
91 | + continue; |
|
92 | + } |
|
85 | 93 | $_t[] = $v; |
86 | 94 | } |
87 | 95 | $path = $host.'/'.implode('/',$_t); |
88 | - if(substr($path,-1)!='/') $path .= '/'; |
|
96 | + if(substr($path,-1)!='/') { |
|
97 | + $path .= '/'; |
|
98 | + } |
|
89 | 99 | $this->path = $path; |
90 | 100 | $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); |
91 | 101 | |
@@ -95,16 +105,16 @@ discard block |
||
95 | 105 | function _replacePath($matches) |
96 | 106 | { |
97 | 107 | $val = trim($matches[3]); |
98 | - if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; |
|
108 | + if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) { |
|
109 | + return $matches[0]; |
|
110 | + } |
|
99 | 111 | if(substr($val,0,2)=='./') |
100 | 112 | { |
101 | 113 | $path = $this->path.substr($val,2); |
102 | - } |
|
103 | - elseif(substr($val,0,1)=='/') |
|
114 | + } elseif(substr($val,0,1)=='/') |
|
104 | 115 | { |
105 | 116 | $path = $this->host.substr($val,1); |
106 | - } |
|
107 | - else |
|
117 | + } else |
|
108 | 118 | { |
109 | 119 | $path = $this->path.$val; |
110 | 120 | } |
@@ -1,26 +1,26 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | -require_once(_XE_PATH_.'modules/page/page.view.php'); |
|
3 | +require_once(_XE_PATH_ . 'modules/page/page.view.php'); |
|
4 | 4 | |
5 | 5 | class pageMobile extends pageView |
6 | 6 | { |
7 | 7 | function init() |
8 | 8 | { |
9 | 9 | // Get a template path (page in the administrative template tpl putting together) |
10 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
10 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
11 | 11 | |
12 | - switch($this->module_info->page_type) |
|
12 | + switch ($this->module_info->page_type) |
|
13 | 13 | { |
14 | 14 | case 'WIDGET' : |
15 | 15 | { |
16 | 16 | $this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus()); |
17 | - $this->interval = (int)($this->module_info->page_caching_interval); |
|
17 | + $this->interval = (int) ($this->module_info->page_caching_interval); |
|
18 | 18 | break; |
19 | 19 | } |
20 | 20 | case 'OUTSIDE' : |
21 | 21 | { |
22 | 22 | $this->cache_file = sprintf("./files/cache/opage/%d.%s.m.cache.php", $this->module_info->module_srl, Context::getSslStatus()); |
23 | - $this->interval = (int)($this->module_info->page_caching_interval); |
|
23 | + $this->interval = (int) ($this->module_info->page_caching_interval); |
|
24 | 24 | $this->path = $this->module_info->mpath; |
25 | 25 | break; |
26 | 26 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | function dispPageIndex() |
31 | 31 | { |
32 | 32 | // Variables used in the template Context:: set() |
33 | - if($this->module_srl) Context::set('module_srl',$this->module_srl); |
|
33 | + if ($this->module_srl) Context::set('module_srl', $this->module_srl); |
|
34 | 34 | |
35 | 35 | $page_type_name = strtolower($this->module_info->page_type); |
36 | 36 | $method = '_get' . ucfirst($page_type_name) . 'Content'; |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | function _getWidgetContent() |
47 | 47 | { |
48 | 48 | // Arrange a widget ryeolro |
49 | - if($this->module_info->mcontent) |
|
49 | + if ($this->module_info->mcontent) |
|
50 | 50 | { |
51 | 51 | $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); |
52 | - $interval = (int)($this->module_info->page_caching_interval); |
|
53 | - if($interval>0) |
|
52 | + $interval = (int) ($this->module_info->page_caching_interval); |
|
53 | + if ($interval > 0) |
|
54 | 54 | { |
55 | - if(!file_exists($cache_file) || filesize($cache_file) < 1) |
|
55 | + if (!file_exists($cache_file) || filesize($cache_file) < 1) |
|
56 | 56 | { |
57 | 57 | $mtime = 0; |
58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $mtime = filemtime($cache_file); |
62 | 62 | } |
63 | 63 | |
64 | - if($mtime + $interval*60 > $_SERVER['REQUEST_TIME']) |
|
64 | + if ($mtime + $interval * 60 > $_SERVER['REQUEST_TIME']) |
|
65 | 65 | { |
66 | 66 | $page_content = FileHandler::readFile($cache_file); |
67 | 67 | $page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | else |
77 | 77 | { |
78 | - if(file_exists($cache_file)) |
|
78 | + if (file_exists($cache_file)) |
|
79 | 79 | { |
80 | 80 | FileHandler::removeFile($cache_file); |
81 | 81 | } |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | $oDocumentModel = getModel('document'); |
98 | 98 | $oDocument = $oDocumentModel->getDocument(0, true); |
99 | 99 | |
100 | - if($this->module_info->mdocument_srl) |
|
100 | + if ($this->module_info->mdocument_srl) |
|
101 | 101 | { |
102 | 102 | $document_srl = $this->module_info->mdocument_srl; |
103 | 103 | $oDocument->setDocument($document_srl); |
104 | 104 | Context::set('document_srl', $document_srl); |
105 | 105 | } |
106 | - if(!$oDocument->isExists()) |
|
106 | + if (!$oDocument->isExists()) |
|
107 | 107 | { |
108 | 108 | $document_srl = $this->module_info->document_srl; |
109 | 109 | $oDocument->setDocument($document_srl); |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | } |
112 | 112 | Context::set('oDocument', $oDocument); |
113 | 113 | |
114 | - if($this->module_info->mskin) |
|
114 | + if ($this->module_info->mskin) |
|
115 | 115 | { |
116 | - $templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->mskin)); |
|
116 | + $templatePath = (sprintf($this->module_path . 'm.skins/%s', $this->module_info->mskin)); |
|
117 | 117 | } |
118 | 118 | else |
119 | 119 | { |
120 | - $templatePath = ($this->module_path.'m.skins/default'); |
|
120 | + $templatePath = ($this->module_path . 'm.skins/default'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | $page_content = $oTemplate->compile($templatePath, 'mobile'); |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | function _getOutsideContent() |
129 | 129 | { |
130 | 130 | // check if it is http or internal file |
131 | - if($this->path) |
|
131 | + if ($this->path) |
|
132 | 132 | { |
133 | - if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
133 | + if (preg_match("/^([a-z]+):\/\//i", $this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
134 | 134 | else $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
135 | 135 | } |
136 | 136 |
@@ -30,12 +30,17 @@ discard block |
||
30 | 30 | function dispPageIndex() |
31 | 31 | { |
32 | 32 | // Variables used in the template Context:: set() |
33 | - if($this->module_srl) Context::set('module_srl',$this->module_srl); |
|
33 | + if($this->module_srl) { |
|
34 | + Context::set('module_srl',$this->module_srl); |
|
35 | + } |
|
34 | 36 | |
35 | 37 | $page_type_name = strtolower($this->module_info->page_type); |
36 | 38 | $method = '_get' . ucfirst($page_type_name) . 'Content'; |
37 | - if (method_exists($this, $method)) $page_content = $this->{$method}(); |
|
38 | - else return new Object(-1, sprintf('%s method is not exists', $method)); |
|
39 | + if (method_exists($this, $method)) { |
|
40 | + $page_content = $this->{$method}(); |
|
41 | + } else { |
|
42 | + return new Object(-1, sprintf('%s method is not exists', $method)); |
|
43 | + } |
|
39 | 44 | |
40 | 45 | Context::set('module_info', $this->module_info); |
41 | 46 | Context::set('page_content', $page_content); |
@@ -55,8 +60,7 @@ discard block |
||
55 | 60 | if(!file_exists($cache_file) || filesize($cache_file) < 1) |
56 | 61 | { |
57 | 62 | $mtime = 0; |
58 | - } |
|
59 | - else |
|
63 | + } else |
|
60 | 64 | { |
61 | 65 | $mtime = filemtime($cache_file); |
62 | 66 | } |
@@ -65,15 +69,13 @@ discard block |
||
65 | 69 | { |
66 | 70 | $page_content = FileHandler::readFile($cache_file); |
67 | 71 | $page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content); |
68 | - } |
|
69 | - else |
|
72 | + } else |
|
70 | 73 | { |
71 | 74 | $oWidgetController = getController('widget'); |
72 | 75 | $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent); |
73 | 76 | FileHandler::writeFile($cache_file, $page_content); |
74 | 77 | } |
75 | - } |
|
76 | - else |
|
78 | + } else |
|
77 | 79 | { |
78 | 80 | if(file_exists($cache_file)) |
79 | 81 | { |
@@ -81,8 +83,7 @@ discard block |
||
81 | 83 | } |
82 | 84 | $page_content = $this->module_info->mcontent; |
83 | 85 | } |
84 | - } |
|
85 | - else |
|
86 | + } else |
|
86 | 87 | { |
87 | 88 | $page_content = $this->module_info->content; |
88 | 89 | } |
@@ -114,8 +115,7 @@ discard block |
||
114 | 115 | if($this->module_info->mskin) |
115 | 116 | { |
116 | 117 | $templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->mskin)); |
117 | - } |
|
118 | - else |
|
118 | + } else |
|
119 | 119 | { |
120 | 120 | $templatePath = ($this->module_path.'m.skins/default'); |
121 | 121 | } |
@@ -130,8 +130,11 @@ discard block |
||
130 | 130 | // check if it is http or internal file |
131 | 131 | if($this->path) |
132 | 132 | { |
133 | - if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
134 | - else $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
|
133 | + if(preg_match("/^([a-z]+):\/\//i",$this->path)) { |
|
134 | + $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
135 | + } else { |
|
136 | + $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
|
137 | + } |
|
135 | 138 | } |
136 | 139 | |
137 | 140 | return $content; |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pageWap |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief wap class page of the module |
|
7 | - */ |
|
4 | + * @class pageWap |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief wap class page of the module |
|
7 | + */ |
|
8 | 8 | class pageWap extends page |
9 | 9 | { |
10 | 10 | /** |
@@ -15,7 +15,7 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if (!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
19 | 19 | // The contents of the widget chuchulham |
20 | 20 | $oWidgetController = getController('widget'); |
21 | 21 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -15,7 +15,9 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if(!$this->grant->access) { |
|
19 | + return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
20 | + } |
|
19 | 21 | // The contents of the widget chuchulham |
20 | 22 | $oWidgetController = getController('widget'); |
21 | 23 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pointAdminController |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief The admin controller class of the point module |
|
7 | - */ |
|
4 | + * @class pointAdminController |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief The admin controller class of the point module |
|
7 | + */ |
|
8 | 8 | class pointAdminController extends point |
9 | 9 | { |
10 | 10 | /** |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | $args = Context::getRequestVars(); |
27 | 27 | |
28 | 28 | //if module IO config is off |
29 | - if($args->able_module == 'Y') |
|
29 | + if ($args->able_module == 'Y') |
|
30 | 30 | { |
31 | 31 | // Re-install triggers, if it was disabled. |
32 | - if($config->able_module == 'N') |
|
32 | + if ($config->able_module == 'N') |
|
33 | 33 | { |
34 | 34 | $this->moduleUpdate(); |
35 | 35 | } |
@@ -39,55 +39,55 @@ discard block |
||
39 | 39 | |
40 | 40 | // Check the point name |
41 | 41 | $config->point_name = $args->point_name; |
42 | - if(!$config->point_name) $config->point_name = 'point'; |
|
42 | + if (!$config->point_name) $config->point_name = 'point'; |
|
43 | 43 | // Specify the default points |
44 | - $config->signup_point = (int)$args->signup_point; |
|
45 | - $config->login_point = (int)$args->login_point; |
|
46 | - $config->insert_document = (int)$args->insert_document; |
|
47 | - $config->read_document = (int)$args->read_document; |
|
48 | - $config->insert_comment = (int)$args->insert_comment; |
|
49 | - $config->upload_file = (int)$args->upload_file; |
|
50 | - $config->download_file = (int)$args->download_file; |
|
51 | - $config->voted = (int)$args->voted; |
|
52 | - $config->blamed = (int)$args->blamed; |
|
44 | + $config->signup_point = (int) $args->signup_point; |
|
45 | + $config->login_point = (int) $args->login_point; |
|
46 | + $config->insert_document = (int) $args->insert_document; |
|
47 | + $config->read_document = (int) $args->read_document; |
|
48 | + $config->insert_comment = (int) $args->insert_comment; |
|
49 | + $config->upload_file = (int) $args->upload_file; |
|
50 | + $config->download_file = (int) $args->download_file; |
|
51 | + $config->voted = (int) $args->voted; |
|
52 | + $config->blamed = (int) $args->blamed; |
|
53 | 53 | // The highest level |
54 | 54 | $config->max_level = $args->max_level; |
55 | - if($config->max_level>1000) $config->max_level = 1000; |
|
56 | - if($config->max_level<1) $config->max_level = 1; |
|
55 | + if ($config->max_level > 1000) $config->max_level = 1000; |
|
56 | + if ($config->max_level < 1) $config->max_level = 1; |
|
57 | 57 | // Set the level icon |
58 | 58 | $config->level_icon = $args->level_icon; |
59 | 59 | // Check if downloads are not allowed |
60 | - if($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
60 | + if ($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
61 | 61 | else $config->disable_download = 'N'; |
62 | 62 | // Check if reading a document is not allowed |
63 | - if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
63 | + if ($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
64 | 64 | else $config->disable_read_document = 'N'; |
65 | 65 | |
66 | 66 | $oMemberModel = getModel('member'); |
67 | 67 | $group_list = $oMemberModel->getGroups(); |
68 | 68 | |
69 | 69 | // Per-level group configurations |
70 | - foreach($group_list as $group) |
|
70 | + foreach ($group_list as $group) |
|
71 | 71 | { |
72 | 72 | // Admin group should not be connected to point. |
73 | - if($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
73 | + if ($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
74 | 74 | |
75 | 75 | $group_srl = $group->group_srl; |
76 | 76 | |
77 | - if(isset($args->{'point_group_'.$group_srl})) |
|
77 | + if (isset($args->{'point_group_' . $group_srl})) |
|
78 | 78 | { |
79 | 79 | //if group level is higher than max level, change to max level |
80 | - if($args->{'point_group_'.$group_srl} > $args->max_level) |
|
80 | + if ($args->{'point_group_' . $group_srl} > $args->max_level) |
|
81 | 81 | { |
82 | - $args->{'point_group_'.$group_srl} = $args->max_level; |
|
82 | + $args->{'point_group_' . $group_srl} = $args->max_level; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | //if group level is lower than 1, change to 1 |
86 | - if($args->{'point_group_'.$group_srl} < 1) |
|
86 | + if ($args->{'point_group_' . $group_srl} < 1) |
|
87 | 87 | { |
88 | - $args->{'point_group_'.$group_srl} = 1; |
|
88 | + $args->{'point_group_' . $group_srl} = 1; |
|
89 | 89 | } |
90 | - $config->point_group[$group_srl] = $args->{'point_group_'.$group_srl}; |
|
90 | + $config->point_group[$group_srl] = $args->{'point_group_' . $group_srl}; |
|
91 | 91 | } |
92 | 92 | else |
93 | 93 | { |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $config->group_reset = $args->group_reset; |
99 | 99 | // Per-level point configurations |
100 | 100 | unset($config->level_step); |
101 | - for($i=1;$i<=$config->max_level;$i++) |
|
101 | + for ($i = 1; $i <= $config->max_level; $i++) |
|
102 | 102 | { |
103 | - $key = "level_step_".$i; |
|
104 | - $config->level_step[$i] = (int)$args->{$key}; |
|
103 | + $key = "level_step_" . $i; |
|
104 | + $config->level_step[$i] = (int) $args->{$key}; |
|
105 | 105 | } |
106 | 106 | // A function to calculate per-level points |
107 | 107 | $config->expression = $args->expression; |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | $args = Context::getRequestVars(); |
134 | 134 | |
135 | 135 | $configTypeList = array('insert_document', 'insert_comment', 'upload_file', 'download_file', 'read_document', 'voted', 'blamed'); |
136 | - foreach($configTypeList AS $config) |
|
136 | + foreach ($configTypeList AS $config) |
|
137 | 137 | { |
138 | - if(is_array($args->{$config})) |
|
138 | + if (is_array($args->{$config})) |
|
139 | 139 | { |
140 | - foreach($args->{$config} AS $key=>$value) |
|
140 | + foreach ($args->{$config} AS $key=>$value) |
|
141 | 141 | { |
142 | 142 | $module_config[$key][$config] = $value; |
143 | 143 | } |
@@ -145,19 +145,19 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | $oModuleController = getController('module'); |
148 | - if(count($module_config)) |
|
148 | + if (count($module_config)) |
|
149 | 149 | { |
150 | - foreach($module_config as $module_srl => $config) |
|
150 | + foreach ($module_config as $module_srl => $config) |
|
151 | 151 | { |
152 | - $oModuleController->insertModulePartConfig('point',$module_srl,$config); |
|
152 | + $oModuleController->insertModulePartConfig('point', $module_srl, $config); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->setMessage('success_updated'); |
157 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
157 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
158 | 158 | { |
159 | 159 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminModuleConfig'); |
160 | - header('location:'.$returnUrl); |
|
160 | + header('location:' . $returnUrl); |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | } |
@@ -168,24 +168,24 @@ discard block |
||
168 | 168 | function procPointAdminInsertPointModuleConfig() |
169 | 169 | { |
170 | 170 | $module_srl = Context::get('target_module_srl'); |
171 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
171 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
172 | 172 | // In case of batch configuration of several modules |
173 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
173 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl); |
|
174 | 174 | else $module_srl = array($module_srl); |
175 | 175 | // Save configurations |
176 | 176 | $oModuleController = getController('module'); |
177 | - for($i=0;$i<count($module_srl);$i++) |
|
177 | + for ($i = 0; $i < count($module_srl); $i++) |
|
178 | 178 | { |
179 | 179 | $srl = trim($module_srl[$i]); |
180 | - if(!$srl) continue; |
|
180 | + if (!$srl) continue; |
|
181 | 181 | unset($config); |
182 | - $config['insert_document'] = (int)Context::get('insert_document'); |
|
183 | - $config['insert_comment'] = (int)Context::get('insert_comment'); |
|
184 | - $config['upload_file'] = (int)Context::get('upload_file'); |
|
185 | - $config['download_file'] = (int)Context::get('download_file'); |
|
186 | - $config['read_document'] = (int)Context::get('read_document'); |
|
187 | - $config['voted'] = (int)Context::get('voted'); |
|
188 | - $config['blamed'] = (int)Context::get('blamed'); |
|
182 | + $config['insert_document'] = (int) Context::get('insert_document'); |
|
183 | + $config['insert_comment'] = (int) Context::get('insert_comment'); |
|
184 | + $config['upload_file'] = (int) Context::get('upload_file'); |
|
185 | + $config['download_file'] = (int) Context::get('download_file'); |
|
186 | + $config['read_document'] = (int) Context::get('read_document'); |
|
187 | + $config['voted'] = (int) Context::get('voted'); |
|
188 | + $config['blamed'] = (int) Context::get('blamed'); |
|
189 | 189 | $oModuleController->insertModulePartConfig('point', $srl, $config); |
190 | 190 | } |
191 | 191 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | preg_match('/^(\+|-)?([1-9][0-9]*)$/', $point, $m); |
208 | 208 | |
209 | 209 | $action = ''; |
210 | - switch($m[1]) |
|
210 | + switch ($m[1]) |
|
211 | 211 | { |
212 | 212 | case '+': |
213 | 213 | $action = 'add'; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $point = $m[2]; |
223 | 223 | |
224 | 224 | $oPointController = getController('point'); |
225 | - $output = $oPointController->setPoint($member_srl, (int)$point, $action); |
|
225 | + $output = $oPointController->setPoint($member_srl, (int) $point, $action); |
|
226 | 226 | |
227 | 227 | $this->setError(-1); |
228 | 228 | $this->setMessage('success_updated', 'info'); |
@@ -247,29 +247,29 @@ discard block |
||
247 | 247 | |
248 | 248 | // Get member infomation |
249 | 249 | $output = executeQueryArray('point.getMemberCount'); |
250 | - if(!$output->toBool()) return $output; |
|
250 | + if (!$output->toBool()) return $output; |
|
251 | 251 | |
252 | - if($output->data) |
|
252 | + if ($output->data) |
|
253 | 253 | { |
254 | - foreach($output->data as $key => $val) |
|
254 | + foreach ($output->data as $key => $val) |
|
255 | 255 | { |
256 | - if(!$val->member_srl) continue; |
|
256 | + if (!$val->member_srl) continue; |
|
257 | 257 | $member[$val->member_srl] = 0; |
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | 261 | // Get post information |
262 | 262 | $output = executeQueryArray('point.getDocumentPoint'); |
263 | - if(!$output->toBool()) return $output; |
|
263 | + if (!$output->toBool()) return $output; |
|
264 | 264 | |
265 | - if($output->data) |
|
265 | + if ($output->data) |
|
266 | 266 | { |
267 | - foreach($output->data as $key => $val) |
|
267 | + foreach ($output->data as $key => $val) |
|
268 | 268 | { |
269 | - if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
269 | + if ($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
270 | 270 | else $insert_point = $config->insert_document; |
271 | 271 | |
272 | - if(!$val->member_srl) continue; |
|
272 | + if (!$val->member_srl) continue; |
|
273 | 273 | $point = $insert_point * $val->count; |
274 | 274 | $member[$val->member_srl] += $point; |
275 | 275 | } |
@@ -278,16 +278,16 @@ discard block |
||
278 | 278 | $output = null; |
279 | 279 | // Get comments information |
280 | 280 | $output = executeQueryArray('point.getCommentPoint'); |
281 | - if(!$output->toBool()) return $output; |
|
281 | + if (!$output->toBool()) return $output; |
|
282 | 282 | |
283 | - if($output->data) |
|
283 | + if ($output->data) |
|
284 | 284 | { |
285 | - foreach($output->data as $key => $val) |
|
285 | + foreach ($output->data as $key => $val) |
|
286 | 286 | { |
287 | - if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
287 | + if ($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
288 | 288 | else $insert_point = $config->insert_comment; |
289 | 289 | |
290 | - if(!$val->member_srl) continue; |
|
290 | + if (!$val->member_srl) continue; |
|
291 | 291 | $point = $insert_point * $val->count; |
292 | 292 | $member[$val->member_srl] += $point; |
293 | 293 | } |
@@ -295,16 +295,16 @@ discard block |
||
295 | 295 | $output = null; |
296 | 296 | // Get the attached files' information |
297 | 297 | $output = executeQueryArray('point.getFilePoint'); |
298 | - if(!$output->toBool()) return $output; |
|
298 | + if (!$output->toBool()) return $output; |
|
299 | 299 | |
300 | - if($output->data) |
|
300 | + if ($output->data) |
|
301 | 301 | { |
302 | - foreach($output->data as $key => $val) |
|
302 | + foreach ($output->data as $key => $val) |
|
303 | 303 | { |
304 | - if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
304 | + if ($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
305 | 305 | else $insert_point = $config->upload_file; |
306 | 306 | |
307 | - if(!$val->member_srl) continue; |
|
307 | + if (!$val->member_srl) continue; |
|
308 | 308 | $point = $insert_point * $val->count; |
309 | 309 | $member[$val->member_srl] += $point; |
310 | 310 | } |
@@ -312,21 +312,21 @@ discard block |
||
312 | 312 | $output = null; |
313 | 313 | // Set all members' points to 0 |
314 | 314 | $output = executeQuery("point.initMemberPoint"); |
315 | - if(!$output->toBool()) return $output; |
|
315 | + if (!$output->toBool()) return $output; |
|
316 | 316 | // Save the file temporarily |
317 | 317 | |
318 | 318 | $str = ''; |
319 | - foreach($member as $key => $val) |
|
319 | + foreach ($member as $key => $val) |
|
320 | 320 | { |
321 | - $val += (int)$config->signup_point; |
|
322 | - $str .= $key.','.$val."\r\n"; |
|
321 | + $val += (int) $config->signup_point; |
|
322 | + $str .= $key . ',' . $val . "\r\n"; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | @file_put_contents('./files/cache/pointRecal.txt', $str, LOCK_EX); |
326 | 326 | |
327 | 327 | $this->add('total', count($member)); |
328 | 328 | $this->add('position', 0); |
329 | - $this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) ); |
|
329 | + $this->setMessage(sprintf(Context::getLang('point_recal_message'), 0, $this->get('total'))); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -334,35 +334,35 @@ discard block |
||
334 | 334 | */ |
335 | 335 | function procPointAdminApplyPoint() |
336 | 336 | { |
337 | - $position = (int)Context::get('position'); |
|
338 | - $total = (int)Context::get('total'); |
|
337 | + $position = (int) Context::get('position'); |
|
338 | + $total = (int) Context::get('total'); |
|
339 | 339 | |
340 | - if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
340 | + if (!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
341 | 341 | |
342 | 342 | $idx = 0; |
343 | - $f = fopen("./files/cache/pointRecal.txt","r"); |
|
344 | - while(!feof($f)) |
|
343 | + $f = fopen("./files/cache/pointRecal.txt", "r"); |
|
344 | + while (!feof($f)) |
|
345 | 345 | { |
346 | 346 | $str = trim(fgets($f, 1024)); |
347 | - $idx ++; |
|
348 | - if($idx > $position) |
|
347 | + $idx++; |
|
348 | + if ($idx > $position) |
|
349 | 349 | { |
350 | - list($member_srl, $point) = explode(',',$str); |
|
350 | + list($member_srl, $point) = explode(',', $str); |
|
351 | 351 | |
352 | 352 | $args = new stdClass(); |
353 | 353 | $args->member_srl = $member_srl; |
354 | 354 | $args->point = $point; |
355 | - $output = executeQuery('point.insertPoint',$args); |
|
356 | - if($idx%5000==0) break; |
|
355 | + $output = executeQuery('point.insertPoint', $args); |
|
356 | + if ($idx % 5000 == 0) break; |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | - if(feof($f)) |
|
360 | + if (feof($f)) |
|
361 | 361 | { |
362 | 362 | FileHandler::removeFile('./files/cache/pointRecal.txt'); |
363 | 363 | $idx = $total; |
364 | 364 | |
365 | - FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old'); |
|
365 | + FileHandler::rename('./files/member_extra_info/point', './files/member_extra_info/point.old'); |
|
366 | 366 | |
367 | 367 | FileHandler::removeDir('./files/member_extra_info/point.old'); |
368 | 368 | } |
@@ -380,16 +380,16 @@ discard block |
||
380 | 380 | function procPointAdminReset() |
381 | 381 | { |
382 | 382 | $module_srl = Context::get('module_srls'); |
383 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
383 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
384 | 384 | // In case of batch configuration of several modules |
385 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
385 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl); |
|
386 | 386 | else $module_srl = array($module_srl); |
387 | 387 | // Save configurations |
388 | 388 | $oModuleController = getController('module'); |
389 | - for($i=0;$i<count($module_srl);$i++) |
|
389 | + for ($i = 0; $i < count($module_srl); $i++) |
|
390 | 390 | { |
391 | 391 | $srl = trim($module_srl[$i]); |
392 | - if(!$srl) continue; |
|
392 | + if (!$srl) continue; |
|
393 | 393 | $args = new stdClass(); |
394 | 394 | $args->module = 'point'; |
395 | 395 | $args->module_srl = $srl; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
400 | - if($oCacheHandler->isSupport()) |
|
400 | + if ($oCacheHandler->isSupport()) |
|
401 | 401 | { |
402 | 402 | $oCacheHandler->invalidateGroupKey('site_and_module'); |
403 | 403 | } |
@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | // Check the point name |
41 | 41 | $config->point_name = $args->point_name; |
42 | - if(!$config->point_name) $config->point_name = 'point'; |
|
42 | + if(!$config->point_name) { |
|
43 | + $config->point_name = 'point'; |
|
44 | + } |
|
43 | 45 | // Specify the default points |
44 | 46 | $config->signup_point = (int)$args->signup_point; |
45 | 47 | $config->login_point = (int)$args->login_point; |
@@ -52,16 +54,26 @@ discard block |
||
52 | 54 | $config->blamed = (int)$args->blamed; |
53 | 55 | // The highest level |
54 | 56 | $config->max_level = $args->max_level; |
55 | - if($config->max_level>1000) $config->max_level = 1000; |
|
56 | - if($config->max_level<1) $config->max_level = 1; |
|
57 | + if($config->max_level>1000) { |
|
58 | + $config->max_level = 1000; |
|
59 | + } |
|
60 | + if($config->max_level<1) { |
|
61 | + $config->max_level = 1; |
|
62 | + } |
|
57 | 63 | // Set the level icon |
58 | 64 | $config->level_icon = $args->level_icon; |
59 | 65 | // Check if downloads are not allowed |
60 | - if($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
61 | - else $config->disable_download = 'N'; |
|
66 | + if($args->disable_download == 'Y') { |
|
67 | + $config->disable_download = 'Y'; |
|
68 | + } else { |
|
69 | + $config->disable_download = 'N'; |
|
70 | + } |
|
62 | 71 | // Check if reading a document is not allowed |
63 | - if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
64 | - else $config->disable_read_document = 'N'; |
|
72 | + if($args->disable_read_document == 'Y') { |
|
73 | + $config->disable_read_document = 'Y'; |
|
74 | + } else { |
|
75 | + $config->disable_read_document = 'N'; |
|
76 | + } |
|
65 | 77 | |
66 | 78 | $oMemberModel = getModel('member'); |
67 | 79 | $group_list = $oMemberModel->getGroups(); |
@@ -70,7 +82,9 @@ discard block |
||
70 | 82 | foreach($group_list as $group) |
71 | 83 | { |
72 | 84 | // Admin group should not be connected to point. |
73 | - if($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
85 | + if($group->is_admin == 'Y' || $group->is_default == 'Y') { |
|
86 | + continue; |
|
87 | + } |
|
74 | 88 | |
75 | 89 | $group_srl = $group->group_srl; |
76 | 90 | |
@@ -88,8 +102,7 @@ discard block |
||
88 | 102 | $args->{'point_group_'.$group_srl} = 1; |
89 | 103 | } |
90 | 104 | $config->point_group[$group_srl] = $args->{'point_group_'.$group_srl}; |
91 | - } |
|
92 | - else |
|
105 | + } else |
|
93 | 106 | { |
94 | 107 | unset($config->point_group[$group_srl]); |
95 | 108 | } |
@@ -105,8 +118,7 @@ discard block |
||
105 | 118 | } |
106 | 119 | // A function to calculate per-level points |
107 | 120 | $config->expression = $args->expression; |
108 | - } |
|
109 | - else |
|
121 | + } else |
|
110 | 122 | { |
111 | 123 | //module IO config is OFF, Other settings will not be modified. |
112 | 124 | $config->able_module = 'N'; |
@@ -168,16 +180,23 @@ discard block |
||
168 | 180 | function procPointAdminInsertPointModuleConfig() |
169 | 181 | { |
170 | 182 | $module_srl = Context::get('target_module_srl'); |
171 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
183 | + if(!$module_srl) { |
|
184 | + return new Object(-1, 'msg_invalid_request'); |
|
185 | + } |
|
172 | 186 | // In case of batch configuration of several modules |
173 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
174 | - else $module_srl = array($module_srl); |
|
187 | + if(preg_match('/^([0-9,]+)$/',$module_srl)) { |
|
188 | + $module_srl = explode(',',$module_srl); |
|
189 | + } else { |
|
190 | + $module_srl = array($module_srl); |
|
191 | + } |
|
175 | 192 | // Save configurations |
176 | 193 | $oModuleController = getController('module'); |
177 | 194 | for($i=0;$i<count($module_srl);$i++) |
178 | 195 | { |
179 | 196 | $srl = trim($module_srl[$i]); |
180 | - if(!$srl) continue; |
|
197 | + if(!$srl) { |
|
198 | + continue; |
|
199 | + } |
|
181 | 200 | unset($config); |
182 | 201 | $config['insert_document'] = (int)Context::get('insert_document'); |
183 | 202 | $config['insert_comment'] = (int)Context::get('insert_comment'); |
@@ -247,29 +266,40 @@ discard block |
||
247 | 266 | |
248 | 267 | // Get member infomation |
249 | 268 | $output = executeQueryArray('point.getMemberCount'); |
250 | - if(!$output->toBool()) return $output; |
|
269 | + if(!$output->toBool()) { |
|
270 | + return $output; |
|
271 | + } |
|
251 | 272 | |
252 | 273 | if($output->data) |
253 | 274 | { |
254 | 275 | foreach($output->data as $key => $val) |
255 | 276 | { |
256 | - if(!$val->member_srl) continue; |
|
277 | + if(!$val->member_srl) { |
|
278 | + continue; |
|
279 | + } |
|
257 | 280 | $member[$val->member_srl] = 0; |
258 | 281 | } |
259 | 282 | } |
260 | 283 | |
261 | 284 | // Get post information |
262 | 285 | $output = executeQueryArray('point.getDocumentPoint'); |
263 | - if(!$output->toBool()) return $output; |
|
286 | + if(!$output->toBool()) { |
|
287 | + return $output; |
|
288 | + } |
|
264 | 289 | |
265 | 290 | if($output->data) |
266 | 291 | { |
267 | 292 | foreach($output->data as $key => $val) |
268 | 293 | { |
269 | - if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
270 | - else $insert_point = $config->insert_document; |
|
294 | + if($module_config[$val->module_srl]['insert_document']) { |
|
295 | + $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
296 | + } else { |
|
297 | + $insert_point = $config->insert_document; |
|
298 | + } |
|
271 | 299 | |
272 | - if(!$val->member_srl) continue; |
|
300 | + if(!$val->member_srl) { |
|
301 | + continue; |
|
302 | + } |
|
273 | 303 | $point = $insert_point * $val->count; |
274 | 304 | $member[$val->member_srl] += $point; |
275 | 305 | } |
@@ -278,16 +308,23 @@ discard block |
||
278 | 308 | $output = null; |
279 | 309 | // Get comments information |
280 | 310 | $output = executeQueryArray('point.getCommentPoint'); |
281 | - if(!$output->toBool()) return $output; |
|
311 | + if(!$output->toBool()) { |
|
312 | + return $output; |
|
313 | + } |
|
282 | 314 | |
283 | 315 | if($output->data) |
284 | 316 | { |
285 | 317 | foreach($output->data as $key => $val) |
286 | 318 | { |
287 | - if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
288 | - else $insert_point = $config->insert_comment; |
|
319 | + if($module_config[$val->module_srl]['insert_comment']) { |
|
320 | + $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
321 | + } else { |
|
322 | + $insert_point = $config->insert_comment; |
|
323 | + } |
|
289 | 324 | |
290 | - if(!$val->member_srl) continue; |
|
325 | + if(!$val->member_srl) { |
|
326 | + continue; |
|
327 | + } |
|
291 | 328 | $point = $insert_point * $val->count; |
292 | 329 | $member[$val->member_srl] += $point; |
293 | 330 | } |
@@ -295,16 +332,23 @@ discard block |
||
295 | 332 | $output = null; |
296 | 333 | // Get the attached files' information |
297 | 334 | $output = executeQueryArray('point.getFilePoint'); |
298 | - if(!$output->toBool()) return $output; |
|
335 | + if(!$output->toBool()) { |
|
336 | + return $output; |
|
337 | + } |
|
299 | 338 | |
300 | 339 | if($output->data) |
301 | 340 | { |
302 | 341 | foreach($output->data as $key => $val) |
303 | 342 | { |
304 | - if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
305 | - else $insert_point = $config->upload_file; |
|
343 | + if($module_config[$val->module_srl]['upload_file']) { |
|
344 | + $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
345 | + } else { |
|
346 | + $insert_point = $config->upload_file; |
|
347 | + } |
|
306 | 348 | |
307 | - if(!$val->member_srl) continue; |
|
349 | + if(!$val->member_srl) { |
|
350 | + continue; |
|
351 | + } |
|
308 | 352 | $point = $insert_point * $val->count; |
309 | 353 | $member[$val->member_srl] += $point; |
310 | 354 | } |
@@ -312,7 +356,9 @@ discard block |
||
312 | 356 | $output = null; |
313 | 357 | // Set all members' points to 0 |
314 | 358 | $output = executeQuery("point.initMemberPoint"); |
315 | - if(!$output->toBool()) return $output; |
|
359 | + if(!$output->toBool()) { |
|
360 | + return $output; |
|
361 | + } |
|
316 | 362 | // Save the file temporarily |
317 | 363 | |
318 | 364 | $str = ''; |
@@ -337,7 +383,9 @@ discard block |
||
337 | 383 | $position = (int)Context::get('position'); |
338 | 384 | $total = (int)Context::get('total'); |
339 | 385 | |
340 | - if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
386 | + if(!file_exists('./files/cache/pointRecal.txt')) { |
|
387 | + return new Object(-1, 'msg_invalid_request'); |
|
388 | + } |
|
341 | 389 | |
342 | 390 | $idx = 0; |
343 | 391 | $f = fopen("./files/cache/pointRecal.txt","r"); |
@@ -353,7 +401,9 @@ discard block |
||
353 | 401 | $args->member_srl = $member_srl; |
354 | 402 | $args->point = $point; |
355 | 403 | $output = executeQuery('point.insertPoint',$args); |
356 | - if($idx%5000==0) break; |
|
404 | + if($idx%5000==0) { |
|
405 | + break; |
|
406 | + } |
|
357 | 407 | } |
358 | 408 | } |
359 | 409 | |
@@ -380,16 +430,23 @@ discard block |
||
380 | 430 | function procPointAdminReset() |
381 | 431 | { |
382 | 432 | $module_srl = Context::get('module_srls'); |
383 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
433 | + if(!$module_srl) { |
|
434 | + return new Object(-1, 'msg_invalid_request'); |
|
435 | + } |
|
384 | 436 | // In case of batch configuration of several modules |
385 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
386 | - else $module_srl = array($module_srl); |
|
437 | + if(preg_match('/^([0-9,]+)$/',$module_srl)) { |
|
438 | + $module_srl = explode(',',$module_srl); |
|
439 | + } else { |
|
440 | + $module_srl = array($module_srl); |
|
441 | + } |
|
387 | 442 | // Save configurations |
388 | 443 | $oModuleController = getController('module'); |
389 | 444 | for($i=0;$i<count($module_srl);$i++) |
390 | 445 | { |
391 | 446 | $srl = trim($module_srl[$i]); |
392 | - if(!$srl) continue; |
|
447 | + if(!$srl) { |
|
448 | + continue; |
|
449 | + } |
|
393 | 450 | $args = new stdClass(); |
394 | 451 | $args->module = 'point'; |
395 | 452 | $args->module_srl = $srl; |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | /** |
4 | - * @class pointAdminView |
|
5 | - * @author NAVER ([email protected]) |
|
6 | - * @brief The admin view class of the point module |
|
7 | - */ |
|
4 | + * @class pointAdminView |
|
5 | + * @author NAVER ([email protected]) |
|
6 | + * @brief The admin view class of the point module |
|
7 | + */ |
|
8 | 8 | class pointAdminView extends point |
9 | 9 | { |
10 | 10 | /** |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | |
21 | 21 | //Security |
22 | 22 | $security = new Security(); |
23 | - $security->encodeHTML('config.point_name','config.level_icon'); |
|
23 | + $security->encodeHTML('config.point_name', 'config.level_icon'); |
|
24 | 24 | $security->encodeHTML('module_info..'); |
25 | 25 | |
26 | 26 | // Set the template path |
27 | - $this->setTemplatePath($this->module_path.'tpl'); |
|
27 | + $this->setTemplatePath($this->module_path . 'tpl'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $oMemberModel = getModel('member'); |
40 | 40 | $group_list = $oMemberModel->getGroups(); |
41 | 41 | $selected_group_list = array(); |
42 | - if(count($group_list)) |
|
42 | + if (count($group_list)) |
|
43 | 43 | { |
44 | - foreach($group_list as $key => $val) |
|
44 | + foreach ($group_list as $key => $val) |
|
45 | 45 | { |
46 | 46 | $selected_group_list[$key] = $val; |
47 | 47 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | Context::set('group_list', $selected_group_list); |
50 | 50 | //Security |
51 | 51 | $security = new Security(); |
52 | - $security->encodeHTML('group_list..title','group_list..description'); |
|
52 | + $security->encodeHTML('group_list..title', 'group_list..description'); |
|
53 | 53 | |
54 | 54 | // Set the template |
55 | 55 | $this->setTemplateFile('config'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | Context::set('module_config', $oModuleModel->getModulePartConfigs('point')); |
70 | 70 | //Security |
71 | 71 | $security = new Security(); |
72 | - $security->encodeHTML('mid_list..browser_title','mid_list..mid'); |
|
72 | + $security->encodeHTML('mid_list..browser_title', 'mid_list..mid'); |
|
73 | 73 | |
74 | 74 | // Set the template |
75 | 75 | $this->setTemplateFile('module_config'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | Context::set('group_list', $this->group_list); |
116 | 116 | //Security |
117 | 117 | $security = new Security(); |
118 | - $security->encodeHTML('group_list..title','group_list..description'); |
|
118 | + $security->encodeHTML('group_list..title', 'group_list..description'); |
|
119 | 119 | $security->encodeHTML('member_list..'); |
120 | 120 | |
121 | 121 | // Set the template |