@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function getDocumentExtraVarsFromDB($documentSrls) |
37 | 37 | { |
38 | - if(!is_array($documentSrls) || count($documentSrls) == 0) |
|
38 | + if (!is_array($documentSrls) || count($documentSrls) == 0) |
|
39 | 39 | { |
40 | 40 | return new Object(-1, 'msg_invalid_request'); |
41 | 41 | } |
@@ -56,52 +56,52 @@ discard block |
||
56 | 56 | $_document_list = &$GLOBALS['XE_DOCUMENT_LIST']; |
57 | 57 | |
58 | 58 | // XE XE_DOCUMENT_LIST all documents that the object referred to the global variable settings |
59 | - if(count($_document_list) <= 0) return; |
|
59 | + if (count($_document_list) <= 0) return; |
|
60 | 60 | |
61 | 61 | // Find all called the document object variable has been set extension |
62 | 62 | $document_srls = array(); |
63 | - foreach($_document_list as $key => $val) |
|
63 | + foreach ($_document_list as $key => $val) |
|
64 | 64 | { |
65 | - if(!$val->document_srl || $checked_documents[$val->document_srl]) continue; |
|
65 | + if (!$val->document_srl || $checked_documents[$val->document_srl]) continue; |
|
66 | 66 | $checked_documents[$val->document_srl] = true; |
67 | 67 | $document_srls[] = $val->document_srl; |
68 | 68 | } |
69 | 69 | // If the document number, return detected |
70 | - if(!count($document_srls)) return; |
|
70 | + if (!count($document_srls)) return; |
|
71 | 71 | // Expand variables mijijeongdoen article about a current visitor to the extension of the language code, the search variable |
72 | 72 | //$obj->document_srl = implode(',',$document_srls); |
73 | 73 | $output = $this->getDocumentExtraVarsFromDB($document_srls); |
74 | - if($output->toBool() && $output->data) |
|
74 | + if ($output->toBool() && $output->data) |
|
75 | 75 | { |
76 | - foreach($output->data as $key => $val) |
|
76 | + foreach ($output->data as $key => $val) |
|
77 | 77 | { |
78 | - if(!isset($val->value)) continue; |
|
79 | - if(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); |
|
78 | + if (!isset($val->value)) continue; |
|
79 | + if (!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); |
|
80 | 80 | $extra_vars[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value); |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | $user_lang_code = Context::getLangType(); |
85 | - for($i=0,$c=count($document_srls);$i<$c;$i++) |
|
85 | + for ($i = 0, $c = count($document_srls); $i < $c; $i++) |
|
86 | 86 | { |
87 | 87 | $document_srl = $document_srls[$i]; |
88 | 88 | unset($vars); |
89 | 89 | |
90 | - if(!$_document_list[$document_srl] || !is_object($_document_list[$document_srl]) || !$_document_list[$document_srl]->isExists()) continue; |
|
90 | + if (!$_document_list[$document_srl] || !is_object($_document_list[$document_srl]) || !$_document_list[$document_srl]->isExists()) continue; |
|
91 | 91 | $module_srl = $_document_list[$document_srl]->get('module_srl'); |
92 | 92 | $extra_keys = $this->getExtraKeys($module_srl); |
93 | 93 | $vars = $extra_vars[$document_srl]; |
94 | 94 | $document_lang_code = $_document_list[$document_srl]->get('lang_code'); |
95 | 95 | // Expand the variable processing |
96 | - if(count($extra_keys)) |
|
96 | + if (count($extra_keys)) |
|
97 | 97 | { |
98 | - foreach($extra_keys as $idx => $key) |
|
98 | + foreach ($extra_keys as $idx => $key) |
|
99 | 99 | { |
100 | 100 | $extra_keys[$idx] = clone($key); |
101 | 101 | $val = $vars[$idx]; |
102 | - if(isset($val[$user_lang_code])) $v = $val[$user_lang_code]; |
|
103 | - else if(isset($val[$document_lang_code])) $v = $val[$document_lang_code]; |
|
104 | - else if(isset($val[0])) $v = $val[0]; |
|
102 | + if (isset($val[$user_lang_code])) $v = $val[$user_lang_code]; |
|
103 | + else if (isset($val[$document_lang_code])) $v = $val[$document_lang_code]; |
|
104 | + else if (isset($val[0])) $v = $val[0]; |
|
105 | 105 | else $v = null; |
106 | 106 | $extra_keys[$idx]->value = $v; |
107 | 107 | } |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | $evars = new ExtraVar($module_srl); |
112 | 112 | $evars->setExtraVarKeys($extra_keys); |
113 | 113 | // Title Processing |
114 | - if($vars[-1][$user_lang_code]) $_document_list[$document_srl]->add('title',$vars[-1][$user_lang_code]); |
|
114 | + if ($vars[-1][$user_lang_code]) $_document_list[$document_srl]->add('title', $vars[-1][$user_lang_code]); |
|
115 | 115 | // Information processing |
116 | - if($vars[-2][$user_lang_code]) $_document_list[$document_srl]->add('content',$vars[-2][$user_lang_code]); |
|
116 | + if ($vars[-2][$user_lang_code]) $_document_list[$document_srl]->add('content', $vars[-2][$user_lang_code]); |
|
117 | 117 | |
118 | - if($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code]) |
|
118 | + if ($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code]) |
|
119 | 119 | { |
120 | 120 | unset($checked_documents[$document_srl]); |
121 | 121 | } |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | * @param array $columnList |
133 | 133 | * @return documentItem |
134 | 134 | */ |
135 | - function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true, $columnList = array()) |
|
135 | + function getDocument($document_srl = 0, $is_admin = false, $load_extra_vars = true, $columnList = array()) |
|
136 | 136 | { |
137 | - if(!$document_srl) return new documentItem(); |
|
137 | + if (!$document_srl) return new documentItem(); |
|
138 | 138 | |
139 | - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
139 | + if (!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
140 | 140 | { |
141 | 141 | $oDocument = new documentItem($document_srl, $load_extra_vars, $columnList); |
142 | 142 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
143 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
143 | + if ($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
144 | 144 | } |
145 | - if($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); |
|
145 | + if ($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); |
|
146 | 146 | |
147 | 147 | return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
148 | 148 | } |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | * @param array $columnList |
156 | 156 | * @return array value type is documentItem |
157 | 157 | */ |
158 | - function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true, $columnList = array()) |
|
158 | + function getDocuments($document_srls, $is_admin = false, $load_extra_vars = true, $columnList = array()) |
|
159 | 159 | { |
160 | - if(is_array($document_srls)) |
|
160 | + if (is_array($document_srls)) |
|
161 | 161 | { |
162 | 162 | $list_count = count($document_srls); |
163 | - $document_srls = implode(',',$document_srls); |
|
163 | + $document_srls = implode(',', $document_srls); |
|
164 | 164 | } |
165 | 165 | else |
166 | 166 | { |
@@ -173,33 +173,33 @@ discard block |
||
173 | 173 | |
174 | 174 | $output = executeQuery('document.getDocuments', $args, $columnList); |
175 | 175 | $document_list = $output->data; |
176 | - if(!$document_list) return; |
|
177 | - if(!is_array($document_list)) $document_list = array($document_list); |
|
176 | + if (!$document_list) return; |
|
177 | + if (!is_array($document_list)) $document_list = array($document_list); |
|
178 | 178 | |
179 | 179 | $document_count = count($document_list); |
180 | - foreach($document_list as $key => $attribute) |
|
180 | + foreach ($document_list as $key => $attribute) |
|
181 | 181 | { |
182 | 182 | $document_srl = $attribute->document_srl; |
183 | - if(!$document_srl) continue; |
|
183 | + if (!$document_srl) continue; |
|
184 | 184 | |
185 | - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
185 | + if (!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
186 | 186 | { |
187 | 187 | $oDocument = null; |
188 | 188 | $oDocument = new documentItem(); |
189 | 189 | $oDocument->setAttribute($attribute, false); |
190 | - if($is_admin) $oDocument->setGrant(); |
|
190 | + if ($is_admin) $oDocument->setGrant(); |
|
191 | 191 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
192 | 192 | } |
193 | 193 | |
194 | 194 | $result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
195 | 195 | } |
196 | 196 | |
197 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
197 | + if ($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
198 | 198 | |
199 | 199 | $output = null; |
200 | - if(count($result)) |
|
200 | + if (count($result)) |
|
201 | 201 | { |
202 | - foreach($result as $document_srl => $val) |
|
202 | + foreach ($result as $document_srl => $val) |
|
203 | 203 | { |
204 | 204 | $output[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
205 | 205 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @param array $columnList |
217 | 217 | * @return Object |
218 | 218 | */ |
219 | - function getDocumentList($obj, $except_notice = false, $load_extra_vars=true, $columnList = array()) |
|
219 | + function getDocumentList($obj, $except_notice = false, $load_extra_vars = true, $columnList = array()) |
|
220 | 220 | { |
221 | 221 | $sort_check = $this->_setSortIndex($obj, $load_extra_vars); |
222 | 222 | $obj->sort_index = $sort_check->sort_index; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // Call trigger (before) |
227 | 227 | // This trigger can be used to set an alternative output using a different search method |
228 | 228 | $output = ModuleHandler::triggerCall('document.getDocumentList', 'before', $obj); |
229 | - if($output instanceof Object && !$output->toBool()) |
|
229 | + if ($output instanceof Object && !$output->toBool()) |
|
230 | 230 | { |
231 | 231 | return $output; |
232 | 232 | } |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | $output = $obj->use_alternate_output; |
244 | 244 | unset($obj->use_alternate_output); |
245 | 245 | } |
246 | - elseif ($sort_check->isExtraVars && substr_count($obj->search_target,'extra_vars')) |
|
246 | + elseif ($sort_check->isExtraVars && substr_count($obj->search_target, 'extra_vars')) |
|
247 | 247 | { |
248 | 248 | $query_id = 'document.getDocumentListWithinExtraVarsExtraSort'; |
249 | - $args->sort_index = str_replace('documents.','',$args->sort_index); |
|
249 | + $args->sort_index = str_replace('documents.', '', $args->sort_index); |
|
250 | 250 | $output = executeQueryArray($query_id, $args); |
251 | 251 | } |
252 | 252 | elseif ($sort_check->isExtraVars) |
@@ -258,16 +258,16 @@ discard block |
||
258 | 258 | // document.getDocumentList query execution |
259 | 259 | // Query_id if you have a group by clause getDocumentListWithinTag getDocumentListWithinComment or used again to perform the query because |
260 | 260 | $groupByQuery = array('document.getDocumentListWithinComment' => 1, 'document.getDocumentListWithinTag' => 1, 'document.getDocumentListWithinExtraVars' => 1); |
261 | - if(isset($groupByQuery[$query_id])) |
|
261 | + if (isset($groupByQuery[$query_id])) |
|
262 | 262 | { |
263 | 263 | $group_args = clone($args); |
264 | 264 | $group_args->sort_index = 'documents.'.$args->sort_index; |
265 | 265 | $output = executeQueryArray($query_id, $group_args); |
266 | - if(!$output->toBool()||!count($output->data)) return $output; |
|
266 | + if (!$output->toBool() || !count($output->data)) return $output; |
|
267 | 267 | |
268 | - foreach($output->data as $key => $val) |
|
268 | + foreach ($output->data as $key => $val) |
|
269 | 269 | { |
270 | - if($val->document_srl) $target_srls[] = $val->document_srl; |
|
270 | + if ($val->document_srl) $target_srls[] = $val->document_srl; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | $page_navigation = $output->page_navigation; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $virtual_number = $keys[0]; |
276 | 276 | |
277 | 277 | $target_args = new stdClass(); |
278 | - $target_args->document_srls = implode(',',$target_srls); |
|
278 | + $target_args->document_srls = implode(',', $target_srls); |
|
279 | 279 | $target_args->list_order = $args->sort_index; |
280 | 280 | $target_args->order_type = $args->order_type; |
281 | 281 | $target_args->list_count = $args->list_count; |
@@ -292,35 +292,35 @@ discard block |
||
292 | 292 | } |
293 | 293 | } |
294 | 294 | // Return if no result or an error occurs |
295 | - if(!$output->toBool()||!count($output->data)) return $output; |
|
295 | + if (!$output->toBool() || !count($output->data)) return $output; |
|
296 | 296 | $idx = 0; |
297 | 297 | $data = $output->data; |
298 | 298 | unset($output->data); |
299 | 299 | |
300 | - if(!isset($virtual_number)) |
|
300 | + if (!isset($virtual_number)) |
|
301 | 301 | { |
302 | 302 | $keys = array_keys($data); |
303 | 303 | $virtual_number = $keys[0]; |
304 | 304 | } |
305 | 305 | |
306 | - if($except_notice) |
|
306 | + if ($except_notice) |
|
307 | 307 | { |
308 | - foreach($data as $key => $attribute) |
|
308 | + foreach ($data as $key => $attribute) |
|
309 | 309 | { |
310 | - if($attribute->is_notice == 'Y') $virtual_number --; |
|
310 | + if ($attribute->is_notice == 'Y') $virtual_number--; |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | |
314 | - foreach($data as $key => $attribute) |
|
314 | + foreach ($data as $key => $attribute) |
|
315 | 315 | { |
316 | - if($except_notice && $attribute->is_notice == 'Y') continue; |
|
316 | + if ($except_notice && $attribute->is_notice == 'Y') continue; |
|
317 | 317 | $document_srl = $attribute->document_srl; |
318 | - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
318 | + if (!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
319 | 319 | { |
320 | 320 | $oDocument = null; |
321 | 321 | $oDocument = new documentItem(); |
322 | 322 | $oDocument->setAttribute($attribute, false); |
323 | - if($is_admin) $oDocument->setGrant(); |
|
323 | + if ($is_admin) $oDocument->setGrant(); |
|
324 | 324 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
325 | 325 | } |
326 | 326 | |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | $virtual_number--; |
329 | 329 | } |
330 | 330 | |
331 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
331 | + if ($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
332 | 332 | |
333 | - if(count($output->data)) |
|
333 | + if (count($output->data)) |
|
334 | 334 | { |
335 | - foreach($output->data as $number => $document) |
|
335 | + foreach ($output->data as $number => $document) |
|
336 | 336 | { |
337 | 337 | $output->data[$number] = $GLOBALS['XE_DOCUMENT_LIST'][$document->document_srl]; |
338 | 338 | } |
@@ -354,16 +354,16 @@ discard block |
||
354 | 354 | { |
355 | 355 | $args = new stdClass(); |
356 | 356 | $args->module_srl = $obj->module_srl; |
357 | - $args->category_srl= $obj->category_srl; |
|
357 | + $args->category_srl = $obj->category_srl; |
|
358 | 358 | $output = executeQueryArray('document.getNoticeList', $args, $columnList); |
359 | - if(!$output->toBool()||!$output->data) return; |
|
359 | + if (!$output->toBool() || !$output->data) return; |
|
360 | 360 | |
361 | - foreach($output->data as $key => $val) |
|
361 | + foreach ($output->data as $key => $val) |
|
362 | 362 | { |
363 | 363 | $document_srl = $val->document_srl; |
364 | - if(!$document_srl) continue; |
|
364 | + if (!$document_srl) continue; |
|
365 | 365 | |
366 | - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
366 | + if (!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
|
367 | 367 | { |
368 | 368 | $oDocument = null; |
369 | 369 | $oDocument = new documentItem(); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | $this->setToAllDocumentExtraVars(); |
376 | 376 | |
377 | - foreach($result->data as $document_srl => $val) |
|
377 | + foreach ($result->data as $document_srl => $val) |
|
378 | 378 | { |
379 | 379 | $result->data[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
380 | 380 | } |
@@ -390,20 +390,20 @@ discard block |
||
390 | 390 | */ |
391 | 391 | function getExtraKeys($module_srl) |
392 | 392 | { |
393 | - if(!isset($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) |
|
393 | + if (!isset($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) |
|
394 | 394 | { |
395 | 395 | $keys = false; |
396 | 396 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
397 | - if($oCacheHandler->isSupport()) |
|
397 | + if ($oCacheHandler->isSupport()) |
|
398 | 398 | { |
399 | - $object_key = 'module_document_extra_keys:' . $module_srl; |
|
399 | + $object_key = 'module_document_extra_keys:'.$module_srl; |
|
400 | 400 | $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); |
401 | 401 | $keys = $oCacheHandler->get($cache_key); |
402 | 402 | } |
403 | 403 | |
404 | 404 | $oExtraVar = ExtraVar::getInstance($module_srl); |
405 | 405 | |
406 | - if($keys === false) |
|
406 | + if ($keys === false) |
|
407 | 407 | { |
408 | 408 | $obj = new stdClass(); |
409 | 409 | $obj->module_srl = $module_srl; |
@@ -413,13 +413,13 @@ discard block |
||
413 | 413 | |
414 | 414 | // correcting index order |
415 | 415 | $isFixed = FALSE; |
416 | - if(is_array($output->data)) |
|
416 | + if (is_array($output->data)) |
|
417 | 417 | { |
418 | 418 | $prevIdx = 0; |
419 | - foreach($output->data as $no => $value) |
|
419 | + foreach ($output->data as $no => $value) |
|
420 | 420 | { |
421 | 421 | // case first |
422 | - if($prevIdx == 0 && $value->idx != 1) |
|
422 | + if ($prevIdx == 0 && $value->idx != 1) |
|
423 | 423 | { |
424 | 424 | $args = new stdClass(); |
425 | 425 | $args->module_srl = $module_srl; |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | } |
434 | 434 | |
435 | 435 | // case others |
436 | - if($prevIdx > 0 && $prevIdx + 1 != $value->idx) |
|
436 | + if ($prevIdx > 0 && $prevIdx + 1 != $value->idx) |
|
437 | 437 | { |
438 | 438 | $args = new stdClass(); |
439 | 439 | $args->module_srl = $module_srl; |
@@ -450,16 +450,16 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | |
453 | - if($isFixed) |
|
453 | + if ($isFixed) |
|
454 | 454 | { |
455 | 455 | $output = executeQueryArray('document.getDocumentExtraKeys', $obj); |
456 | 456 | } |
457 | 457 | |
458 | 458 | $oExtraVar->setExtraVarKeys($output->data); |
459 | 459 | $keys = $oExtraVar->getExtraVars(); |
460 | - if(!$keys) $keys = array(); |
|
460 | + if (!$keys) $keys = array(); |
|
461 | 461 | |
462 | - if($oCacheHandler->isSupport()) |
|
462 | + if ($oCacheHandler->isSupport()) |
|
463 | 463 | { |
464 | 464 | $oCacheHandler->put($cache_key, $keys); |
465 | 465 | } |
@@ -480,14 +480,14 @@ discard block |
||
480 | 480 | */ |
481 | 481 | function getExtraVars($module_srl, $document_srl) |
482 | 482 | { |
483 | - if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) |
|
483 | + if (!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) |
|
484 | 484 | { |
485 | 485 | // Extended to extract the values of variables set |
486 | 486 | $oDocument = $this->getDocument($document_srl, false); |
487 | 487 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
488 | 488 | $this->setToAllDocumentExtraVars(); |
489 | 489 | } |
490 | - if(is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); |
|
490 | + if (is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); |
|
491 | 491 | return $GLOBALS['XE_EXTRA_VARS'][$document_srl]; |
492 | 492 | } |
493 | 493 | |
@@ -510,71 +510,71 @@ discard block |
||
510 | 510 | |
511 | 511 | $oDocumentController = getController('document'); |
512 | 512 | // Members must be a possible feature |
513 | - if($logged_info->member_srl) |
|
513 | + if ($logged_info->member_srl) |
|
514 | 514 | { |
515 | 515 | $oDocumentModel = getModel('document'); |
516 | 516 | $columnList = array('document_srl', 'module_srl', 'member_srl', 'ipaddress'); |
517 | 517 | $oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList); |
518 | 518 | $module_srl = $oDocument->get('module_srl'); |
519 | 519 | $member_srl = $oDocument->get('member_srl'); |
520 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
520 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
521 | 521 | |
522 | 522 | $oModuleModel = getModel('module'); |
523 | - $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); |
|
524 | - if($document_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl) |
|
523 | + $document_config = $oModuleModel->getModulePartConfig('document', $module_srl); |
|
524 | + if ($document_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) |
|
525 | 525 | { |
526 | 526 | // Add a Referral Button |
527 | 527 | $url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl); |
528 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_vote','','javascript'); |
|
528 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_vote', '', 'javascript'); |
|
529 | 529 | } |
530 | 530 | |
531 | - if($document_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl) |
|
531 | + if ($document_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) |
|
532 | 532 | { |
533 | 533 | // Add button to negative |
534 | - $url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl); |
|
535 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','','javascript'); |
|
534 | + $url = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl); |
|
535 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_vote_down', '', 'javascript'); |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | // Adding Report |
539 | 539 | $url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl); |
540 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_declare','','javascript'); |
|
540 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_declare', '', 'javascript'); |
|
541 | 541 | |
542 | 542 | // Add Bookmark button |
543 | 543 | $url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl); |
544 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','','javascript'); |
|
544 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_scrap', '', 'javascript'); |
|
545 | 545 | } |
546 | 546 | // Add print button |
547 | - $url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl); |
|
548 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_print','','printDocument'); |
|
547 | + $url = getUrl('', 'module', 'document', 'act', 'dispDocumentPrint', 'document_srl', $document_srl); |
|
548 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_print', '', 'printDocument'); |
|
549 | 549 | // Call a trigger (after) |
550 | 550 | ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list); |
551 | - if($this->grant->manager) |
|
551 | + if ($this->grant->manager) |
|
552 | 552 | { |
553 | 553 | $str_confirm = Context::getLang('confirm_move'); |
554 | 554 | $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['document_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('document', 'procDocumentAdminMoveToTrash', params)", $str_confirm, $document_srl); |
555 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_trash','','javascript'); |
|
555 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_trash', '', 'javascript'); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | // If you are managing to find posts by ip |
559 | - if($logged_info->is_admin == 'Y') |
|
559 | + if ($logged_info->is_admin == 'Y') |
|
560 | 560 | { |
561 | 561 | $oDocumentModel = getModel('document'); |
562 | - $oDocument = $oDocumentModel->getDocument($document_srl); //before setting document recycle |
|
562 | + $oDocument = $oDocumentModel->getDocument($document_srl); //before setting document recycle |
|
563 | 563 | |
564 | - if($oDocument->isExists()) |
|
564 | + if ($oDocument->isExists()) |
|
565 | 565 | { |
566 | 566 | // Find a post equivalent to ip address |
567 | - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress()); |
|
568 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); |
|
567 | + $url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oDocument->getIpAddress()); |
|
568 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_search_by_ipaddress', $icon_path, 'TraceByIpaddress'); |
|
569 | 569 | |
570 | 570 | $url = sprintf("var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument->getIpAddress()); |
571 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript'); |
|
571 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_add_ip_to_spamfilter', '', 'javascript'); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | // Changing the language of pop-up menu |
575 | 575 | $menus = Context::get('document_popup_menu_list'); |
576 | 576 | $menus_count = count($menus); |
577 | - for($i=0;$i<$menus_count;$i++) |
|
577 | + for ($i = 0; $i < $menus_count; $i++) |
|
578 | 578 | { |
579 | 579 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
580 | 580 | } |
@@ -590,13 +590,13 @@ discard block |
||
590 | 590 | */ |
591 | 591 | function getDocumentCount($module_srl, $search_obj = NULL) |
592 | 592 | { |
593 | - if(is_null($search_obj)) $search_obj = new stdClass(); |
|
593 | + if (is_null($search_obj)) $search_obj = new stdClass(); |
|
594 | 594 | $search_obj->module_srl = $module_srl; |
595 | 595 | |
596 | 596 | $output = executeQuery('document.getDocumentCount', $search_obj); |
597 | 597 | // Return total number of |
598 | 598 | $total_count = $output->data->count; |
599 | - return (int)$total_count; |
|
599 | + return (int) $total_count; |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | function getDocumentCountByGroupStatus($search_obj = NULL) |
608 | 608 | { |
609 | 609 | $output = executeQuery('document.getDocumentCountByGroupStatus', $search_obj); |
610 | - if(!$output->toBool()) return array(); |
|
610 | + if (!$output->toBool()) return array(); |
|
611 | 611 | |
612 | 612 | return $output->data; |
613 | 613 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | $output = executeQuery('document.getDocumentExtraVarsCount', $args); |
627 | 627 | // Return total number of |
628 | 628 | $total_count = $output->data->count; |
629 | - return (int)$total_count; |
|
629 | + return (int) $total_count; |
|
630 | 630 | } |
631 | 631 | |
632 | 632 | /** |
@@ -643,29 +643,29 @@ discard block |
||
643 | 643 | |
644 | 644 | $this->_setSearchOption($opt, $args, $query_id, $use_division); |
645 | 645 | |
646 | - if($sort_check->isExtraVars) |
|
646 | + if ($sort_check->isExtraVars) |
|
647 | 647 | { |
648 | 648 | return 1; |
649 | 649 | } |
650 | 650 | else |
651 | 651 | { |
652 | - if($sort_check->sort_index === 'list_order' || $sort_check->sort_index === 'update_order') |
|
652 | + if ($sort_check->sort_index === 'list_order' || $sort_check->sort_index === 'update_order') |
|
653 | 653 | { |
654 | - if($args->order_type === 'desc') |
|
654 | + if ($args->order_type === 'desc') |
|
655 | 655 | { |
656 | - $args->{'rev_' . $sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
|
656 | + $args->{'rev_'.$sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
|
657 | 657 | } |
658 | 658 | else |
659 | 659 | { |
660 | 660 | $args->{$sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
661 | 661 | } |
662 | 662 | } |
663 | - elseif($sort_check->sort_index === 'regdate') |
|
663 | + elseif ($sort_check->sort_index === 'regdate') |
|
664 | 664 | { |
665 | 665 | |
666 | - if($args->order_type === 'asc') |
|
666 | + if ($args->order_type === 'asc') |
|
667 | 667 | { |
668 | - $args->{'rev_' . $sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
|
668 | + $args->{'rev_'.$sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
|
669 | 669 | } |
670 | 670 | else |
671 | 671 | { |
@@ -680,9 +680,9 @@ discard block |
||
680 | 680 | } |
681 | 681 | |
682 | 682 | // Guhanhu total number of the article search page |
683 | - $output = executeQuery($query_id . 'Page', $args); |
|
683 | + $output = executeQuery($query_id.'Page', $args); |
|
684 | 684 | $count = $output->data->count; |
685 | - $page = (int)(($count-1)/$opt->list_count)+1; |
|
685 | + $page = (int) (($count - 1) / $opt->list_count) + 1; |
|
686 | 686 | return $page; |
687 | 687 | } |
688 | 688 | |
@@ -694,16 +694,16 @@ discard block |
||
694 | 694 | */ |
695 | 695 | function getCategory($category_srl, $columnList = array()) |
696 | 696 | { |
697 | - $args =new stdClass(); |
|
697 | + $args = new stdClass(); |
|
698 | 698 | $args->category_srl = $category_srl; |
699 | 699 | $output = executeQuery('document.getCategory', $args, $columnList); |
700 | 700 | |
701 | 701 | $node = $output->data; |
702 | - if(!$node) return; |
|
702 | + if (!$node) return; |
|
703 | 703 | |
704 | - if($node->group_srls) |
|
704 | + if ($node->group_srls) |
|
705 | 705 | { |
706 | - $group_srls = explode(',',$node->group_srls); |
|
706 | + $group_srls = explode(',', $node->group_srls); |
|
707 | 707 | unset($node->group_srls); |
708 | 708 | $node->group_srls = $group_srls; |
709 | 709 | } |
@@ -724,8 +724,8 @@ discard block |
||
724 | 724 | { |
725 | 725 | $args = new stdClass(); |
726 | 726 | $args->category_srl = $category_srl; |
727 | - $output = executeQuery('document.getChildCategoryCount',$args); |
|
728 | - if($output->data->count > 0) return true; |
|
727 | + $output = executeQuery('document.getChildCategoryCount', $args); |
|
728 | + if ($output->data->count > 0) return true; |
|
729 | 729 | return false; |
730 | 730 | } |
731 | 731 | |
@@ -741,10 +741,10 @@ discard block |
||
741 | 741 | // Category of the target module file swollen |
742 | 742 | $filename = sprintf("%sfiles/cache/document_category/%s.php", _XE_PATH_, $module_srl); |
743 | 743 | // If the target file to the cache file regeneration category |
744 | - if(!file_exists($filename)) |
|
744 | + if (!file_exists($filename)) |
|
745 | 745 | { |
746 | 746 | $oDocumentController = getController('document'); |
747 | - if(!$oDocumentController->makeCategoryFile($module_srl)) return array(); |
|
747 | + if (!$oDocumentController->makeCategoryFile($module_srl)) return array(); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | include($filename); |
@@ -764,10 +764,10 @@ discard block |
||
764 | 764 | */ |
765 | 765 | function _arrangeCategory(&$document_category, $list, $depth) |
766 | 766 | { |
767 | - if(!count($list)) return; |
|
767 | + if (!count($list)) return; |
|
768 | 768 | $idx = 0; |
769 | 769 | $list_order = array(); |
770 | - foreach($list as $key => $val) |
|
770 | + foreach ($list as $key => $val) |
|
771 | 771 | { |
772 | 772 | $obj = new stdClass; |
773 | 773 | $obj->mid = $val['mid']; |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | $obj->parent_srl = $val['parent_srl']; |
777 | 777 | $obj->title = $obj->text = $val['text']; |
778 | 778 | $obj->description = $val['description']; |
779 | - $obj->expand = $val['expand']=='Y'?true:false; |
|
779 | + $obj->expand = $val['expand'] == 'Y' ? true : false; |
|
780 | 780 | $obj->color = $val['color']; |
781 | 781 | $obj->document_count = $val['document_count']; |
782 | 782 | $obj->depth = $depth; |
@@ -784,26 +784,26 @@ discard block |
||
784 | 784 | $obj->childs = array(); |
785 | 785 | $obj->grant = $val['grant']; |
786 | 786 | |
787 | - if(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true; |
|
787 | + if (Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true; |
|
788 | 788 | else $selected = false; |
789 | 789 | |
790 | 790 | $obj->selected = $selected; |
791 | 791 | |
792 | 792 | $list_order[$idx++] = $obj->category_srl; |
793 | 793 | // If you have a parent category of child nodes apply data |
794 | - if($obj->parent_srl) |
|
794 | + if ($obj->parent_srl) |
|
795 | 795 | { |
796 | 796 | $parent_srl = $obj->parent_srl; |
797 | 797 | $document_count = $obj->document_count; |
798 | 798 | $expand = $obj->expand; |
799 | - if($selected) $expand = true; |
|
799 | + if ($selected) $expand = true; |
|
800 | 800 | |
801 | - while($parent_srl) |
|
801 | + while ($parent_srl) |
|
802 | 802 | { |
803 | 803 | $document_category[$parent_srl]->document_count += $document_count; |
804 | 804 | $document_category[$parent_srl]->childs[] = $obj->category_srl; |
805 | 805 | $document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs); |
806 | - if($expand) $document_category[$parent_srl]->expand = $expand; |
|
806 | + if ($expand) $document_category[$parent_srl]->expand = $expand; |
|
807 | 807 | |
808 | 808 | $parent_srl = $document_category[$parent_srl]->parent_srl; |
809 | 809 | } |
@@ -811,10 +811,10 @@ discard block |
||
811 | 811 | |
812 | 812 | $document_category[$key] = $obj; |
813 | 813 | |
814 | - if(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1); |
|
814 | + if (count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth + 1); |
|
815 | 815 | } |
816 | 816 | $document_category[$list_order[0]]->first = true; |
817 | - $document_category[$list_order[count($list_order)-1]]->last = true; |
|
817 | + $document_category[$list_order[count($list_order) - 1]]->last = true; |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | /** |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $args->module_srl = $module_srl; |
830 | 830 | $args->category_srl = $category_srl; |
831 | 831 | $output = executeQuery('document.getCategoryDocumentCount', $args); |
832 | - return (int)$output->data->count; |
|
832 | + return (int) $output->data->count; |
|
833 | 833 | } |
834 | 834 | |
835 | 835 | /** |
@@ -839,8 +839,8 @@ discard block |
||
839 | 839 | */ |
840 | 840 | function getCategoryXmlFile($module_srl) |
841 | 841 | { |
842 | - $xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl); |
|
843 | - if(!file_exists($xml_file)) |
|
842 | + $xml_file = sprintf('files/cache/document_category/%s.xml.php', $module_srl); |
|
843 | + if (!file_exists($xml_file)) |
|
844 | 844 | { |
845 | 845 | $oDocumentController = getController('document'); |
846 | 846 | $oDocumentController->makeCategoryFile($module_srl); |
@@ -855,8 +855,8 @@ discard block |
||
855 | 855 | */ |
856 | 856 | function getCategoryPhpFile($module_srl) |
857 | 857 | { |
858 | - $php_file = sprintf('files/cache/document_category/%s.php',$module_srl); |
|
859 | - if(!file_exists($php_file)) |
|
858 | + $php_file = sprintf('files/cache/document_category/%s.php', $module_srl); |
|
859 | + if (!file_exists($php_file)) |
|
860 | 860 | { |
861 | 861 | $oDocumentController = getController('document'); |
862 | 862 | $oDocumentController->makeCategoryFile($module_srl); |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | */ |
872 | 872 | function getMonthlyArchivedList($obj) |
873 | 873 | { |
874 | - if($obj->mid) |
|
874 | + if ($obj->mid) |
|
875 | 875 | { |
876 | 876 | $oModuleModel = getModel('module'); |
877 | 877 | $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
@@ -879,13 +879,13 @@ discard block |
||
879 | 879 | } |
880 | 880 | // Module_srl passed the array may be a check whether the array |
881 | 881 | $args = new stdClass; |
882 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
882 | + if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
883 | 883 | else $args->module_srl = $obj->module_srl; |
884 | 884 | |
885 | 885 | $output = executeQuery('document.getMonthlyArchivedList', $args); |
886 | - if(!$output->toBool()||!$output->data) return $output; |
|
886 | + if (!$output->toBool() || !$output->data) return $output; |
|
887 | 887 | |
888 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
888 | + if (!is_array($output->data)) $output->data = array($output->data); |
|
889 | 889 | |
890 | 890 | return $output; |
891 | 891 | } |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | */ |
898 | 898 | function getDailyArchivedList($obj) |
899 | 899 | { |
900 | - if($obj->mid) |
|
900 | + if ($obj->mid) |
|
901 | 901 | { |
902 | 902 | $oModuleModel = getModel('module'); |
903 | 903 | $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
@@ -905,14 +905,14 @@ discard block |
||
905 | 905 | } |
906 | 906 | // Module_srl passed the array may be a check whether the array |
907 | 907 | $args = new stdClass; |
908 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
908 | + if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
909 | 909 | else $args->module_srl = $obj->module_srl; |
910 | 910 | $args->regdate = $obj->regdate; |
911 | 911 | |
912 | 912 | $output = executeQuery('document.getDailyArchivedList', $args); |
913 | - if(!$output->toBool()) return $output; |
|
913 | + if (!$output->toBool()) return $output; |
|
914 | 914 | |
915 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
915 | + if (!is_array($output->data)) $output->data = array($output->data); |
|
916 | 916 | |
917 | 917 | return $output; |
918 | 918 | } |
@@ -923,17 +923,17 @@ discard block |
||
923 | 923 | */ |
924 | 924 | function getDocumentCategories() |
925 | 925 | { |
926 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
926 | + if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); |
|
927 | 927 | $module_srl = Context::get('module_srl'); |
928 | - $categories= $this->getCategoryList($module_srl); |
|
928 | + $categories = $this->getCategoryList($module_srl); |
|
929 | 929 | $lang = Context::get('lang'); |
930 | 930 | // No additional category |
931 | 931 | $output = "0,0,{$lang->none_category}\n"; |
932 | - if($categories) |
|
932 | + if ($categories) |
|
933 | 933 | { |
934 | - foreach($categories as $category_srl => $category) |
|
934 | + foreach ($categories as $category_srl => $category) |
|
935 | 935 | { |
936 | - $output .= sprintf("%d,%d,%s\n",$category_srl, $category->depth,$category->title); |
|
936 | + $output .= sprintf("%d,%d,%s\n", $category_srl, $category->depth, $category->title); |
|
937 | 937 | } |
938 | 938 | } |
939 | 939 | $this->add('categories', $output); |
@@ -945,13 +945,13 @@ discard block |
||
945 | 945 | */ |
946 | 946 | function getDocumentConfig() |
947 | 947 | { |
948 | - if(!$GLOBALS['__document_config__']) |
|
948 | + if (!$GLOBALS['__document_config__']) |
|
949 | 949 | { |
950 | 950 | $oModuleModel = getModel('module'); |
951 | 951 | $config = $oModuleModel->getModuleConfig('document'); |
952 | 952 | |
953 | - if(!$config) $config = new stdClass(); |
|
954 | - if(!$config->thumbnail_type) $config->thumbnail_type = 'crop'; |
|
953 | + if (!$config) $config = new stdClass(); |
|
954 | + if (!$config->thumbnail_type) $config->thumbnail_type = 'crop'; |
|
955 | 955 | $GLOBALS['__document_config__'] = $config; |
956 | 956 | } |
957 | 957 | return $GLOBALS['__document_config__']; |
@@ -1016,11 +1016,11 @@ discard block |
||
1016 | 1016 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
1017 | 1017 | // Check permissions |
1018 | 1018 | $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info')); |
1019 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
1019 | + if (!$grant->manager) return new Object(-1, 'msg_not_permitted'); |
|
1020 | 1020 | |
1021 | 1021 | $category_srl = Context::get('category_srl'); |
1022 | 1022 | $category_info = $this->getCategory($category_srl); |
1023 | - if(!$category_info) |
|
1023 | + if (!$category_info) |
|
1024 | 1024 | { |
1025 | 1025 | return new Object(-1, 'msg_invalid_request'); |
1026 | 1026 | } |
@@ -1036,14 +1036,14 @@ discard block |
||
1036 | 1036 | */ |
1037 | 1037 | function getDocumentSrlByAlias($mid, $alias) |
1038 | 1038 | { |
1039 | - if(!$mid || !$alias) return null; |
|
1039 | + if (!$mid || !$alias) return null; |
|
1040 | 1040 | $site_module_info = Context::get('site_module_info'); |
1041 | 1041 | $args = new stdClass; |
1042 | 1042 | $args->mid = $mid; |
1043 | 1043 | $args->alias_title = $alias; |
1044 | 1044 | $args->site_srl = $site_module_info->site_srl; |
1045 | 1045 | $output = executeQuery('document.getDocumentSrlByAlias', $args); |
1046 | - if(!$output->data) return null; |
|
1046 | + if (!$output->data) return null; |
|
1047 | 1047 | else return $output->data->document_srl; |
1048 | 1048 | } |
1049 | 1049 | |
@@ -1055,15 +1055,15 @@ discard block |
||
1055 | 1055 | */ |
1056 | 1056 | function getDocumentSrlByTitle($module_srl, $title) |
1057 | 1057 | { |
1058 | - if(!$module_srl || !$title) return null; |
|
1058 | + if (!$module_srl || !$title) return null; |
|
1059 | 1059 | $args = new stdClass; |
1060 | 1060 | $args->module_srl = $module_srl; |
1061 | 1061 | $args->title = $title; |
1062 | 1062 | $output = executeQuery('document.getDocumentSrlByTitle', $args); |
1063 | - if(!$output->data) return null; |
|
1063 | + if (!$output->data) return null; |
|
1064 | 1064 | else |
1065 | 1065 | { |
1066 | - if(is_array($output->data)) return $output->data[0]->document_srl; |
|
1066 | + if (is_array($output->data)) return $output->data[0]->document_srl; |
|
1067 | 1067 | return $output->data->document_srl; |
1068 | 1068 | } |
1069 | 1069 | } |
@@ -1075,12 +1075,12 @@ discard block |
||
1075 | 1075 | */ |
1076 | 1076 | function getAlias($document_srl) |
1077 | 1077 | { |
1078 | - if(!$document_srl) return null; |
|
1078 | + if (!$document_srl) return null; |
|
1079 | 1079 | $args = new stdClass; |
1080 | 1080 | $args->document_srl = $document_srl; |
1081 | 1081 | $output = executeQueryArray('document.getAliases', $args); |
1082 | 1082 | |
1083 | - if(!$output->data) return null; |
|
1083 | + if (!$output->data) return null; |
|
1084 | 1084 | else return $output->data[0]->alias_title; |
1085 | 1085 | } |
1086 | 1086 | |
@@ -1123,32 +1123,32 @@ discard block |
||
1123 | 1123 | { |
1124 | 1124 | // Variable check |
1125 | 1125 | $args = new stdClass; |
1126 | - $args->category_srl = $obj->category_srl?$obj->category_srl:null; |
|
1126 | + $args->category_srl = $obj->category_srl ? $obj->category_srl : null; |
|
1127 | 1127 | $args->sort_index = $obj->sort_index; |
1128 | - $args->order_type = $obj->order_type?$obj->order_type:'desc'; |
|
1129 | - $args->page = $obj->page?$obj->page:1; |
|
1130 | - $args->list_count = $obj->list_count?$obj->list_count:20; |
|
1131 | - $args->page_count = $obj->page_count?$obj->page_count:10; |
|
1128 | + $args->order_type = $obj->order_type ? $obj->order_type : 'desc'; |
|
1129 | + $args->page = $obj->page ? $obj->page : 1; |
|
1130 | + $args->list_count = $obj->list_count ? $obj->list_count : 20; |
|
1131 | + $args->page_count = $obj->page_count ? $obj->page_count : 10; |
|
1132 | 1132 | // Search options |
1133 | 1133 | $search_target = $obj->search_target; |
1134 | 1134 | $search_keyword = $obj->search_keyword; |
1135 | - if($search_target && $search_keyword) |
|
1135 | + if ($search_target && $search_keyword) |
|
1136 | 1136 | { |
1137 | - switch($search_target) |
|
1137 | + switch ($search_target) |
|
1138 | 1138 | { |
1139 | 1139 | case 'title' : |
1140 | 1140 | case 'content' : |
1141 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1141 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1142 | 1142 | $args->{"s_".$search_target} = $search_keyword; |
1143 | 1143 | $use_division = true; |
1144 | 1144 | break; |
1145 | 1145 | case 'title_content' : |
1146 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1146 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1147 | 1147 | $args->s_title = $search_keyword; |
1148 | 1148 | $args->s_content = $search_keyword; |
1149 | 1149 | break; |
1150 | 1150 | case 'user_id' : |
1151 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1151 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1152 | 1152 | $args->s_user_id = $search_keyword; |
1153 | 1153 | $args->sort_index = 'documents.'.$args->sort_index; |
1154 | 1154 | break; |
@@ -1156,13 +1156,13 @@ discard block |
||
1156 | 1156 | case 'nick_name' : |
1157 | 1157 | case 'email_address' : |
1158 | 1158 | case 'homepage' : |
1159 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1159 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1160 | 1160 | $args->{"s_".$search_target} = $search_keyword; |
1161 | 1161 | break; |
1162 | 1162 | case 'is_notice' : |
1163 | 1163 | case 'is_secret' : |
1164 | - if($search_keyword=='N') $args->statusList = array($this->getConfigStatus('public')); |
|
1165 | - elseif($search_keyword=='Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1164 | + if ($search_keyword == 'N') $args->statusList = array($this->getConfigStatus('public')); |
|
1165 | + elseif ($search_keyword == 'Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1166 | 1166 | break; |
1167 | 1167 | case 'member_srl' : |
1168 | 1168 | case 'readed_count' : |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | case 'comment_count' : |
1172 | 1172 | case 'trackback_count' : |
1173 | 1173 | case 'uploaded_count' : |
1174 | - $args->{"s_".$search_target} = (int)$search_keyword; |
|
1174 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
1175 | 1175 | break; |
1176 | 1176 | case 'regdate' : |
1177 | 1177 | case 'last_update' : |
@@ -1183,9 +1183,9 @@ discard block |
||
1183 | 1183 | } |
1184 | 1184 | |
1185 | 1185 | $output = executeQueryArray('document.getTrashList', $args); |
1186 | - if($output->data) |
|
1186 | + if ($output->data) |
|
1187 | 1187 | { |
1188 | - foreach($output->data as $key => $attribute) |
|
1188 | + foreach ($output->data as $key => $attribute) |
|
1189 | 1189 | { |
1190 | 1190 | $oDocument = null; |
1191 | 1191 | $oDocument = new documentItem(); |
@@ -1204,46 +1204,46 @@ discard block |
||
1204 | 1204 | { |
1205 | 1205 | $args = new stdClass; |
1206 | 1206 | $document_srl = Context::get('document_srl'); |
1207 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
1207 | + if (!$document_srl) return new Object(-1, 'msg_invalid_request'); |
|
1208 | 1208 | |
1209 | 1209 | $point = Context::get('point'); |
1210 | - if($point != -1) $point = 1; |
|
1210 | + if ($point != -1) $point = 1; |
|
1211 | 1211 | |
1212 | 1212 | $oDocumentModel = getModel('document'); |
1213 | 1213 | $columnList = array('document_srl', 'module_srl'); |
1214 | 1214 | $oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList); |
1215 | 1215 | $module_srl = $oDocument->get('module_srl'); |
1216 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
1216 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
1217 | 1217 | |
1218 | 1218 | $oModuleModel = getModel('module'); |
1219 | - $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); |
|
1220 | - if($point == -1) |
|
1219 | + $document_config = $oModuleModel->getModulePartConfig('document', $module_srl); |
|
1220 | + if ($point == -1) |
|
1221 | 1221 | { |
1222 | - if($document_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); |
|
1222 | + if ($document_config->use_vote_down != 'S') return new Object(-1, 'msg_invalid_request'); |
|
1223 | 1223 | $args->below_point = 0; |
1224 | 1224 | } |
1225 | 1225 | else |
1226 | 1226 | { |
1227 | - if($document_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); |
|
1227 | + if ($document_config->use_vote_up != 'S') return new Object(-1, 'msg_invalid_request'); |
|
1228 | 1228 | $args->more_point = 0; |
1229 | 1229 | } |
1230 | 1230 | |
1231 | 1231 | $args->document_srl = $document_srl; |
1232 | 1232 | |
1233 | - $output = executeQueryArray('document.getVotedMemberList',$args); |
|
1234 | - if(!$output->toBool()) return $output; |
|
1233 | + $output = executeQueryArray('document.getVotedMemberList', $args); |
|
1234 | + if (!$output->toBool()) return $output; |
|
1235 | 1235 | |
1236 | 1236 | $oMemberModel = getModel('member'); |
1237 | - if($output->data) |
|
1237 | + if ($output->data) |
|
1238 | 1238 | { |
1239 | - foreach($output->data as $k => $d) |
|
1239 | + foreach ($output->data as $k => $d) |
|
1240 | 1240 | { |
1241 | 1241 | $profile_image = $oMemberModel->getProfileImage($d->member_srl); |
1242 | 1242 | $output->data[$k]->src = $profile_image->src; |
1243 | 1243 | } |
1244 | 1244 | } |
1245 | 1245 | |
1246 | - $this->add('voted_member_list',$output->data); |
|
1246 | + $this->add('voted_member_list', $output->data); |
|
1247 | 1247 | } |
1248 | 1248 | |
1249 | 1249 | /** |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | function getStatusNameList() |
1254 | 1254 | { |
1255 | 1255 | global $lang; |
1256 | - if(!isset($lang->status_name_list)) |
|
1256 | + if (!isset($lang->status_name_list)) |
|
1257 | 1257 | return array_flip($this->getStatusList()); |
1258 | 1258 | else return $lang->status_name_list; |
1259 | 1259 | } |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | { |
1269 | 1269 | $sortIndex = $obj->sort_index; |
1270 | 1270 | $isExtraVars = false; |
1271 | - if(!in_array($sortIndex, array('list_order','regdate','last_update','update_order','readed_count','voted_count','blamed_count','comment_count','trackback_count','uploaded_count','title','category_srl'))) |
|
1271 | + if (!in_array($sortIndex, array('list_order', 'regdate', 'last_update', 'update_order', 'readed_count', 'voted_count', 'blamed_count', 'comment_count', 'trackback_count', 'uploaded_count', 'title', 'category_srl'))) |
|
1272 | 1272 | { |
1273 | 1273 | // get module_srl extra_vars list |
1274 | 1274 | if ($load_extra_vars) |
@@ -1283,11 +1283,11 @@ discard block |
||
1283 | 1283 | else |
1284 | 1284 | { |
1285 | 1285 | $check_array = array(); |
1286 | - foreach($extra_output->data as $val) |
|
1286 | + foreach ($extra_output->data as $val) |
|
1287 | 1287 | { |
1288 | 1288 | $check_array[] = $val->eid; |
1289 | 1289 | } |
1290 | - if(!in_array($sortIndex, $check_array)) $sortIndex = 'list_order'; |
|
1290 | + if (!in_array($sortIndex, $check_array)) $sortIndex = 'list_order'; |
|
1291 | 1291 | else $isExtraVars = true; |
1292 | 1292 | } |
1293 | 1293 | } |
@@ -1315,13 +1315,13 @@ discard block |
||
1315 | 1315 | { |
1316 | 1316 | // Variable check |
1317 | 1317 | $args = new stdClass(); |
1318 | - $args->category_srl = $searchOpt->category_srl?$searchOpt->category_srl:null; |
|
1318 | + $args->category_srl = $searchOpt->category_srl ? $searchOpt->category_srl : null; |
|
1319 | 1319 | $args->order_type = $searchOpt->order_type; |
1320 | - $args->page = $searchOpt->page?$searchOpt->page:1; |
|
1321 | - $args->list_count = $searchOpt->list_count?$searchOpt->list_count:20; |
|
1322 | - $args->page_count = $searchOpt->page_count?$searchOpt->page_count:10; |
|
1323 | - $args->start_date = $searchOpt->start_date?$searchOpt->start_date:null; |
|
1324 | - $args->end_date = $searchOpt->end_date?$searchOpt->end_date:null; |
|
1320 | + $args->page = $searchOpt->page ? $searchOpt->page : 1; |
|
1321 | + $args->list_count = $searchOpt->list_count ? $searchOpt->list_count : 20; |
|
1322 | + $args->page_count = $searchOpt->page_count ? $searchOpt->page_count : 10; |
|
1323 | + $args->start_date = $searchOpt->start_date ? $searchOpt->start_date : null; |
|
1324 | + $args->end_date = $searchOpt->end_date ? $searchOpt->end_date : null; |
|
1325 | 1325 | $args->member_srl = $searchOpt->member_srl; |
1326 | 1326 | |
1327 | 1327 | $logged_info = Context::get('logged_info'); |
@@ -1330,10 +1330,10 @@ discard block |
||
1330 | 1330 | |
1331 | 1331 | // Check the target and sequence alignment |
1332 | 1332 | $orderType = array('desc' => 1, 'asc' => 1); |
1333 | - if(!isset($orderType[$args->order_type])) $args->order_type = 'asc'; |
|
1333 | + if (!isset($orderType[$args->order_type])) $args->order_type = 'asc'; |
|
1334 | 1334 | |
1335 | 1335 | // If that came across mid module_srl instead of a direct module_srl guhaejum |
1336 | - if($searchOpt->mid) |
|
1336 | + if ($searchOpt->mid) |
|
1337 | 1337 | { |
1338 | 1338 | $oModuleModel = getModel('module'); |
1339 | 1339 | $args->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
@@ -1341,30 +1341,30 @@ discard block |
||
1341 | 1341 | } |
1342 | 1342 | |
1343 | 1343 | // Module_srl passed the array may be a check whether the array |
1344 | - if(is_array($searchOpt->module_srl)) $args->module_srl = implode(',', $searchOpt->module_srl); |
|
1344 | + if (is_array($searchOpt->module_srl)) $args->module_srl = implode(',', $searchOpt->module_srl); |
|
1345 | 1345 | else $args->module_srl = $searchOpt->module_srl; |
1346 | 1346 | |
1347 | 1347 | // Except for the test module_srl |
1348 | - if(is_array($searchOpt->exclude_module_srl)) $args->exclude_module_srl = implode(',', $searchOpt->exclude_module_srl); |
|
1348 | + if (is_array($searchOpt->exclude_module_srl)) $args->exclude_module_srl = implode(',', $searchOpt->exclude_module_srl); |
|
1349 | 1349 | else $args->exclude_module_srl = $searchOpt->exclude_module_srl; |
1350 | 1350 | |
1351 | 1351 | // only admin document list, temp document showing |
1352 | - if($searchOpt->statusList) $args->statusList = $searchOpt->statusList; |
|
1352 | + if ($searchOpt->statusList) $args->statusList = $searchOpt->statusList; |
|
1353 | 1353 | else |
1354 | 1354 | { |
1355 | - if($logged_info->is_admin == 'Y' && !$searchOpt->module_srl) |
|
1355 | + if ($logged_info->is_admin == 'Y' && !$searchOpt->module_srl) |
|
1356 | 1356 | $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp')); |
1357 | 1357 | else |
1358 | 1358 | $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public')); |
1359 | 1359 | } |
1360 | 1360 | |
1361 | 1361 | // Category is selected, further sub-categories until all conditions |
1362 | - if($args->category_srl) |
|
1362 | + if ($args->category_srl) |
|
1363 | 1363 | { |
1364 | 1364 | $category_list = $this->getCategoryList($args->module_srl); |
1365 | 1365 | $category_info = $category_list[$args->category_srl]; |
1366 | 1366 | $category_info->childs[] = $args->category_srl; |
1367 | - $args->category_srl = implode(',',$category_info->childs); |
|
1367 | + $args->category_srl = implode(',', $category_info->childs); |
|
1368 | 1368 | } |
1369 | 1369 | |
1370 | 1370 | // Used to specify the default query id (based on several search options to query id modified) |
@@ -1377,24 +1377,24 @@ discard block |
||
1377 | 1377 | $search_target = $searchOpt->search_target; |
1378 | 1378 | $search_keyword = $searchOpt->search_keyword; |
1379 | 1379 | |
1380 | - if($search_target && $search_keyword) |
|
1380 | + if ($search_target && $search_keyword) |
|
1381 | 1381 | { |
1382 | - switch($search_target) |
|
1382 | + switch ($search_target) |
|
1383 | 1383 | { |
1384 | 1384 | case 'title' : |
1385 | 1385 | case 'content' : |
1386 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1386 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1387 | 1387 | $args->{"s_".$search_target} = $search_keyword; |
1388 | 1388 | $use_division = true; |
1389 | 1389 | break; |
1390 | 1390 | case 'title_content' : |
1391 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1391 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1392 | 1392 | $args->s_title = $search_keyword; |
1393 | 1393 | $args->s_content = $search_keyword; |
1394 | 1394 | $use_division = true; |
1395 | 1395 | break; |
1396 | 1396 | case 'user_id' : |
1397 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1397 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1398 | 1398 | $args->s_user_id = $search_keyword; |
1399 | 1399 | $args->sort_index = 'documents.'.$args->sort_index; |
1400 | 1400 | break; |
@@ -1402,18 +1402,18 @@ discard block |
||
1402 | 1402 | case 'nick_name' : |
1403 | 1403 | case 'email_address' : |
1404 | 1404 | case 'homepage' : |
1405 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1405 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
1406 | 1406 | $args->{"s_".$search_target} = $search_keyword; |
1407 | 1407 | break; |
1408 | 1408 | case 'is_notice' : |
1409 | - if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; |
|
1410 | - elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; |
|
1409 | + if ($search_keyword == 'N') $args->{"s_".$search_target} = 'N'; |
|
1410 | + elseif ($search_keyword == 'Y') $args->{"s_".$search_target} = 'Y'; |
|
1411 | 1411 | else $args->{"s_".$search_target} = ''; |
1412 | 1412 | break; |
1413 | 1413 | case 'is_secret' : |
1414 | - if($search_keyword=='N') $args->statusList = array($this->getConfigStatus('public')); |
|
1415 | - elseif($search_keyword=='Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1416 | - elseif($search_keyword=='temp') $args->statusList = array($this->getConfigStatus('temp')); |
|
1414 | + if ($search_keyword == 'N') $args->statusList = array($this->getConfigStatus('public')); |
|
1415 | + elseif ($search_keyword == 'Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1416 | + elseif ($search_keyword == 'temp') $args->statusList = array($this->getConfigStatus('temp')); |
|
1417 | 1417 | break; |
1418 | 1418 | case 'member_srl' : |
1419 | 1419 | case 'readed_count' : |
@@ -1421,10 +1421,10 @@ discard block |
||
1421 | 1421 | case 'comment_count' : |
1422 | 1422 | case 'trackback_count' : |
1423 | 1423 | case 'uploaded_count' : |
1424 | - $args->{"s_".$search_target} = (int)$search_keyword; |
|
1424 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
1425 | 1425 | break; |
1426 | 1426 | case 'blamed_count' : |
1427 | - $args->{"s_".$search_target} = (int)$search_keyword * -1; |
|
1427 | + $args->{"s_".$search_target} = (int) $search_keyword * -1; |
|
1428 | 1428 | break; |
1429 | 1429 | case 'regdate' : |
1430 | 1430 | case 'last_update' : |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | $use_division = true; |
1438 | 1438 | break; |
1439 | 1439 | case 'tag' : |
1440 | - $args->s_tags = str_replace(' ','%',$search_keyword); |
|
1440 | + $args->s_tags = str_replace(' ', '%', $search_keyword); |
|
1441 | 1441 | $query_id = 'document.getDocumentListWithinTag'; |
1442 | 1442 | break; |
1443 | 1443 | case 'extra_vars': |
@@ -1445,9 +1445,9 @@ discard block |
||
1445 | 1445 | $query_id = 'document.getDocumentListWithinExtraVars'; |
1446 | 1446 | break; |
1447 | 1447 | default : |
1448 | - if(strpos($search_target,'extra_vars')!==false) { |
|
1448 | + if (strpos($search_target, 'extra_vars') !== false) { |
|
1449 | 1449 | $args->var_idx = substr($search_target, strlen('extra_vars')); |
1450 | - $args->var_value = str_replace(' ','%',$search_keyword); |
|
1450 | + $args->var_value = str_replace(' ', '%', $search_keyword); |
|
1451 | 1451 | $args->sort_index = 'documents.'.$args->sort_index; |
1452 | 1452 | $query_id = 'document.getDocumentListWithExtraVars'; |
1453 | 1453 | } |
@@ -1464,18 +1464,18 @@ discard block |
||
1464 | 1464 | /** |
1465 | 1465 | * list_order asc sort of division that can be used only when |
1466 | 1466 | */ |
1467 | - if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; |
|
1467 | + if ($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; |
|
1468 | 1468 | |
1469 | 1469 | /** |
1470 | 1470 | * If it is true, use_division changed to use the document division |
1471 | 1471 | */ |
1472 | - if($use_division) |
|
1472 | + if ($use_division) |
|
1473 | 1473 | { |
1474 | 1474 | // Division begins |
1475 | - $division = (int)Context::get('division'); |
|
1475 | + $division = (int) Context::get('division'); |
|
1476 | 1476 | |
1477 | 1477 | // order by list_order and (module_srl===0 or module_srl may count), therefore case table full scan |
1478 | - if($args->sort_index == 'list_order' && ($args->exclude_module_srl === '0' || count(explode(',', $args->module_srl)) > 5)) |
|
1478 | + if ($args->sort_index == 'list_order' && ($args->exclude_module_srl === '0' || count(explode(',', $args->module_srl)) > 5)) |
|
1479 | 1479 | { |
1480 | 1480 | $listSqlID = 'document.getDocumentListUseIndex'; |
1481 | 1481 | $divisionSqlID = 'document.getDocumentDivisionUseIndex'; |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | // If you do not value the best division top |
1490 | - if(!$division) |
|
1490 | + if (!$division) |
|
1491 | 1491 | { |
1492 | 1492 | $division_args = new stdClass(); |
1493 | 1493 | $division_args->module_srl = $args->module_srl; |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | $division_args->statusList = $args->statusList; |
1499 | 1499 | |
1500 | 1500 | $output = executeQuery($divisionSqlID, $division_args, array('list_order')); |
1501 | - if($output->data) |
|
1501 | + if ($output->data) |
|
1502 | 1502 | { |
1503 | 1503 | $item = array_pop($output->data); |
1504 | 1504 | $division = $item->list_order; |
@@ -1507,10 +1507,10 @@ discard block |
||
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | // The last division |
1510 | - $last_division = (int)Context::get('last_division'); |
|
1510 | + $last_division = (int) Context::get('last_division'); |
|
1511 | 1511 | |
1512 | 1512 | // Division after division from the 5000 value of the specified Wanted |
1513 | - if(!$last_division) |
|
1513 | + if (!$last_division) |
|
1514 | 1514 | { |
1515 | 1515 | $last_division_args = new stdClass(); |
1516 | 1516 | $last_division_args->module_srl = $args->module_srl; |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | $last_division_args->page = 5001; |
1523 | 1523 | |
1524 | 1524 | $output = executeQuery($divisionSqlID, $last_division_args, array('list_order')); |
1525 | - if($output->data) |
|
1525 | + if ($output->data) |
|
1526 | 1526 | { |
1527 | 1527 | $item = array_pop($output->data); |
1528 | 1528 | $last_division = $item->list_order; |
@@ -1530,14 +1530,14 @@ discard block |
||
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | // Make sure that after last_division article |
1533 | - if($last_division) |
|
1533 | + if ($last_division) |
|
1534 | 1534 | { |
1535 | 1535 | $last_division_args = new stdClass(); |
1536 | 1536 | $last_division_args->module_srl = $args->module_srl; |
1537 | 1537 | $last_division_args->exclude_module_srl = $args->exclude_module_srl; |
1538 | 1538 | $last_division_args->list_order = $last_division; |
1539 | 1539 | $output = executeQuery('document.getDocumentDivisionCount', $last_division_args); |
1540 | - if($output->data->count<1) $last_division = null; |
|
1540 | + if ($output->data->count < 1) $last_division = null; |
|
1541 | 1541 | } |
1542 | 1542 | |
1543 | 1543 | $args->division = $division; |
@@ -1570,7 +1570,7 @@ discard block |
||
1570 | 1570 | * @param int $count |
1571 | 1571 | * @return object |
1572 | 1572 | */ |
1573 | - function getDocumentListByMemberSrl($member_srl, $columnList = array(), $page = 0, $is_admin = FALSE, $count = 0 ) |
|
1573 | + function getDocumentListByMemberSrl($member_srl, $columnList = array(), $page = 0, $is_admin = FALSE, $count = 0) |
|
1574 | 1574 | { |
1575 | 1575 | $args = new stdClass(); |
1576 | 1576 | $args->member_srl = $member_srl; |
@@ -1578,8 +1578,8 @@ discard block |
||
1578 | 1578 | $output = executeQuery('document.getDocumentListByMemberSrl', $args, $columnList); |
1579 | 1579 | $document_list = $output->data; |
1580 | 1580 | |
1581 | - if(!$document_list) return array(); |
|
1582 | - if(!is_array($document_list)) $document_list = array($document_list); |
|
1581 | + if (!$document_list) return array(); |
|
1582 | + if (!is_array($document_list)) $document_list = array($document_list); |
|
1583 | 1583 | |
1584 | 1584 | return $document_list; |
1585 | 1585 | } |
@@ -56,18 +56,24 @@ discard block |
||
56 | 56 | $_document_list = &$GLOBALS['XE_DOCUMENT_LIST']; |
57 | 57 | |
58 | 58 | // XE XE_DOCUMENT_LIST all documents that the object referred to the global variable settings |
59 | - if(count($_document_list) <= 0) return; |
|
59 | + if(count($_document_list) <= 0) { |
|
60 | + return; |
|
61 | + } |
|
60 | 62 | |
61 | 63 | // Find all called the document object variable has been set extension |
62 | 64 | $document_srls = array(); |
63 | 65 | foreach($_document_list as $key => $val) |
64 | 66 | { |
65 | - if(!$val->document_srl || $checked_documents[$val->document_srl]) continue; |
|
67 | + if(!$val->document_srl || $checked_documents[$val->document_srl]) { |
|
68 | + continue; |
|
69 | + } |
|
66 | 70 | $checked_documents[$val->document_srl] = true; |
67 | 71 | $document_srls[] = $val->document_srl; |
68 | 72 | } |
69 | 73 | // If the document number, return detected |
70 | - if(!count($document_srls)) return; |
|
74 | + if(!count($document_srls)) { |
|
75 | + return; |
|
76 | + } |
|
71 | 77 | // Expand variables mijijeongdoen article about a current visitor to the extension of the language code, the search variable |
72 | 78 | //$obj->document_srl = implode(',',$document_srls); |
73 | 79 | $output = $this->getDocumentExtraVarsFromDB($document_srls); |
@@ -75,8 +81,12 @@ discard block |
||
75 | 81 | { |
76 | 82 | foreach($output->data as $key => $val) |
77 | 83 | { |
78 | - if(!isset($val->value)) continue; |
|
79 | - if(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); |
|
84 | + if(!isset($val->value)) { |
|
85 | + continue; |
|
86 | + } |
|
87 | + if(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) { |
|
88 | + $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); |
|
89 | + } |
|
80 | 90 | $extra_vars[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value); |
81 | 91 | } |
82 | 92 | } |
@@ -87,7 +97,9 @@ discard block |
||
87 | 97 | $document_srl = $document_srls[$i]; |
88 | 98 | unset($vars); |
89 | 99 | |
90 | - if(!$_document_list[$document_srl] || !is_object($_document_list[$document_srl]) || !$_document_list[$document_srl]->isExists()) continue; |
|
100 | + if(!$_document_list[$document_srl] || !is_object($_document_list[$document_srl]) || !$_document_list[$document_srl]->isExists()) { |
|
101 | + continue; |
|
102 | + } |
|
91 | 103 | $module_srl = $_document_list[$document_srl]->get('module_srl'); |
92 | 104 | $extra_keys = $this->getExtraKeys($module_srl); |
93 | 105 | $vars = $extra_vars[$document_srl]; |
@@ -99,10 +111,15 @@ discard block |
||
99 | 111 | { |
100 | 112 | $extra_keys[$idx] = clone($key); |
101 | 113 | $val = $vars[$idx]; |
102 | - if(isset($val[$user_lang_code])) $v = $val[$user_lang_code]; |
|
103 | - else if(isset($val[$document_lang_code])) $v = $val[$document_lang_code]; |
|
104 | - else if(isset($val[0])) $v = $val[0]; |
|
105 | - else $v = null; |
|
114 | + if(isset($val[$user_lang_code])) { |
|
115 | + $v = $val[$user_lang_code]; |
|
116 | + } else if(isset($val[$document_lang_code])) { |
|
117 | + $v = $val[$document_lang_code]; |
|
118 | + } else if(isset($val[0])) { |
|
119 | + $v = $val[0]; |
|
120 | + } else { |
|
121 | + $v = null; |
|
122 | + } |
|
106 | 123 | $extra_keys[$idx]->value = $v; |
107 | 124 | } |
108 | 125 | } |
@@ -111,9 +128,13 @@ discard block |
||
111 | 128 | $evars = new ExtraVar($module_srl); |
112 | 129 | $evars->setExtraVarKeys($extra_keys); |
113 | 130 | // Title Processing |
114 | - if($vars[-1][$user_lang_code]) $_document_list[$document_srl]->add('title',$vars[-1][$user_lang_code]); |
|
131 | + if($vars[-1][$user_lang_code]) { |
|
132 | + $_document_list[$document_srl]->add('title',$vars[-1][$user_lang_code]); |
|
133 | + } |
|
115 | 134 | // Information processing |
116 | - if($vars[-2][$user_lang_code]) $_document_list[$document_srl]->add('content',$vars[-2][$user_lang_code]); |
|
135 | + if($vars[-2][$user_lang_code]) { |
|
136 | + $_document_list[$document_srl]->add('content',$vars[-2][$user_lang_code]); |
|
137 | + } |
|
117 | 138 | |
118 | 139 | if($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code]) |
119 | 140 | { |
@@ -134,15 +155,21 @@ discard block |
||
134 | 155 | */ |
135 | 156 | function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true, $columnList = array()) |
136 | 157 | { |
137 | - if(!$document_srl) return new documentItem(); |
|
158 | + if(!$document_srl) { |
|
159 | + return new documentItem(); |
|
160 | + } |
|
138 | 161 | |
139 | 162 | if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
140 | 163 | { |
141 | 164 | $oDocument = new documentItem($document_srl, $load_extra_vars, $columnList); |
142 | 165 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
143 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
166 | + if($load_extra_vars) { |
|
167 | + $this->setToAllDocumentExtraVars(); |
|
168 | + } |
|
169 | + } |
|
170 | + if($is_admin) { |
|
171 | + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); |
|
144 | 172 | } |
145 | - if($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); |
|
146 | 173 | |
147 | 174 | return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
148 | 175 | } |
@@ -161,8 +188,7 @@ discard block |
||
161 | 188 | { |
162 | 189 | $list_count = count($document_srls); |
163 | 190 | $document_srls = implode(',',$document_srls); |
164 | - } |
|
165 | - else |
|
191 | + } else |
|
166 | 192 | { |
167 | 193 | $list_count = 1; |
168 | 194 | } |
@@ -173,28 +199,38 @@ discard block |
||
173 | 199 | |
174 | 200 | $output = executeQuery('document.getDocuments', $args, $columnList); |
175 | 201 | $document_list = $output->data; |
176 | - if(!$document_list) return; |
|
177 | - if(!is_array($document_list)) $document_list = array($document_list); |
|
202 | + if(!$document_list) { |
|
203 | + return; |
|
204 | + } |
|
205 | + if(!is_array($document_list)) { |
|
206 | + $document_list = array($document_list); |
|
207 | + } |
|
178 | 208 | |
179 | 209 | $document_count = count($document_list); |
180 | 210 | foreach($document_list as $key => $attribute) |
181 | 211 | { |
182 | 212 | $document_srl = $attribute->document_srl; |
183 | - if(!$document_srl) continue; |
|
213 | + if(!$document_srl) { |
|
214 | + continue; |
|
215 | + } |
|
184 | 216 | |
185 | 217 | if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
186 | 218 | { |
187 | 219 | $oDocument = null; |
188 | 220 | $oDocument = new documentItem(); |
189 | 221 | $oDocument->setAttribute($attribute, false); |
190 | - if($is_admin) $oDocument->setGrant(); |
|
222 | + if($is_admin) { |
|
223 | + $oDocument->setGrant(); |
|
224 | + } |
|
191 | 225 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
192 | 226 | } |
193 | 227 | |
194 | 228 | $result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; |
195 | 229 | } |
196 | 230 | |
197 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
231 | + if($load_extra_vars) { |
|
232 | + $this->setToAllDocumentExtraVars(); |
|
233 | + } |
|
198 | 234 | |
199 | 235 | $output = null; |
200 | 236 | if(count($result)) |
@@ -242,18 +278,15 @@ discard block |
||
242 | 278 | { |
243 | 279 | $output = $obj->use_alternate_output; |
244 | 280 | unset($obj->use_alternate_output); |
245 | - } |
|
246 | - elseif ($sort_check->isExtraVars && substr_count($obj->search_target,'extra_vars')) |
|
281 | + } elseif ($sort_check->isExtraVars && substr_count($obj->search_target,'extra_vars')) |
|
247 | 282 | { |
248 | 283 | $query_id = 'document.getDocumentListWithinExtraVarsExtraSort'; |
249 | 284 | $args->sort_index = str_replace('documents.','',$args->sort_index); |
250 | 285 | $output = executeQueryArray($query_id, $args); |
251 | - } |
|
252 | - elseif ($sort_check->isExtraVars) |
|
286 | + } elseif ($sort_check->isExtraVars) |
|
253 | 287 | { |
254 | 288 | $output = executeQueryArray($query_id, $args); |
255 | - } |
|
256 | - else |
|
289 | + } else |
|
257 | 290 | { |
258 | 291 | // document.getDocumentList query execution |
259 | 292 | // Query_id if you have a group by clause getDocumentListWithinTag getDocumentListWithinComment or used again to perform the query because |
@@ -263,11 +296,15 @@ discard block |
||
263 | 296 | $group_args = clone($args); |
264 | 297 | $group_args->sort_index = 'documents.'.$args->sort_index; |
265 | 298 | $output = executeQueryArray($query_id, $group_args); |
266 | - if(!$output->toBool()||!count($output->data)) return $output; |
|
299 | + if(!$output->toBool()||!count($output->data)) { |
|
300 | + return $output; |
|
301 | + } |
|
267 | 302 | |
268 | 303 | foreach($output->data as $key => $val) |
269 | 304 | { |
270 | - if($val->document_srl) $target_srls[] = $val->document_srl; |
|
305 | + if($val->document_srl) { |
|
306 | + $target_srls[] = $val->document_srl; |
|
307 | + } |
|
271 | 308 | } |
272 | 309 | |
273 | 310 | $page_navigation = $output->page_navigation; |
@@ -285,14 +322,15 @@ discard block |
||
285 | 322 | $output->total_count = $page_navigation->total_count; |
286 | 323 | $output->total_page = $page_navigation->total_page; |
287 | 324 | $output->page = $page_navigation->cur_page; |
288 | - } |
|
289 | - else |
|
325 | + } else |
|
290 | 326 | { |
291 | 327 | $output = executeQueryArray($query_id, $args, $columnList); |
292 | 328 | } |
293 | 329 | } |
294 | 330 | // Return if no result or an error occurs |
295 | - if(!$output->toBool()||!count($output->data)) return $output; |
|
331 | + if(!$output->toBool()||!count($output->data)) { |
|
332 | + return $output; |
|
333 | + } |
|
296 | 334 | $idx = 0; |
297 | 335 | $data = $output->data; |
298 | 336 | unset($output->data); |
@@ -307,20 +345,26 @@ discard block |
||
307 | 345 | { |
308 | 346 | foreach($data as $key => $attribute) |
309 | 347 | { |
310 | - if($attribute->is_notice == 'Y') $virtual_number --; |
|
348 | + if($attribute->is_notice == 'Y') { |
|
349 | + $virtual_number --; |
|
350 | + } |
|
311 | 351 | } |
312 | 352 | } |
313 | 353 | |
314 | 354 | foreach($data as $key => $attribute) |
315 | 355 | { |
316 | - if($except_notice && $attribute->is_notice == 'Y') continue; |
|
356 | + if($except_notice && $attribute->is_notice == 'Y') { |
|
357 | + continue; |
|
358 | + } |
|
317 | 359 | $document_srl = $attribute->document_srl; |
318 | 360 | if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
319 | 361 | { |
320 | 362 | $oDocument = null; |
321 | 363 | $oDocument = new documentItem(); |
322 | 364 | $oDocument->setAttribute($attribute, false); |
323 | - if($is_admin) $oDocument->setGrant(); |
|
365 | + if($is_admin) { |
|
366 | + $oDocument->setGrant(); |
|
367 | + } |
|
324 | 368 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
325 | 369 | } |
326 | 370 | |
@@ -328,7 +372,9 @@ discard block |
||
328 | 372 | $virtual_number--; |
329 | 373 | } |
330 | 374 | |
331 | - if($load_extra_vars) $this->setToAllDocumentExtraVars(); |
|
375 | + if($load_extra_vars) { |
|
376 | + $this->setToAllDocumentExtraVars(); |
|
377 | + } |
|
332 | 378 | |
333 | 379 | if(count($output->data)) |
334 | 380 | { |
@@ -356,12 +402,16 @@ discard block |
||
356 | 402 | $args->module_srl = $obj->module_srl; |
357 | 403 | $args->category_srl= $obj->category_srl; |
358 | 404 | $output = executeQueryArray('document.getNoticeList', $args, $columnList); |
359 | - if(!$output->toBool()||!$output->data) return; |
|
405 | + if(!$output->toBool()||!$output->data) { |
|
406 | + return; |
|
407 | + } |
|
360 | 408 | |
361 | 409 | foreach($output->data as $key => $val) |
362 | 410 | { |
363 | 411 | $document_srl = $val->document_srl; |
364 | - if(!$document_srl) continue; |
|
412 | + if(!$document_srl) { |
|
413 | + continue; |
|
414 | + } |
|
365 | 415 | |
366 | 416 | if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) |
367 | 417 | { |
@@ -457,7 +507,9 @@ discard block |
||
457 | 507 | |
458 | 508 | $oExtraVar->setExtraVarKeys($output->data); |
459 | 509 | $keys = $oExtraVar->getExtraVars(); |
460 | - if(!$keys) $keys = array(); |
|
510 | + if(!$keys) { |
|
511 | + $keys = array(); |
|
512 | + } |
|
461 | 513 | |
462 | 514 | if($oCacheHandler->isSupport()) |
463 | 515 | { |
@@ -487,7 +539,9 @@ discard block |
||
487 | 539 | $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; |
488 | 540 | $this->setToAllDocumentExtraVars(); |
489 | 541 | } |
490 | - if(is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); |
|
542 | + if(is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) { |
|
543 | + ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); |
|
544 | + } |
|
491 | 545 | return $GLOBALS['XE_EXTRA_VARS'][$document_srl]; |
492 | 546 | } |
493 | 547 | |
@@ -517,7 +571,9 @@ discard block |
||
517 | 571 | $oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList); |
518 | 572 | $module_srl = $oDocument->get('module_srl'); |
519 | 573 | $member_srl = $oDocument->get('member_srl'); |
520 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
574 | + if(!$module_srl) { |
|
575 | + return new Object(-1, 'msg_invalid_request'); |
|
576 | + } |
|
521 | 577 | |
522 | 578 | $oModuleModel = getModel('module'); |
523 | 579 | $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); |
@@ -590,7 +646,9 @@ discard block |
||
590 | 646 | */ |
591 | 647 | function getDocumentCount($module_srl, $search_obj = NULL) |
592 | 648 | { |
593 | - if(is_null($search_obj)) $search_obj = new stdClass(); |
|
649 | + if(is_null($search_obj)) { |
|
650 | + $search_obj = new stdClass(); |
|
651 | + } |
|
594 | 652 | $search_obj->module_srl = $module_srl; |
595 | 653 | |
596 | 654 | $output = executeQuery('document.getDocumentCount', $search_obj); |
@@ -607,7 +665,9 @@ discard block |
||
607 | 665 | function getDocumentCountByGroupStatus($search_obj = NULL) |
608 | 666 | { |
609 | 667 | $output = executeQuery('document.getDocumentCountByGroupStatus', $search_obj); |
610 | - if(!$output->toBool()) return array(); |
|
668 | + if(!$output->toBool()) { |
|
669 | + return array(); |
|
670 | + } |
|
611 | 671 | |
612 | 672 | return $output->data; |
613 | 673 | } |
@@ -646,34 +706,29 @@ discard block |
||
646 | 706 | if($sort_check->isExtraVars) |
647 | 707 | { |
648 | 708 | return 1; |
649 | - } |
|
650 | - else |
|
709 | + } else |
|
651 | 710 | { |
652 | 711 | if($sort_check->sort_index === 'list_order' || $sort_check->sort_index === 'update_order') |
653 | 712 | { |
654 | 713 | if($args->order_type === 'desc') |
655 | 714 | { |
656 | 715 | $args->{'rev_' . $sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
657 | - } |
|
658 | - else |
|
716 | + } else |
|
659 | 717 | { |
660 | 718 | $args->{$sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
661 | 719 | } |
662 | - } |
|
663 | - elseif($sort_check->sort_index === 'regdate') |
|
720 | + } elseif($sort_check->sort_index === 'regdate') |
|
664 | 721 | { |
665 | 722 | |
666 | 723 | if($args->order_type === 'asc') |
667 | 724 | { |
668 | 725 | $args->{'rev_' . $sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
669 | - } |
|
670 | - else |
|
726 | + } else |
|
671 | 727 | { |
672 | 728 | $args->{$sort_check->sort_index} = $oDocument->get($sort_check->sort_index); |
673 | 729 | } |
674 | 730 | |
675 | - } |
|
676 | - else |
|
731 | + } else |
|
677 | 732 | { |
678 | 733 | return 1; |
679 | 734 | } |
@@ -699,15 +754,16 @@ discard block |
||
699 | 754 | $output = executeQuery('document.getCategory', $args, $columnList); |
700 | 755 | |
701 | 756 | $node = $output->data; |
702 | - if(!$node) return; |
|
757 | + if(!$node) { |
|
758 | + return; |
|
759 | + } |
|
703 | 760 | |
704 | 761 | if($node->group_srls) |
705 | 762 | { |
706 | 763 | $group_srls = explode(',',$node->group_srls); |
707 | 764 | unset($node->group_srls); |
708 | 765 | $node->group_srls = $group_srls; |
709 | - } |
|
710 | - else |
|
766 | + } else |
|
711 | 767 | { |
712 | 768 | unset($node->group_srls); |
713 | 769 | $node->group_srls = array(); |
@@ -725,7 +781,9 @@ discard block |
||
725 | 781 | $args = new stdClass(); |
726 | 782 | $args->category_srl = $category_srl; |
727 | 783 | $output = executeQuery('document.getChildCategoryCount',$args); |
728 | - if($output->data->count > 0) return true; |
|
784 | + if($output->data->count > 0) { |
|
785 | + return true; |
|
786 | + } |
|
729 | 787 | return false; |
730 | 788 | } |
731 | 789 | |
@@ -744,7 +802,9 @@ discard block |
||
744 | 802 | if(!file_exists($filename)) |
745 | 803 | { |
746 | 804 | $oDocumentController = getController('document'); |
747 | - if(!$oDocumentController->makeCategoryFile($module_srl)) return array(); |
|
805 | + if(!$oDocumentController->makeCategoryFile($module_srl)) { |
|
806 | + return array(); |
|
807 | + } |
|
748 | 808 | } |
749 | 809 | |
750 | 810 | include($filename); |
@@ -764,7 +824,9 @@ discard block |
||
764 | 824 | */ |
765 | 825 | function _arrangeCategory(&$document_category, $list, $depth) |
766 | 826 | { |
767 | - if(!count($list)) return; |
|
827 | + if(!count($list)) { |
|
828 | + return; |
|
829 | + } |
|
768 | 830 | $idx = 0; |
769 | 831 | $list_order = array(); |
770 | 832 | foreach($list as $key => $val) |
@@ -784,8 +846,11 @@ discard block |
||
784 | 846 | $obj->childs = array(); |
785 | 847 | $obj->grant = $val['grant']; |
786 | 848 | |
787 | - if(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true; |
|
788 | - else $selected = false; |
|
849 | + if(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) { |
|
850 | + $selected = true; |
|
851 | + } else { |
|
852 | + $selected = false; |
|
853 | + } |
|
789 | 854 | |
790 | 855 | $obj->selected = $selected; |
791 | 856 | |
@@ -796,14 +861,18 @@ discard block |
||
796 | 861 | $parent_srl = $obj->parent_srl; |
797 | 862 | $document_count = $obj->document_count; |
798 | 863 | $expand = $obj->expand; |
799 | - if($selected) $expand = true; |
|
864 | + if($selected) { |
|
865 | + $expand = true; |
|
866 | + } |
|
800 | 867 | |
801 | 868 | while($parent_srl) |
802 | 869 | { |
803 | 870 | $document_category[$parent_srl]->document_count += $document_count; |
804 | 871 | $document_category[$parent_srl]->childs[] = $obj->category_srl; |
805 | 872 | $document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs); |
806 | - if($expand) $document_category[$parent_srl]->expand = $expand; |
|
873 | + if($expand) { |
|
874 | + $document_category[$parent_srl]->expand = $expand; |
|
875 | + } |
|
807 | 876 | |
808 | 877 | $parent_srl = $document_category[$parent_srl]->parent_srl; |
809 | 878 | } |
@@ -811,7 +880,9 @@ discard block |
||
811 | 880 | |
812 | 881 | $document_category[$key] = $obj; |
813 | 882 | |
814 | - if(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1); |
|
883 | + if(count($val['list'])) { |
|
884 | + $this->_arrangeCategory($document_category, $val['list'], $depth+1); |
|
885 | + } |
|
815 | 886 | } |
816 | 887 | $document_category[$list_order[0]]->first = true; |
817 | 888 | $document_category[$list_order[count($list_order)-1]]->last = true; |
@@ -879,13 +950,20 @@ discard block |
||
879 | 950 | } |
880 | 951 | // Module_srl passed the array may be a check whether the array |
881 | 952 | $args = new stdClass; |
882 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
883 | - else $args->module_srl = $obj->module_srl; |
|
953 | + if(is_array($obj->module_srl)) { |
|
954 | + $args->module_srl = implode(',', $obj->module_srl); |
|
955 | + } else { |
|
956 | + $args->module_srl = $obj->module_srl; |
|
957 | + } |
|
884 | 958 | |
885 | 959 | $output = executeQuery('document.getMonthlyArchivedList', $args); |
886 | - if(!$output->toBool()||!$output->data) return $output; |
|
960 | + if(!$output->toBool()||!$output->data) { |
|
961 | + return $output; |
|
962 | + } |
|
887 | 963 | |
888 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
964 | + if(!is_array($output->data)) { |
|
965 | + $output->data = array($output->data); |
|
966 | + } |
|
889 | 967 | |
890 | 968 | return $output; |
891 | 969 | } |
@@ -905,14 +983,21 @@ discard block |
||
905 | 983 | } |
906 | 984 | // Module_srl passed the array may be a check whether the array |
907 | 985 | $args = new stdClass; |
908 | - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); |
|
909 | - else $args->module_srl = $obj->module_srl; |
|
986 | + if(is_array($obj->module_srl)) { |
|
987 | + $args->module_srl = implode(',', $obj->module_srl); |
|
988 | + } else { |
|
989 | + $args->module_srl = $obj->module_srl; |
|
990 | + } |
|
910 | 991 | $args->regdate = $obj->regdate; |
911 | 992 | |
912 | 993 | $output = executeQuery('document.getDailyArchivedList', $args); |
913 | - if(!$output->toBool()) return $output; |
|
994 | + if(!$output->toBool()) { |
|
995 | + return $output; |
|
996 | + } |
|
914 | 997 | |
915 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
998 | + if(!is_array($output->data)) { |
|
999 | + $output->data = array($output->data); |
|
1000 | + } |
|
916 | 1001 | |
917 | 1002 | return $output; |
918 | 1003 | } |
@@ -923,7 +1008,9 @@ discard block |
||
923 | 1008 | */ |
924 | 1009 | function getDocumentCategories() |
925 | 1010 | { |
926 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
1011 | + if(!Context::get('is_logged')) { |
|
1012 | + return new Object(-1,'msg_not_permitted'); |
|
1013 | + } |
|
927 | 1014 | $module_srl = Context::get('module_srl'); |
928 | 1015 | $categories= $this->getCategoryList($module_srl); |
929 | 1016 | $lang = Context::get('lang'); |
@@ -950,8 +1037,12 @@ discard block |
||
950 | 1037 | $oModuleModel = getModel('module'); |
951 | 1038 | $config = $oModuleModel->getModuleConfig('document'); |
952 | 1039 | |
953 | - if(!$config) $config = new stdClass(); |
|
954 | - if(!$config->thumbnail_type) $config->thumbnail_type = 'crop'; |
|
1040 | + if(!$config) { |
|
1041 | + $config = new stdClass(); |
|
1042 | + } |
|
1043 | + if(!$config->thumbnail_type) { |
|
1044 | + $config->thumbnail_type = 'crop'; |
|
1045 | + } |
|
955 | 1046 | $GLOBALS['__document_config__'] = $config; |
956 | 1047 | } |
957 | 1048 | return $GLOBALS['__document_config__']; |
@@ -1016,7 +1107,9 @@ discard block |
||
1016 | 1107 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
1017 | 1108 | // Check permissions |
1018 | 1109 | $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info')); |
1019 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
1110 | + if(!$grant->manager) { |
|
1111 | + return new Object(-1,'msg_not_permitted'); |
|
1112 | + } |
|
1020 | 1113 | |
1021 | 1114 | $category_srl = Context::get('category_srl'); |
1022 | 1115 | $category_info = $this->getCategory($category_srl); |
@@ -1036,15 +1129,20 @@ discard block |
||
1036 | 1129 | */ |
1037 | 1130 | function getDocumentSrlByAlias($mid, $alias) |
1038 | 1131 | { |
1039 | - if(!$mid || !$alias) return null; |
|
1132 | + if(!$mid || !$alias) { |
|
1133 | + return null; |
|
1134 | + } |
|
1040 | 1135 | $site_module_info = Context::get('site_module_info'); |
1041 | 1136 | $args = new stdClass; |
1042 | 1137 | $args->mid = $mid; |
1043 | 1138 | $args->alias_title = $alias; |
1044 | 1139 | $args->site_srl = $site_module_info->site_srl; |
1045 | 1140 | $output = executeQuery('document.getDocumentSrlByAlias', $args); |
1046 | - if(!$output->data) return null; |
|
1047 | - else return $output->data->document_srl; |
|
1141 | + if(!$output->data) { |
|
1142 | + return null; |
|
1143 | + } else { |
|
1144 | + return $output->data->document_srl; |
|
1145 | + } |
|
1048 | 1146 | } |
1049 | 1147 | |
1050 | 1148 | /** |
@@ -1055,15 +1153,20 @@ discard block |
||
1055 | 1153 | */ |
1056 | 1154 | function getDocumentSrlByTitle($module_srl, $title) |
1057 | 1155 | { |
1058 | - if(!$module_srl || !$title) return null; |
|
1156 | + if(!$module_srl || !$title) { |
|
1157 | + return null; |
|
1158 | + } |
|
1059 | 1159 | $args = new stdClass; |
1060 | 1160 | $args->module_srl = $module_srl; |
1061 | 1161 | $args->title = $title; |
1062 | 1162 | $output = executeQuery('document.getDocumentSrlByTitle', $args); |
1063 | - if(!$output->data) return null; |
|
1064 | - else |
|
1163 | + if(!$output->data) { |
|
1164 | + return null; |
|
1165 | + } else |
|
1065 | 1166 | { |
1066 | - if(is_array($output->data)) return $output->data[0]->document_srl; |
|
1167 | + if(is_array($output->data)) { |
|
1168 | + return $output->data[0]->document_srl; |
|
1169 | + } |
|
1067 | 1170 | return $output->data->document_srl; |
1068 | 1171 | } |
1069 | 1172 | } |
@@ -1075,13 +1178,18 @@ discard block |
||
1075 | 1178 | */ |
1076 | 1179 | function getAlias($document_srl) |
1077 | 1180 | { |
1078 | - if(!$document_srl) return null; |
|
1181 | + if(!$document_srl) { |
|
1182 | + return null; |
|
1183 | + } |
|
1079 | 1184 | $args = new stdClass; |
1080 | 1185 | $args->document_srl = $document_srl; |
1081 | 1186 | $output = executeQueryArray('document.getAliases', $args); |
1082 | 1187 | |
1083 | - if(!$output->data) return null; |
|
1084 | - else return $output->data[0]->alias_title; |
|
1188 | + if(!$output->data) { |
|
1189 | + return null; |
|
1190 | + } else { |
|
1191 | + return $output->data[0]->alias_title; |
|
1192 | + } |
|
1085 | 1193 | } |
1086 | 1194 | |
1087 | 1195 | /** |
@@ -1138,17 +1246,23 @@ discard block |
||
1138 | 1246 | { |
1139 | 1247 | case 'title' : |
1140 | 1248 | case 'content' : |
1141 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1249 | + if($search_keyword) { |
|
1250 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1251 | + } |
|
1142 | 1252 | $args->{"s_".$search_target} = $search_keyword; |
1143 | 1253 | $use_division = true; |
1144 | 1254 | break; |
1145 | 1255 | case 'title_content' : |
1146 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1256 | + if($search_keyword) { |
|
1257 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1258 | + } |
|
1147 | 1259 | $args->s_title = $search_keyword; |
1148 | 1260 | $args->s_content = $search_keyword; |
1149 | 1261 | break; |
1150 | 1262 | case 'user_id' : |
1151 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1263 | + if($search_keyword) { |
|
1264 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1265 | + } |
|
1152 | 1266 | $args->s_user_id = $search_keyword; |
1153 | 1267 | $args->sort_index = 'documents.'.$args->sort_index; |
1154 | 1268 | break; |
@@ -1156,13 +1270,18 @@ discard block |
||
1156 | 1270 | case 'nick_name' : |
1157 | 1271 | case 'email_address' : |
1158 | 1272 | case 'homepage' : |
1159 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1273 | + if($search_keyword) { |
|
1274 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1275 | + } |
|
1160 | 1276 | $args->{"s_".$search_target} = $search_keyword; |
1161 | 1277 | break; |
1162 | 1278 | case 'is_notice' : |
1163 | 1279 | case 'is_secret' : |
1164 | - if($search_keyword=='N') $args->statusList = array($this->getConfigStatus('public')); |
|
1165 | - elseif($search_keyword=='Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1280 | + if($search_keyword=='N') { |
|
1281 | + $args->statusList = array($this->getConfigStatus('public')); |
|
1282 | + } elseif($search_keyword=='Y') { |
|
1283 | + $args->statusList = array($this->getConfigStatus('secret')); |
|
1284 | + } |
|
1166 | 1285 | break; |
1167 | 1286 | case 'member_srl' : |
1168 | 1287 | case 'readed_count' : |
@@ -1204,34 +1323,45 @@ discard block |
||
1204 | 1323 | { |
1205 | 1324 | $args = new stdClass; |
1206 | 1325 | $document_srl = Context::get('document_srl'); |
1207 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
1326 | + if(!$document_srl) { |
|
1327 | + return new Object(-1,'msg_invalid_request'); |
|
1328 | + } |
|
1208 | 1329 | |
1209 | 1330 | $point = Context::get('point'); |
1210 | - if($point != -1) $point = 1; |
|
1331 | + if($point != -1) { |
|
1332 | + $point = 1; |
|
1333 | + } |
|
1211 | 1334 | |
1212 | 1335 | $oDocumentModel = getModel('document'); |
1213 | 1336 | $columnList = array('document_srl', 'module_srl'); |
1214 | 1337 | $oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList); |
1215 | 1338 | $module_srl = $oDocument->get('module_srl'); |
1216 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
1339 | + if(!$module_srl) { |
|
1340 | + return new Object(-1, 'msg_invalid_request'); |
|
1341 | + } |
|
1217 | 1342 | |
1218 | 1343 | $oModuleModel = getModel('module'); |
1219 | 1344 | $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); |
1220 | 1345 | if($point == -1) |
1221 | 1346 | { |
1222 | - if($document_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); |
|
1347 | + if($document_config->use_vote_down!='S') { |
|
1348 | + return new Object(-1, 'msg_invalid_request'); |
|
1349 | + } |
|
1223 | 1350 | $args->below_point = 0; |
1224 | - } |
|
1225 | - else |
|
1351 | + } else |
|
1226 | 1352 | { |
1227 | - if($document_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); |
|
1353 | + if($document_config->use_vote_up!='S') { |
|
1354 | + return new Object(-1, 'msg_invalid_request'); |
|
1355 | + } |
|
1228 | 1356 | $args->more_point = 0; |
1229 | 1357 | } |
1230 | 1358 | |
1231 | 1359 | $args->document_srl = $document_srl; |
1232 | 1360 | |
1233 | 1361 | $output = executeQueryArray('document.getVotedMemberList',$args); |
1234 | - if(!$output->toBool()) return $output; |
|
1362 | + if(!$output->toBool()) { |
|
1363 | + return $output; |
|
1364 | + } |
|
1235 | 1365 | |
1236 | 1366 | $oMemberModel = getModel('member'); |
1237 | 1367 | if($output->data) |
@@ -1253,9 +1383,11 @@ discard block |
||
1253 | 1383 | function getStatusNameList() |
1254 | 1384 | { |
1255 | 1385 | global $lang; |
1256 | - if(!isset($lang->status_name_list)) |
|
1257 | - return array_flip($this->getStatusList()); |
|
1258 | - else return $lang->status_name_list; |
|
1386 | + if(!isset($lang->status_name_list)) { |
|
1387 | + return array_flip($this->getStatusList()); |
|
1388 | + } else { |
|
1389 | + return $lang->status_name_list; |
|
1390 | + } |
|
1259 | 1391 | } |
1260 | 1392 | |
1261 | 1393 | /** |
@@ -1279,20 +1411,22 @@ discard block |
||
1279 | 1411 | if (!$extra_output->data || !$extra_output->toBool()) |
1280 | 1412 | { |
1281 | 1413 | $sortIndex = 'list_order'; |
1282 | - } |
|
1283 | - else |
|
1414 | + } else |
|
1284 | 1415 | { |
1285 | 1416 | $check_array = array(); |
1286 | 1417 | foreach($extra_output->data as $val) |
1287 | 1418 | { |
1288 | 1419 | $check_array[] = $val->eid; |
1289 | 1420 | } |
1290 | - if(!in_array($sortIndex, $check_array)) $sortIndex = 'list_order'; |
|
1291 | - else $isExtraVars = true; |
|
1421 | + if(!in_array($sortIndex, $check_array)) { |
|
1422 | + $sortIndex = 'list_order'; |
|
1423 | + } else { |
|
1424 | + $isExtraVars = true; |
|
1425 | + } |
|
1292 | 1426 | } |
1427 | + } else { |
|
1428 | + $sortIndex = 'list_order'; |
|
1293 | 1429 | } |
1294 | - else |
|
1295 | - $sortIndex = 'list_order'; |
|
1296 | 1430 | } |
1297 | 1431 | $returnObj = new stdClass(); |
1298 | 1432 | $returnObj->sort_index = $sortIndex; |
@@ -1330,7 +1464,9 @@ discard block |
||
1330 | 1464 | |
1331 | 1465 | // Check the target and sequence alignment |
1332 | 1466 | $orderType = array('desc' => 1, 'asc' => 1); |
1333 | - if(!isset($orderType[$args->order_type])) $args->order_type = 'asc'; |
|
1467 | + if(!isset($orderType[$args->order_type])) { |
|
1468 | + $args->order_type = 'asc'; |
|
1469 | + } |
|
1334 | 1470 | |
1335 | 1471 | // If that came across mid module_srl instead of a direct module_srl guhaejum |
1336 | 1472 | if($searchOpt->mid) |
@@ -1341,21 +1477,29 @@ discard block |
||
1341 | 1477 | } |
1342 | 1478 | |
1343 | 1479 | // Module_srl passed the array may be a check whether the array |
1344 | - if(is_array($searchOpt->module_srl)) $args->module_srl = implode(',', $searchOpt->module_srl); |
|
1345 | - else $args->module_srl = $searchOpt->module_srl; |
|
1480 | + if(is_array($searchOpt->module_srl)) { |
|
1481 | + $args->module_srl = implode(',', $searchOpt->module_srl); |
|
1482 | + } else { |
|
1483 | + $args->module_srl = $searchOpt->module_srl; |
|
1484 | + } |
|
1346 | 1485 | |
1347 | 1486 | // Except for the test module_srl |
1348 | - if(is_array($searchOpt->exclude_module_srl)) $args->exclude_module_srl = implode(',', $searchOpt->exclude_module_srl); |
|
1349 | - else $args->exclude_module_srl = $searchOpt->exclude_module_srl; |
|
1487 | + if(is_array($searchOpt->exclude_module_srl)) { |
|
1488 | + $args->exclude_module_srl = implode(',', $searchOpt->exclude_module_srl); |
|
1489 | + } else { |
|
1490 | + $args->exclude_module_srl = $searchOpt->exclude_module_srl; |
|
1491 | + } |
|
1350 | 1492 | |
1351 | 1493 | // only admin document list, temp document showing |
1352 | - if($searchOpt->statusList) $args->statusList = $searchOpt->statusList; |
|
1353 | - else |
|
1494 | + if($searchOpt->statusList) { |
|
1495 | + $args->statusList = $searchOpt->statusList; |
|
1496 | + } else |
|
1354 | 1497 | { |
1355 | - if($logged_info->is_admin == 'Y' && !$searchOpt->module_srl) |
|
1356 | - $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp')); |
|
1357 | - else |
|
1358 | - $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public')); |
|
1498 | + if($logged_info->is_admin == 'Y' && !$searchOpt->module_srl) { |
|
1499 | + $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp')); |
|
1500 | + } else { |
|
1501 | + $args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public')); |
|
1502 | + } |
|
1359 | 1503 | } |
1360 | 1504 | |
1361 | 1505 | // Category is selected, further sub-categories until all conditions |
@@ -1383,18 +1527,24 @@ discard block |
||
1383 | 1527 | { |
1384 | 1528 | case 'title' : |
1385 | 1529 | case 'content' : |
1386 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1530 | + if($search_keyword) { |
|
1531 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1532 | + } |
|
1387 | 1533 | $args->{"s_".$search_target} = $search_keyword; |
1388 | 1534 | $use_division = true; |
1389 | 1535 | break; |
1390 | 1536 | case 'title_content' : |
1391 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1537 | + if($search_keyword) { |
|
1538 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1539 | + } |
|
1392 | 1540 | $args->s_title = $search_keyword; |
1393 | 1541 | $args->s_content = $search_keyword; |
1394 | 1542 | $use_division = true; |
1395 | 1543 | break; |
1396 | 1544 | case 'user_id' : |
1397 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1545 | + if($search_keyword) { |
|
1546 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1547 | + } |
|
1398 | 1548 | $args->s_user_id = $search_keyword; |
1399 | 1549 | $args->sort_index = 'documents.'.$args->sort_index; |
1400 | 1550 | break; |
@@ -1402,18 +1552,28 @@ discard block |
||
1402 | 1552 | case 'nick_name' : |
1403 | 1553 | case 'email_address' : |
1404 | 1554 | case 'homepage' : |
1405 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
1555 | + if($search_keyword) { |
|
1556 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
1557 | + } |
|
1406 | 1558 | $args->{"s_".$search_target} = $search_keyword; |
1407 | 1559 | break; |
1408 | 1560 | case 'is_notice' : |
1409 | - if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; |
|
1410 | - elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; |
|
1411 | - else $args->{"s_".$search_target} = ''; |
|
1561 | + if($search_keyword=='N') { |
|
1562 | + $args->{"s_".$search_target} = 'N'; |
|
1563 | + } elseif($search_keyword=='Y') { |
|
1564 | + $args->{"s_".$search_target} = 'Y'; |
|
1565 | + } else { |
|
1566 | + $args->{"s_".$search_target} = ''; |
|
1567 | + } |
|
1412 | 1568 | break; |
1413 | 1569 | case 'is_secret' : |
1414 | - if($search_keyword=='N') $args->statusList = array($this->getConfigStatus('public')); |
|
1415 | - elseif($search_keyword=='Y') $args->statusList = array($this->getConfigStatus('secret')); |
|
1416 | - elseif($search_keyword=='temp') $args->statusList = array($this->getConfigStatus('temp')); |
|
1570 | + if($search_keyword=='N') { |
|
1571 | + $args->statusList = array($this->getConfigStatus('public')); |
|
1572 | + } elseif($search_keyword=='Y') { |
|
1573 | + $args->statusList = array($this->getConfigStatus('secret')); |
|
1574 | + } elseif($search_keyword=='temp') { |
|
1575 | + $args->statusList = array($this->getConfigStatus('temp')); |
|
1576 | + } |
|
1417 | 1577 | break; |
1418 | 1578 | case 'member_srl' : |
1419 | 1579 | case 'readed_count' : |
@@ -1458,13 +1618,14 @@ discard block |
||
1458 | 1618 | if ($searchOpt->isExtraVars) |
1459 | 1619 | { |
1460 | 1620 | $query_id = 'document.getDocumentListExtraSort'; |
1461 | - } |
|
1462 | - else |
|
1621 | + } else |
|
1463 | 1622 | { |
1464 | 1623 | /** |
1465 | 1624 | * list_order asc sort of division that can be used only when |
1466 | 1625 | */ |
1467 | - if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; |
|
1626 | + if($args->sort_index != 'list_order' || $args->order_type != 'asc') { |
|
1627 | + $use_division = false; |
|
1628 | + } |
|
1468 | 1629 | |
1469 | 1630 | /** |
1470 | 1631 | * If it is true, use_division changed to use the document division |
@@ -1479,8 +1640,7 @@ discard block |
||
1479 | 1640 | { |
1480 | 1641 | $listSqlID = 'document.getDocumentListUseIndex'; |
1481 | 1642 | $divisionSqlID = 'document.getDocumentDivisionUseIndex'; |
1482 | - } |
|
1483 | - else |
|
1643 | + } else |
|
1484 | 1644 | { |
1485 | 1645 | $listSqlID = 'document.getDocumentList'; |
1486 | 1646 | $divisionSqlID = 'document.getDocumentDivision'; |
@@ -1537,7 +1697,9 @@ discard block |
||
1537 | 1697 | $last_division_args->exclude_module_srl = $args->exclude_module_srl; |
1538 | 1698 | $last_division_args->list_order = $last_division; |
1539 | 1699 | $output = executeQuery('document.getDocumentDivisionCount', $last_division_args); |
1540 | - if($output->data->count<1) $last_division = null; |
|
1700 | + if($output->data->count<1) { |
|
1701 | + $last_division = null; |
|
1702 | + } |
|
1541 | 1703 | } |
1542 | 1704 | |
1543 | 1705 | $args->division = $division; |
@@ -1578,8 +1740,12 @@ discard block |
||
1578 | 1740 | $output = executeQuery('document.getDocumentListByMemberSrl', $args, $columnList); |
1579 | 1741 | $document_list = $output->data; |
1580 | 1742 | |
1581 | - if(!$document_list) return array(); |
|
1582 | - if(!is_array($document_list)) $document_list = array($document_list); |
|
1743 | + if(!$document_list) { |
|
1744 | + return array(); |
|
1745 | + } |
|
1746 | + if(!is_array($document_list)) { |
|
1747 | + $document_list = array($document_list); |
|
1748 | + } |
|
1583 | 1749 | |
1584 | 1750 | return $document_list; |
1585 | 1751 | } |