@@ -30,12 +30,17 @@ discard block |
||
30 | 30 | function dispPageIndex() |
31 | 31 | { |
32 | 32 | // Variables used in the template Context:: set() |
33 | - if($this->module_srl) Context::set('module_srl',$this->module_srl); |
|
33 | + if($this->module_srl) { |
|
34 | + Context::set('module_srl',$this->module_srl); |
|
35 | + } |
|
34 | 36 | |
35 | 37 | $page_type_name = strtolower($this->module_info->page_type); |
36 | 38 | $method = '_get' . ucfirst($page_type_name) . 'Content'; |
37 | - if (method_exists($this, $method)) $page_content = $this->{$method}(); |
|
38 | - else return new Object(-1, sprintf('%s method is not exists', $method)); |
|
39 | + if (method_exists($this, $method)) { |
|
40 | + $page_content = $this->{$method}(); |
|
41 | + } else { |
|
42 | + return new Object(-1, sprintf('%s method is not exists', $method)); |
|
43 | + } |
|
39 | 44 | |
40 | 45 | Context::set('module_info', $this->module_info); |
41 | 46 | Context::set('page_content', $page_content); |
@@ -55,8 +60,7 @@ discard block |
||
55 | 60 | if(!file_exists($cache_file) || filesize($cache_file) < 1) |
56 | 61 | { |
57 | 62 | $mtime = 0; |
58 | - } |
|
59 | - else |
|
63 | + } else |
|
60 | 64 | { |
61 | 65 | $mtime = filemtime($cache_file); |
62 | 66 | } |
@@ -65,15 +69,13 @@ discard block |
||
65 | 69 | { |
66 | 70 | $page_content = FileHandler::readFile($cache_file); |
67 | 71 | $page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content); |
68 | - } |
|
69 | - else |
|
72 | + } else |
|
70 | 73 | { |
71 | 74 | $oWidgetController = getController('widget'); |
72 | 75 | $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent); |
73 | 76 | FileHandler::writeFile($cache_file, $page_content); |
74 | 77 | } |
75 | - } |
|
76 | - else |
|
78 | + } else |
|
77 | 79 | { |
78 | 80 | if(file_exists($cache_file)) |
79 | 81 | { |
@@ -81,8 +83,7 @@ discard block |
||
81 | 83 | } |
82 | 84 | $page_content = $this->module_info->mcontent; |
83 | 85 | } |
84 | - } |
|
85 | - else |
|
86 | + } else |
|
86 | 87 | { |
87 | 88 | $page_content = $this->module_info->content; |
88 | 89 | } |
@@ -114,8 +115,7 @@ discard block |
||
114 | 115 | if($this->module_info->mskin) |
115 | 116 | { |
116 | 117 | $templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->mskin)); |
117 | - } |
|
118 | - else |
|
118 | + } else |
|
119 | 119 | { |
120 | 120 | $templatePath = ($this->module_path.'m.skins/default'); |
121 | 121 | } |
@@ -130,8 +130,11 @@ discard block |
||
130 | 130 | // check if it is http or internal file |
131 | 131 | if($this->path) |
132 | 132 | { |
133 | - if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
134 | - else $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
|
133 | + if(preg_match("/^([a-z]+):\/\//i",$this->path)) { |
|
134 | + $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
135 | + } else { |
|
136 | + $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
|
137 | + } |
|
135 | 138 | } |
136 | 139 | |
137 | 140 | return $content; |
@@ -9,18 +9,18 @@ discard block |
||
9 | 9 | // Get a template path (page in the administrative template tpl putting together) |
10 | 10 | $this->setTemplatePath($this->module_path.'tpl'); |
11 | 11 | |
12 | - switch($this->module_info->page_type) |
|
12 | + switch ($this->module_info->page_type) |
|
13 | 13 | { |
14 | 14 | case 'WIDGET' : |
15 | 15 | { |
16 | 16 | $this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus()); |
17 | - $this->interval = (int)($this->module_info->page_caching_interval); |
|
17 | + $this->interval = (int) ($this->module_info->page_caching_interval); |
|
18 | 18 | break; |
19 | 19 | } |
20 | 20 | case 'OUTSIDE' : |
21 | 21 | { |
22 | 22 | $this->cache_file = sprintf("./files/cache/opage/%d.%s.m.cache.php", $this->module_info->module_srl, Context::getSslStatus()); |
23 | - $this->interval = (int)($this->module_info->page_caching_interval); |
|
23 | + $this->interval = (int) ($this->module_info->page_caching_interval); |
|
24 | 24 | $this->path = $this->module_info->mpath; |
25 | 25 | break; |
26 | 26 | } |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | function dispPageIndex() |
31 | 31 | { |
32 | 32 | // Variables used in the template Context:: set() |
33 | - if($this->module_srl) Context::set('module_srl',$this->module_srl); |
|
33 | + if ($this->module_srl) Context::set('module_srl', $this->module_srl); |
|
34 | 34 | |
35 | 35 | $page_type_name = strtolower($this->module_info->page_type); |
36 | - $method = '_get' . ucfirst($page_type_name) . 'Content'; |
|
36 | + $method = '_get'.ucfirst($page_type_name).'Content'; |
|
37 | 37 | if (method_exists($this, $method)) $page_content = $this->{$method}(); |
38 | 38 | else return new Object(-1, sprintf('%s method is not exists', $method)); |
39 | 39 | |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | function _getWidgetContent() |
47 | 47 | { |
48 | 48 | // Arrange a widget ryeolro |
49 | - if($this->module_info->mcontent) |
|
49 | + if ($this->module_info->mcontent) |
|
50 | 50 | { |
51 | 51 | $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); |
52 | - $interval = (int)($this->module_info->page_caching_interval); |
|
53 | - if($interval>0) |
|
52 | + $interval = (int) ($this->module_info->page_caching_interval); |
|
53 | + if ($interval > 0) |
|
54 | 54 | { |
55 | - if(!file_exists($cache_file) || filesize($cache_file) < 1) |
|
55 | + if (!file_exists($cache_file) || filesize($cache_file) < 1) |
|
56 | 56 | { |
57 | 57 | $mtime = 0; |
58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $mtime = filemtime($cache_file); |
62 | 62 | } |
63 | 63 | |
64 | - if($mtime + $interval*60 > $_SERVER['REQUEST_TIME']) |
|
64 | + if ($mtime + $interval * 60 > $_SERVER['REQUEST_TIME']) |
|
65 | 65 | { |
66 | 66 | $page_content = FileHandler::readFile($cache_file); |
67 | 67 | $page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | else |
77 | 77 | { |
78 | - if(file_exists($cache_file)) |
|
78 | + if (file_exists($cache_file)) |
|
79 | 79 | { |
80 | 80 | FileHandler::removeFile($cache_file); |
81 | 81 | } |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | $oDocumentModel = getModel('document'); |
98 | 98 | $oDocument = $oDocumentModel->getDocument(0, true); |
99 | 99 | |
100 | - if($this->module_info->mdocument_srl) |
|
100 | + if ($this->module_info->mdocument_srl) |
|
101 | 101 | { |
102 | 102 | $document_srl = $this->module_info->mdocument_srl; |
103 | 103 | $oDocument->setDocument($document_srl); |
104 | 104 | Context::set('document_srl', $document_srl); |
105 | 105 | } |
106 | - if(!$oDocument->isExists()) |
|
106 | + if (!$oDocument->isExists()) |
|
107 | 107 | { |
108 | 108 | $document_srl = $this->module_info->document_srl; |
109 | 109 | $oDocument->setDocument($document_srl); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | Context::set('oDocument', $oDocument); |
113 | 113 | |
114 | - if($this->module_info->mskin) |
|
114 | + if ($this->module_info->mskin) |
|
115 | 115 | { |
116 | 116 | $templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->mskin)); |
117 | 117 | } |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | function _getOutsideContent() |
129 | 129 | { |
130 | 130 | // check if it is http or internal file |
131 | - if($this->path) |
|
131 | + if ($this->path) |
|
132 | 132 | { |
133 | - if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
133 | + if (preg_match("/^([a-z]+):\/\//i", $this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file); |
|
134 | 134 | else $content = $this->executeFile($this->path, $this->interval, $this->cache_file); |
135 | 135 | } |
136 | 136 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if (!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
19 | 19 | // The contents of the widget chuchulham |
20 | 20 | $oWidgetController = getController('widget'); |
21 | 21 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -15,7 +15,9 @@ |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // Check permissions |
18 | - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
18 | + if(!$this->grant->access) { |
|
19 | + return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
|
20 | + } |
|
19 | 21 | // The contents of the widget chuchulham |
20 | 22 | $oWidgetController = getController('widget'); |
21 | 23 | $content = $oWidgetController->transWidgetCode($this->module_info->content); |
@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | // Check the point name |
41 | 41 | $config->point_name = $args->point_name; |
42 | - if(!$config->point_name) $config->point_name = 'point'; |
|
42 | + if(!$config->point_name) { |
|
43 | + $config->point_name = 'point'; |
|
44 | + } |
|
43 | 45 | // Specify the default points |
44 | 46 | $config->signup_point = (int)$args->signup_point; |
45 | 47 | $config->login_point = (int)$args->login_point; |
@@ -52,16 +54,26 @@ discard block |
||
52 | 54 | $config->blamed = (int)$args->blamed; |
53 | 55 | // The highest level |
54 | 56 | $config->max_level = $args->max_level; |
55 | - if($config->max_level>1000) $config->max_level = 1000; |
|
56 | - if($config->max_level<1) $config->max_level = 1; |
|
57 | + if($config->max_level>1000) { |
|
58 | + $config->max_level = 1000; |
|
59 | + } |
|
60 | + if($config->max_level<1) { |
|
61 | + $config->max_level = 1; |
|
62 | + } |
|
57 | 63 | // Set the level icon |
58 | 64 | $config->level_icon = $args->level_icon; |
59 | 65 | // Check if downloads are not allowed |
60 | - if($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
61 | - else $config->disable_download = 'N'; |
|
66 | + if($args->disable_download == 'Y') { |
|
67 | + $config->disable_download = 'Y'; |
|
68 | + } else { |
|
69 | + $config->disable_download = 'N'; |
|
70 | + } |
|
62 | 71 | // Check if reading a document is not allowed |
63 | - if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
64 | - else $config->disable_read_document = 'N'; |
|
72 | + if($args->disable_read_document == 'Y') { |
|
73 | + $config->disable_read_document = 'Y'; |
|
74 | + } else { |
|
75 | + $config->disable_read_document = 'N'; |
|
76 | + } |
|
65 | 77 | |
66 | 78 | $oMemberModel = getModel('member'); |
67 | 79 | $group_list = $oMemberModel->getGroups(); |
@@ -70,7 +82,9 @@ discard block |
||
70 | 82 | foreach($group_list as $group) |
71 | 83 | { |
72 | 84 | // Admin group should not be connected to point. |
73 | - if($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
85 | + if($group->is_admin == 'Y' || $group->is_default == 'Y') { |
|
86 | + continue; |
|
87 | + } |
|
74 | 88 | |
75 | 89 | $group_srl = $group->group_srl; |
76 | 90 | |
@@ -88,8 +102,7 @@ discard block |
||
88 | 102 | $args->{'point_group_'.$group_srl} = 1; |
89 | 103 | } |
90 | 104 | $config->point_group[$group_srl] = $args->{'point_group_'.$group_srl}; |
91 | - } |
|
92 | - else |
|
105 | + } else |
|
93 | 106 | { |
94 | 107 | unset($config->point_group[$group_srl]); |
95 | 108 | } |
@@ -105,8 +118,7 @@ discard block |
||
105 | 118 | } |
106 | 119 | // A function to calculate per-level points |
107 | 120 | $config->expression = $args->expression; |
108 | - } |
|
109 | - else |
|
121 | + } else |
|
110 | 122 | { |
111 | 123 | //module IO config is OFF, Other settings will not be modified. |
112 | 124 | $config->able_module = 'N'; |
@@ -168,16 +180,23 @@ discard block |
||
168 | 180 | function procPointAdminInsertPointModuleConfig() |
169 | 181 | { |
170 | 182 | $module_srl = Context::get('target_module_srl'); |
171 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
183 | + if(!$module_srl) { |
|
184 | + return new Object(-1, 'msg_invalid_request'); |
|
185 | + } |
|
172 | 186 | // In case of batch configuration of several modules |
173 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
174 | - else $module_srl = array($module_srl); |
|
187 | + if(preg_match('/^([0-9,]+)$/',$module_srl)) { |
|
188 | + $module_srl = explode(',',$module_srl); |
|
189 | + } else { |
|
190 | + $module_srl = array($module_srl); |
|
191 | + } |
|
175 | 192 | // Save configurations |
176 | 193 | $oModuleController = getController('module'); |
177 | 194 | for($i=0;$i<count($module_srl);$i++) |
178 | 195 | { |
179 | 196 | $srl = trim($module_srl[$i]); |
180 | - if(!$srl) continue; |
|
197 | + if(!$srl) { |
|
198 | + continue; |
|
199 | + } |
|
181 | 200 | unset($config); |
182 | 201 | $config['insert_document'] = (int)Context::get('insert_document'); |
183 | 202 | $config['insert_comment'] = (int)Context::get('insert_comment'); |
@@ -247,29 +266,40 @@ discard block |
||
247 | 266 | |
248 | 267 | // Get member infomation |
249 | 268 | $output = executeQueryArray('point.getMemberCount'); |
250 | - if(!$output->toBool()) return $output; |
|
269 | + if(!$output->toBool()) { |
|
270 | + return $output; |
|
271 | + } |
|
251 | 272 | |
252 | 273 | if($output->data) |
253 | 274 | { |
254 | 275 | foreach($output->data as $key => $val) |
255 | 276 | { |
256 | - if(!$val->member_srl) continue; |
|
277 | + if(!$val->member_srl) { |
|
278 | + continue; |
|
279 | + } |
|
257 | 280 | $member[$val->member_srl] = 0; |
258 | 281 | } |
259 | 282 | } |
260 | 283 | |
261 | 284 | // Get post information |
262 | 285 | $output = executeQueryArray('point.getDocumentPoint'); |
263 | - if(!$output->toBool()) return $output; |
|
286 | + if(!$output->toBool()) { |
|
287 | + return $output; |
|
288 | + } |
|
264 | 289 | |
265 | 290 | if($output->data) |
266 | 291 | { |
267 | 292 | foreach($output->data as $key => $val) |
268 | 293 | { |
269 | - if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
270 | - else $insert_point = $config->insert_document; |
|
294 | + if($module_config[$val->module_srl]['insert_document']) { |
|
295 | + $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
296 | + } else { |
|
297 | + $insert_point = $config->insert_document; |
|
298 | + } |
|
271 | 299 | |
272 | - if(!$val->member_srl) continue; |
|
300 | + if(!$val->member_srl) { |
|
301 | + continue; |
|
302 | + } |
|
273 | 303 | $point = $insert_point * $val->count; |
274 | 304 | $member[$val->member_srl] += $point; |
275 | 305 | } |
@@ -278,16 +308,23 @@ discard block |
||
278 | 308 | $output = null; |
279 | 309 | // Get comments information |
280 | 310 | $output = executeQueryArray('point.getCommentPoint'); |
281 | - if(!$output->toBool()) return $output; |
|
311 | + if(!$output->toBool()) { |
|
312 | + return $output; |
|
313 | + } |
|
282 | 314 | |
283 | 315 | if($output->data) |
284 | 316 | { |
285 | 317 | foreach($output->data as $key => $val) |
286 | 318 | { |
287 | - if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
288 | - else $insert_point = $config->insert_comment; |
|
319 | + if($module_config[$val->module_srl]['insert_comment']) { |
|
320 | + $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
321 | + } else { |
|
322 | + $insert_point = $config->insert_comment; |
|
323 | + } |
|
289 | 324 | |
290 | - if(!$val->member_srl) continue; |
|
325 | + if(!$val->member_srl) { |
|
326 | + continue; |
|
327 | + } |
|
291 | 328 | $point = $insert_point * $val->count; |
292 | 329 | $member[$val->member_srl] += $point; |
293 | 330 | } |
@@ -295,16 +332,23 @@ discard block |
||
295 | 332 | $output = null; |
296 | 333 | // Get the attached files' information |
297 | 334 | $output = executeQueryArray('point.getFilePoint'); |
298 | - if(!$output->toBool()) return $output; |
|
335 | + if(!$output->toBool()) { |
|
336 | + return $output; |
|
337 | + } |
|
299 | 338 | |
300 | 339 | if($output->data) |
301 | 340 | { |
302 | 341 | foreach($output->data as $key => $val) |
303 | 342 | { |
304 | - if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
305 | - else $insert_point = $config->upload_file; |
|
343 | + if($module_config[$val->module_srl]['upload_file']) { |
|
344 | + $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
345 | + } else { |
|
346 | + $insert_point = $config->upload_file; |
|
347 | + } |
|
306 | 348 | |
307 | - if(!$val->member_srl) continue; |
|
349 | + if(!$val->member_srl) { |
|
350 | + continue; |
|
351 | + } |
|
308 | 352 | $point = $insert_point * $val->count; |
309 | 353 | $member[$val->member_srl] += $point; |
310 | 354 | } |
@@ -312,7 +356,9 @@ discard block |
||
312 | 356 | $output = null; |
313 | 357 | // Set all members' points to 0 |
314 | 358 | $output = executeQuery("point.initMemberPoint"); |
315 | - if(!$output->toBool()) return $output; |
|
359 | + if(!$output->toBool()) { |
|
360 | + return $output; |
|
361 | + } |
|
316 | 362 | // Save the file temporarily |
317 | 363 | |
318 | 364 | $str = ''; |
@@ -337,7 +383,9 @@ discard block |
||
337 | 383 | $position = (int)Context::get('position'); |
338 | 384 | $total = (int)Context::get('total'); |
339 | 385 | |
340 | - if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
386 | + if(!file_exists('./files/cache/pointRecal.txt')) { |
|
387 | + return new Object(-1, 'msg_invalid_request'); |
|
388 | + } |
|
341 | 389 | |
342 | 390 | $idx = 0; |
343 | 391 | $f = fopen("./files/cache/pointRecal.txt","r"); |
@@ -353,7 +401,9 @@ discard block |
||
353 | 401 | $args->member_srl = $member_srl; |
354 | 402 | $args->point = $point; |
355 | 403 | $output = executeQuery('point.insertPoint',$args); |
356 | - if($idx%5000==0) break; |
|
404 | + if($idx%5000==0) { |
|
405 | + break; |
|
406 | + } |
|
357 | 407 | } |
358 | 408 | } |
359 | 409 | |
@@ -380,16 +430,23 @@ discard block |
||
380 | 430 | function procPointAdminReset() |
381 | 431 | { |
382 | 432 | $module_srl = Context::get('module_srls'); |
383 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
433 | + if(!$module_srl) { |
|
434 | + return new Object(-1, 'msg_invalid_request'); |
|
435 | + } |
|
384 | 436 | // In case of batch configuration of several modules |
385 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
386 | - else $module_srl = array($module_srl); |
|
437 | + if(preg_match('/^([0-9,]+)$/',$module_srl)) { |
|
438 | + $module_srl = explode(',',$module_srl); |
|
439 | + } else { |
|
440 | + $module_srl = array($module_srl); |
|
441 | + } |
|
387 | 442 | // Save configurations |
388 | 443 | $oModuleController = getController('module'); |
389 | 444 | for($i=0;$i<count($module_srl);$i++) |
390 | 445 | { |
391 | 446 | $srl = trim($module_srl[$i]); |
392 | - if(!$srl) continue; |
|
447 | + if(!$srl) { |
|
448 | + continue; |
|
449 | + } |
|
393 | 450 | $args = new stdClass(); |
394 | 451 | $args->module = 'point'; |
395 | 452 | $args->module_srl = $srl; |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | $args = Context::getRequestVars(); |
27 | 27 | |
28 | 28 | //if module IO config is off |
29 | - if($args->able_module == 'Y') |
|
29 | + if ($args->able_module == 'Y') |
|
30 | 30 | { |
31 | 31 | // Re-install triggers, if it was disabled. |
32 | - if($config->able_module == 'N') |
|
32 | + if ($config->able_module == 'N') |
|
33 | 33 | { |
34 | 34 | $this->moduleUpdate(); |
35 | 35 | } |
@@ -39,51 +39,51 @@ discard block |
||
39 | 39 | |
40 | 40 | // Check the point name |
41 | 41 | $config->point_name = $args->point_name; |
42 | - if(!$config->point_name) $config->point_name = 'point'; |
|
42 | + if (!$config->point_name) $config->point_name = 'point'; |
|
43 | 43 | // Specify the default points |
44 | - $config->signup_point = (int)$args->signup_point; |
|
45 | - $config->login_point = (int)$args->login_point; |
|
46 | - $config->insert_document = (int)$args->insert_document; |
|
47 | - $config->read_document = (int)$args->read_document; |
|
48 | - $config->insert_comment = (int)$args->insert_comment; |
|
49 | - $config->upload_file = (int)$args->upload_file; |
|
50 | - $config->download_file = (int)$args->download_file; |
|
51 | - $config->voted = (int)$args->voted; |
|
52 | - $config->blamed = (int)$args->blamed; |
|
44 | + $config->signup_point = (int) $args->signup_point; |
|
45 | + $config->login_point = (int) $args->login_point; |
|
46 | + $config->insert_document = (int) $args->insert_document; |
|
47 | + $config->read_document = (int) $args->read_document; |
|
48 | + $config->insert_comment = (int) $args->insert_comment; |
|
49 | + $config->upload_file = (int) $args->upload_file; |
|
50 | + $config->download_file = (int) $args->download_file; |
|
51 | + $config->voted = (int) $args->voted; |
|
52 | + $config->blamed = (int) $args->blamed; |
|
53 | 53 | // The highest level |
54 | 54 | $config->max_level = $args->max_level; |
55 | - if($config->max_level>1000) $config->max_level = 1000; |
|
56 | - if($config->max_level<1) $config->max_level = 1; |
|
55 | + if ($config->max_level > 1000) $config->max_level = 1000; |
|
56 | + if ($config->max_level < 1) $config->max_level = 1; |
|
57 | 57 | // Set the level icon |
58 | 58 | $config->level_icon = $args->level_icon; |
59 | 59 | // Check if downloads are not allowed |
60 | - if($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
60 | + if ($args->disable_download == 'Y') $config->disable_download = 'Y'; |
|
61 | 61 | else $config->disable_download = 'N'; |
62 | 62 | // Check if reading a document is not allowed |
63 | - if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
63 | + if ($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; |
|
64 | 64 | else $config->disable_read_document = 'N'; |
65 | 65 | |
66 | 66 | $oMemberModel = getModel('member'); |
67 | 67 | $group_list = $oMemberModel->getGroups(); |
68 | 68 | |
69 | 69 | // Per-level group configurations |
70 | - foreach($group_list as $group) |
|
70 | + foreach ($group_list as $group) |
|
71 | 71 | { |
72 | 72 | // Admin group should not be connected to point. |
73 | - if($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
73 | + if ($group->is_admin == 'Y' || $group->is_default == 'Y') continue; |
|
74 | 74 | |
75 | 75 | $group_srl = $group->group_srl; |
76 | 76 | |
77 | - if(isset($args->{'point_group_'.$group_srl})) |
|
77 | + if (isset($args->{'point_group_'.$group_srl})) |
|
78 | 78 | { |
79 | 79 | //if group level is higher than max level, change to max level |
80 | - if($args->{'point_group_'.$group_srl} > $args->max_level) |
|
80 | + if ($args->{'point_group_'.$group_srl} > $args->max_level) |
|
81 | 81 | { |
82 | 82 | $args->{'point_group_'.$group_srl} = $args->max_level; |
83 | 83 | } |
84 | 84 | |
85 | 85 | //if group level is lower than 1, change to 1 |
86 | - if($args->{'point_group_'.$group_srl} < 1) |
|
86 | + if ($args->{'point_group_'.$group_srl} < 1) |
|
87 | 87 | { |
88 | 88 | $args->{'point_group_'.$group_srl} = 1; |
89 | 89 | } |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $config->group_reset = $args->group_reset; |
99 | 99 | // Per-level point configurations |
100 | 100 | unset($config->level_step); |
101 | - for($i=1;$i<=$config->max_level;$i++) |
|
101 | + for ($i = 1; $i <= $config->max_level; $i++) |
|
102 | 102 | { |
103 | 103 | $key = "level_step_".$i; |
104 | - $config->level_step[$i] = (int)$args->{$key}; |
|
104 | + $config->level_step[$i] = (int) $args->{$key}; |
|
105 | 105 | } |
106 | 106 | // A function to calculate per-level points |
107 | 107 | $config->expression = $args->expression; |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | $args = Context::getRequestVars(); |
134 | 134 | |
135 | 135 | $configTypeList = array('insert_document', 'insert_comment', 'upload_file', 'download_file', 'read_document', 'voted', 'blamed'); |
136 | - foreach($configTypeList AS $config) |
|
136 | + foreach ($configTypeList AS $config) |
|
137 | 137 | { |
138 | - if(is_array($args->{$config})) |
|
138 | + if (is_array($args->{$config})) |
|
139 | 139 | { |
140 | - foreach($args->{$config} AS $key=>$value) |
|
140 | + foreach ($args->{$config} AS $key=>$value) |
|
141 | 141 | { |
142 | 142 | $module_config[$key][$config] = $value; |
143 | 143 | } |
@@ -145,16 +145,16 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | $oModuleController = getController('module'); |
148 | - if(count($module_config)) |
|
148 | + if (count($module_config)) |
|
149 | 149 | { |
150 | - foreach($module_config as $module_srl => $config) |
|
150 | + foreach ($module_config as $module_srl => $config) |
|
151 | 151 | { |
152 | - $oModuleController->insertModulePartConfig('point',$module_srl,$config); |
|
152 | + $oModuleController->insertModulePartConfig('point', $module_srl, $config); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->setMessage('success_updated'); |
157 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
157 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
158 | 158 | { |
159 | 159 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminModuleConfig'); |
160 | 160 | header('location:'.$returnUrl); |
@@ -168,24 +168,24 @@ discard block |
||
168 | 168 | function procPointAdminInsertPointModuleConfig() |
169 | 169 | { |
170 | 170 | $module_srl = Context::get('target_module_srl'); |
171 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
171 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
172 | 172 | // In case of batch configuration of several modules |
173 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
173 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl); |
|
174 | 174 | else $module_srl = array($module_srl); |
175 | 175 | // Save configurations |
176 | 176 | $oModuleController = getController('module'); |
177 | - for($i=0;$i<count($module_srl);$i++) |
|
177 | + for ($i = 0; $i < count($module_srl); $i++) |
|
178 | 178 | { |
179 | 179 | $srl = trim($module_srl[$i]); |
180 | - if(!$srl) continue; |
|
180 | + if (!$srl) continue; |
|
181 | 181 | unset($config); |
182 | - $config['insert_document'] = (int)Context::get('insert_document'); |
|
183 | - $config['insert_comment'] = (int)Context::get('insert_comment'); |
|
184 | - $config['upload_file'] = (int)Context::get('upload_file'); |
|
185 | - $config['download_file'] = (int)Context::get('download_file'); |
|
186 | - $config['read_document'] = (int)Context::get('read_document'); |
|
187 | - $config['voted'] = (int)Context::get('voted'); |
|
188 | - $config['blamed'] = (int)Context::get('blamed'); |
|
182 | + $config['insert_document'] = (int) Context::get('insert_document'); |
|
183 | + $config['insert_comment'] = (int) Context::get('insert_comment'); |
|
184 | + $config['upload_file'] = (int) Context::get('upload_file'); |
|
185 | + $config['download_file'] = (int) Context::get('download_file'); |
|
186 | + $config['read_document'] = (int) Context::get('read_document'); |
|
187 | + $config['voted'] = (int) Context::get('voted'); |
|
188 | + $config['blamed'] = (int) Context::get('blamed'); |
|
189 | 189 | $oModuleController->insertModulePartConfig('point', $srl, $config); |
190 | 190 | } |
191 | 191 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | preg_match('/^(\+|-)?([1-9][0-9]*)$/', $point, $m); |
208 | 208 | |
209 | 209 | $action = ''; |
210 | - switch($m[1]) |
|
210 | + switch ($m[1]) |
|
211 | 211 | { |
212 | 212 | case '+': |
213 | 213 | $action = 'add'; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $point = $m[2]; |
223 | 223 | |
224 | 224 | $oPointController = getController('point'); |
225 | - $output = $oPointController->setPoint($member_srl, (int)$point, $action); |
|
225 | + $output = $oPointController->setPoint($member_srl, (int) $point, $action); |
|
226 | 226 | |
227 | 227 | $this->setError(-1); |
228 | 228 | $this->setMessage('success_updated', 'info'); |
@@ -247,29 +247,29 @@ discard block |
||
247 | 247 | |
248 | 248 | // Get member infomation |
249 | 249 | $output = executeQueryArray('point.getMemberCount'); |
250 | - if(!$output->toBool()) return $output; |
|
250 | + if (!$output->toBool()) return $output; |
|
251 | 251 | |
252 | - if($output->data) |
|
252 | + if ($output->data) |
|
253 | 253 | { |
254 | - foreach($output->data as $key => $val) |
|
254 | + foreach ($output->data as $key => $val) |
|
255 | 255 | { |
256 | - if(!$val->member_srl) continue; |
|
256 | + if (!$val->member_srl) continue; |
|
257 | 257 | $member[$val->member_srl] = 0; |
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | 261 | // Get post information |
262 | 262 | $output = executeQueryArray('point.getDocumentPoint'); |
263 | - if(!$output->toBool()) return $output; |
|
263 | + if (!$output->toBool()) return $output; |
|
264 | 264 | |
265 | - if($output->data) |
|
265 | + if ($output->data) |
|
266 | 266 | { |
267 | - foreach($output->data as $key => $val) |
|
267 | + foreach ($output->data as $key => $val) |
|
268 | 268 | { |
269 | - if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
269 | + if ($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; |
|
270 | 270 | else $insert_point = $config->insert_document; |
271 | 271 | |
272 | - if(!$val->member_srl) continue; |
|
272 | + if (!$val->member_srl) continue; |
|
273 | 273 | $point = $insert_point * $val->count; |
274 | 274 | $member[$val->member_srl] += $point; |
275 | 275 | } |
@@ -278,16 +278,16 @@ discard block |
||
278 | 278 | $output = null; |
279 | 279 | // Get comments information |
280 | 280 | $output = executeQueryArray('point.getCommentPoint'); |
281 | - if(!$output->toBool()) return $output; |
|
281 | + if (!$output->toBool()) return $output; |
|
282 | 282 | |
283 | - if($output->data) |
|
283 | + if ($output->data) |
|
284 | 284 | { |
285 | - foreach($output->data as $key => $val) |
|
285 | + foreach ($output->data as $key => $val) |
|
286 | 286 | { |
287 | - if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
287 | + if ($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; |
|
288 | 288 | else $insert_point = $config->insert_comment; |
289 | 289 | |
290 | - if(!$val->member_srl) continue; |
|
290 | + if (!$val->member_srl) continue; |
|
291 | 291 | $point = $insert_point * $val->count; |
292 | 292 | $member[$val->member_srl] += $point; |
293 | 293 | } |
@@ -295,16 +295,16 @@ discard block |
||
295 | 295 | $output = null; |
296 | 296 | // Get the attached files' information |
297 | 297 | $output = executeQueryArray('point.getFilePoint'); |
298 | - if(!$output->toBool()) return $output; |
|
298 | + if (!$output->toBool()) return $output; |
|
299 | 299 | |
300 | - if($output->data) |
|
300 | + if ($output->data) |
|
301 | 301 | { |
302 | - foreach($output->data as $key => $val) |
|
302 | + foreach ($output->data as $key => $val) |
|
303 | 303 | { |
304 | - if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
304 | + if ($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; |
|
305 | 305 | else $insert_point = $config->upload_file; |
306 | 306 | |
307 | - if(!$val->member_srl) continue; |
|
307 | + if (!$val->member_srl) continue; |
|
308 | 308 | $point = $insert_point * $val->count; |
309 | 309 | $member[$val->member_srl] += $point; |
310 | 310 | } |
@@ -312,13 +312,13 @@ discard block |
||
312 | 312 | $output = null; |
313 | 313 | // Set all members' points to 0 |
314 | 314 | $output = executeQuery("point.initMemberPoint"); |
315 | - if(!$output->toBool()) return $output; |
|
315 | + if (!$output->toBool()) return $output; |
|
316 | 316 | // Save the file temporarily |
317 | 317 | |
318 | 318 | $str = ''; |
319 | - foreach($member as $key => $val) |
|
319 | + foreach ($member as $key => $val) |
|
320 | 320 | { |
321 | - $val += (int)$config->signup_point; |
|
321 | + $val += (int) $config->signup_point; |
|
322 | 322 | $str .= $key.','.$val."\r\n"; |
323 | 323 | } |
324 | 324 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | $this->add('total', count($member)); |
328 | 328 | $this->add('position', 0); |
329 | - $this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) ); |
|
329 | + $this->setMessage(sprintf(Context::getLang('point_recal_message'), 0, $this->get('total'))); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -334,35 +334,35 @@ discard block |
||
334 | 334 | */ |
335 | 335 | function procPointAdminApplyPoint() |
336 | 336 | { |
337 | - $position = (int)Context::get('position'); |
|
338 | - $total = (int)Context::get('total'); |
|
337 | + $position = (int) Context::get('position'); |
|
338 | + $total = (int) Context::get('total'); |
|
339 | 339 | |
340 | - if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
340 | + if (!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); |
|
341 | 341 | |
342 | 342 | $idx = 0; |
343 | - $f = fopen("./files/cache/pointRecal.txt","r"); |
|
344 | - while(!feof($f)) |
|
343 | + $f = fopen("./files/cache/pointRecal.txt", "r"); |
|
344 | + while (!feof($f)) |
|
345 | 345 | { |
346 | 346 | $str = trim(fgets($f, 1024)); |
347 | - $idx ++; |
|
348 | - if($idx > $position) |
|
347 | + $idx++; |
|
348 | + if ($idx > $position) |
|
349 | 349 | { |
350 | - list($member_srl, $point) = explode(',',$str); |
|
350 | + list($member_srl, $point) = explode(',', $str); |
|
351 | 351 | |
352 | 352 | $args = new stdClass(); |
353 | 353 | $args->member_srl = $member_srl; |
354 | 354 | $args->point = $point; |
355 | - $output = executeQuery('point.insertPoint',$args); |
|
356 | - if($idx%5000==0) break; |
|
355 | + $output = executeQuery('point.insertPoint', $args); |
|
356 | + if ($idx % 5000 == 0) break; |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | - if(feof($f)) |
|
360 | + if (feof($f)) |
|
361 | 361 | { |
362 | 362 | FileHandler::removeFile('./files/cache/pointRecal.txt'); |
363 | 363 | $idx = $total; |
364 | 364 | |
365 | - FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old'); |
|
365 | + FileHandler::rename('./files/member_extra_info/point', './files/member_extra_info/point.old'); |
|
366 | 366 | |
367 | 367 | FileHandler::removeDir('./files/member_extra_info/point.old'); |
368 | 368 | } |
@@ -380,16 +380,16 @@ discard block |
||
380 | 380 | function procPointAdminReset() |
381 | 381 | { |
382 | 382 | $module_srl = Context::get('module_srls'); |
383 | - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
383 | + if (!$module_srl) return new Object(-1, 'msg_invalid_request'); |
|
384 | 384 | // In case of batch configuration of several modules |
385 | - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); |
|
385 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl); |
|
386 | 386 | else $module_srl = array($module_srl); |
387 | 387 | // Save configurations |
388 | 388 | $oModuleController = getController('module'); |
389 | - for($i=0;$i<count($module_srl);$i++) |
|
389 | + for ($i = 0; $i < count($module_srl); $i++) |
|
390 | 390 | { |
391 | 391 | $srl = trim($module_srl[$i]); |
392 | - if(!$srl) continue; |
|
392 | + if (!$srl) continue; |
|
393 | 393 | $args = new stdClass(); |
394 | 394 | $args->module = 'point'; |
395 | 395 | $args->module_srl = $srl; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | |
399 | 399 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
400 | - if($oCacheHandler->isSupport()) |
|
400 | + if ($oCacheHandler->isSupport()) |
|
401 | 401 | { |
402 | 402 | $oCacheHandler->invalidateGroupKey('site_and_module'); |
403 | 403 | } |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $config->able_module = 'N'; |
25 | 25 | $config->max_level = 30; |
26 | 26 | // Per-level score |
27 | - for($i=1;$i<=30;$i++) |
|
27 | + for ($i = 1; $i <= 30; $i++) |
|
28 | 28 | { |
29 | - $config->level_step[$i] = pow($i,2)*90; |
|
29 | + $config->level_step[$i] = pow($i, 2) * 90; |
|
30 | 30 | } |
31 | 31 | // Points for registration |
32 | 32 | $config->signup_point = 10; |
@@ -84,29 +84,29 @@ discard block |
||
84 | 84 | |
85 | 85 | $config = $oModuleModel->getModuleConfig('point'); |
86 | 86 | // check if module is abled |
87 | - if($config->able_module != 'N') |
|
87 | + if ($config->able_module != 'N') |
|
88 | 88 | { |
89 | 89 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
90 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
90 | + if (!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | + if (!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | + if (!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | + if (!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | + if (!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
103 | 103 | // Add a trigger for voting up and down 2008.05.13 haneul |
104 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
104 | + if (!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
105 | 105 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
106 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
106 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
107 | 107 | |
108 | 108 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
109 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
109 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return false; |
@@ -121,40 +121,40 @@ discard block |
||
121 | 121 | $oModuleModel = getModel('module'); |
122 | 122 | $oModuleController = getController('module'); |
123 | 123 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
124 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
124 | + if (!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
125 | 125 | $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
126 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
126 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
127 | 127 | $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
128 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
128 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
129 | 129 | $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
130 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
130 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
131 | 131 | $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
132 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
132 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
133 | 133 | $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
134 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
134 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
135 | 135 | $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
136 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
136 | + if (!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
137 | 137 | $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
138 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
138 | + if (!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
139 | 139 | $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
140 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
140 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
141 | 141 | $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
142 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
142 | + if (!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
143 | 143 | $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
144 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
144 | + if (!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
145 | 145 | $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
146 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
146 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
147 | 147 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
148 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
148 | + if (!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
149 | 149 | $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
150 | 150 | // Add a trigger for voting up and down 2008.05.13 haneul |
151 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
151 | + if (!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
152 | 152 | $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
153 | 153 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
154 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
154 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
155 | 155 | $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
156 | 156 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
157 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
|
157 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
|
158 | 158 | { |
159 | 159 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after'); |
160 | 160 | } |
@@ -87,26 +87,58 @@ discard block |
||
87 | 87 | if($config->able_module != 'N') |
88 | 88 | { |
89 | 89 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
90 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; |
|
91 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; |
|
92 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; |
|
93 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; |
|
94 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; |
|
95 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; |
|
96 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; |
|
97 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; |
|
98 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; |
|
99 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; |
|
100 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; |
|
101 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; |
|
102 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; |
|
90 | + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) { |
|
91 | + return true; |
|
92 | + } |
|
93 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) { |
|
94 | + return true; |
|
95 | + } |
|
96 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) { |
|
97 | + return true; |
|
98 | + } |
|
99 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) { |
|
100 | + return true; |
|
101 | + } |
|
102 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) { |
|
103 | + return true; |
|
104 | + } |
|
105 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) { |
|
106 | + return true; |
|
107 | + } |
|
108 | + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) { |
|
109 | + return true; |
|
110 | + } |
|
111 | + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) { |
|
112 | + return true; |
|
113 | + } |
|
114 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) { |
|
115 | + return true; |
|
116 | + } |
|
117 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) { |
|
118 | + return true; |
|
119 | + } |
|
120 | + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) { |
|
121 | + return true; |
|
122 | + } |
|
123 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) { |
|
124 | + return true; |
|
125 | + } |
|
126 | + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) { |
|
127 | + return true; |
|
128 | + } |
|
103 | 129 | // Add a trigger for voting up and down 2008.05.13 haneul |
104 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; |
|
130 | + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) { |
|
131 | + return true; |
|
132 | + } |
|
105 | 133 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
106 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; |
|
134 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) { |
|
135 | + return true; |
|
136 | + } |
|
107 | 137 | |
108 | 138 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
109 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true; |
|
139 | + if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) { |
|
140 | + return true; |
|
141 | + } |
|
110 | 142 | } |
111 | 143 | |
112 | 144 | return false; |
@@ -121,38 +153,53 @@ discard block |
||
121 | 153 | $oModuleModel = getModel('module'); |
122 | 154 | $oModuleController = getController('module'); |
123 | 155 | // Add a trigger for registration/insert document/insert comment/upload a file/download |
124 | - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) |
|
125 | - $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
|
126 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) |
|
127 | - $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
|
128 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) |
|
129 | - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
|
130 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) |
|
131 | - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
|
132 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) |
|
133 | - $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
|
134 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) |
|
135 | - $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
|
136 | - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) |
|
137 | - $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
|
138 | - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) |
|
139 | - $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
|
140 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) |
|
141 | - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
|
142 | - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) |
|
143 | - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
|
144 | - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) |
|
145 | - $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
|
146 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) |
|
147 | - $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
|
148 | - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) |
|
149 | - $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
|
156 | + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) { |
|
157 | + $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); |
|
158 | + } |
|
159 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) { |
|
160 | + $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); |
|
161 | + } |
|
162 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) { |
|
163 | + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); |
|
164 | + } |
|
165 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) { |
|
166 | + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); |
|
167 | + } |
|
168 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) { |
|
169 | + $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); |
|
170 | + } |
|
171 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) { |
|
172 | + $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); |
|
173 | + } |
|
174 | + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) { |
|
175 | + $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); |
|
176 | + } |
|
177 | + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) { |
|
178 | + $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); |
|
179 | + } |
|
180 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) { |
|
181 | + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); |
|
182 | + } |
|
183 | + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) { |
|
184 | + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); |
|
185 | + } |
|
186 | + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) { |
|
187 | + $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); |
|
188 | + } |
|
189 | + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) { |
|
190 | + $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); |
|
191 | + } |
|
192 | + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) { |
|
193 | + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); |
|
194 | + } |
|
150 | 195 | // Add a trigger for voting up and down 2008.05.13 haneul |
151 | - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) |
|
152 | - $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
|
196 | + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) { |
|
197 | + $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); |
|
198 | + } |
|
153 | 199 | // Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero |
154 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) |
|
155 | - $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
|
200 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) { |
|
201 | + $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); |
|
202 | + } |
|
156 | 203 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
157 | 204 | if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) |
158 | 205 | { |
@@ -24,15 +24,18 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if($this->pointList[$member_srl]) { |
|
28 | + return true; |
|
29 | + } |
|
28 | 30 | |
29 | 31 | // Get from file cache |
30 | 32 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
31 | 33 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | 34 | if(file_exists($cache_filename)) |
33 | 35 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
35 | - $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
36 | + if(!$this->pointList[$member_srl]) { |
|
37 | + $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
38 | + } |
|
36 | 39 | return true; |
37 | 40 | } |
38 | 41 | |
@@ -60,14 +63,17 @@ discard block |
||
60 | 63 | $member_srl = abs($member_srl); |
61 | 64 | |
62 | 65 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
66 | + if(!$from_db && $this->pointList[$member_srl]) { |
|
67 | + return $this->pointList[$member_srl]; |
|
68 | + } |
|
64 | 69 | |
65 | 70 | // Get from file cache |
66 | 71 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
67 | 72 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 73 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
70 | - return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
74 | + if(!$from_db && file_exists($cache_filename)) { |
|
75 | + return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
76 | + } |
|
71 | 77 | |
72 | 78 | // Get from the DB |
73 | 79 | $args =new stdClass(); |
@@ -78,7 +84,9 @@ discard block |
||
78 | 84 | { |
79 | 85 | $point = (int)$output->data->point; |
80 | 86 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
87 | + if(!is_dir($path)) { |
|
88 | + FileHandler::makeDir($path); |
|
89 | + } |
|
82 | 90 | FileHandler::writeFile($cache_filename, $point); |
83 | 91 | return $point; |
84 | 92 | } |
@@ -91,7 +99,9 @@ discard block |
||
91 | 99 | function getLevel($point, $level_step) |
92 | 100 | { |
93 | 101 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
102 | + for($level=0;$level<=$level_count;$level++) { |
|
103 | + if($point < $level_step[$level]) break; |
|
104 | + } |
|
95 | 105 | $level --; |
96 | 106 | return $level; |
97 | 107 | } |
@@ -100,7 +110,9 @@ discard block |
||
100 | 110 | { |
101 | 111 | $member_srls = Context::get('member_srls'); |
102 | 112 | $member_srls = explode(',',$member_srls); |
103 | - if(count($member_srls)==0) return; |
|
113 | + if(count($member_srls)==0) { |
|
114 | + return; |
|
115 | + } |
|
104 | 116 | array_unique($member_srls); |
105 | 117 | |
106 | 118 | $oModuleModel = getModel('module'); |
@@ -144,19 +156,27 @@ discard block |
||
144 | 156 | switch($search_target) |
145 | 157 | { |
146 | 158 | case 'user_id' : |
147 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
159 | + if($search_keyword) { |
|
160 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
161 | + } |
|
148 | 162 | $args->s_user_id = $search_keyword; |
149 | 163 | break; |
150 | 164 | case 'user_name' : |
151 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
165 | + if($search_keyword) { |
|
166 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
167 | + } |
|
152 | 168 | $args->s_user_name = $search_keyword; |
153 | 169 | break; |
154 | 170 | case 'nick_name' : |
155 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
171 | + if($search_keyword) { |
|
172 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
173 | + } |
|
156 | 174 | $args->s_nick_name = $search_keyword; |
157 | 175 | break; |
158 | 176 | case 'email_address' : |
159 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
177 | + if($search_keyword) { |
|
178 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
179 | + } |
|
160 | 180 | $args->s_email_address = $search_keyword; |
161 | 181 | break; |
162 | 182 | case 'regdate' : |
@@ -174,8 +194,7 @@ discard block |
||
174 | 194 | if($args->selected_group_srl) |
175 | 195 | { |
176 | 196 | $query_id = 'point.getMemberListWithinGroup'; |
177 | - } |
|
178 | - else |
|
197 | + } else |
|
179 | 198 | { |
180 | 199 | $query_id = 'point.getMemberList'; |
181 | 200 | } |
@@ -24,28 +24,28 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if ($this->pointList[$member_srl]) return true; |
|
28 | 28 | |
29 | 29 | // Get from file cache |
30 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
30 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
31 | 31 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | - if(file_exists($cache_filename)) |
|
32 | + if (file_exists($cache_filename)) |
|
33 | 33 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
34 | + if (!$this->pointList[$member_srl]) |
|
35 | 35 | $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
36 | 36 | return true; |
37 | 37 | } |
38 | 38 | |
39 | - $args =new stdClass(); |
|
39 | + $args = new stdClass(); |
|
40 | 40 | $args->member_srl = $member_srl; |
41 | 41 | $output = executeQuery('point.getPoint', $args); |
42 | - if($output->data->member_srl == $member_srl) |
|
42 | + if ($output->data->member_srl == $member_srl) |
|
43 | 43 | { |
44 | - if(!$this->pointList[$member_srl]) |
|
44 | + if (!$this->pointList[$member_srl]) |
|
45 | 45 | { |
46 | - $this->pointList[$member_srl] = (int)$output->data->point; |
|
46 | + $this->pointList[$member_srl] = (int) $output->data->point; |
|
47 | 47 | FileHandler::makeDir($path); |
48 | - FileHandler::writeFile($cache_filename, (int)$output->data->point); |
|
48 | + FileHandler::writeFile($cache_filename, (int) $output->data->point); |
|
49 | 49 | } |
50 | 50 | return true; |
51 | 51 | } |
@@ -60,25 +60,25 @@ discard block |
||
60 | 60 | $member_srl = abs($member_srl); |
61 | 61 | |
62 | 62 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
63 | + if (!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
64 | 64 | |
65 | 65 | // Get from file cache |
66 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
66 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
67 | 67 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 68 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
69 | + if (!$from_db && file_exists($cache_filename)) |
|
70 | 70 | return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
71 | 71 | |
72 | 72 | // Get from the DB |
73 | - $args =new stdClass(); |
|
73 | + $args = new stdClass(); |
|
74 | 74 | $args->member_srl = $member_srl; |
75 | 75 | $output = executeQuery('point.getPoint', $args); |
76 | 76 | |
77 | - if(isset($output->data->member_srl)) |
|
77 | + if (isset($output->data->member_srl)) |
|
78 | 78 | { |
79 | - $point = (int)$output->data->point; |
|
79 | + $point = (int) $output->data->point; |
|
80 | 80 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
81 | + if (!is_dir($path)) FileHandler::makeDir($path); |
|
82 | 82 | FileHandler::writeFile($cache_filename, $point); |
83 | 83 | return $point; |
84 | 84 | } |
@@ -91,23 +91,23 @@ discard block |
||
91 | 91 | function getLevel($point, $level_step) |
92 | 92 | { |
93 | 93 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
95 | - $level --; |
|
94 | + for ($level = 0; $level <= $level_count; $level++) if ($point < $level_step[$level]) break; |
|
95 | + $level--; |
|
96 | 96 | return $level; |
97 | 97 | } |
98 | 98 | |
99 | 99 | function getMembersPointInfo() |
100 | 100 | { |
101 | 101 | $member_srls = Context::get('member_srls'); |
102 | - $member_srls = explode(',',$member_srls); |
|
103 | - if(count($member_srls)==0) return; |
|
102 | + $member_srls = explode(',', $member_srls); |
|
103 | + if (count($member_srls) == 0) return; |
|
104 | 104 | array_unique($member_srls); |
105 | 105 | |
106 | 106 | $oModuleModel = getModel('module'); |
107 | 107 | $config = $oModuleModel->getModuleConfig('point'); |
108 | 108 | |
109 | 109 | $info = array(); |
110 | - foreach($member_srls as $v) |
|
110 | + foreach ($member_srls as $v) |
|
111 | 111 | { |
112 | 112 | $obj = new stdClass; |
113 | 113 | $obj->point = $this->getPoint($v); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $info[] = $obj; |
117 | 117 | } |
118 | 118 | |
119 | - $this->add('point_info',$info); |
|
119 | + $this->add('point_info', $info); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -126,37 +126,37 @@ discard block |
||
126 | 126 | function getMemberList($args = null, $columnList = array()) |
127 | 127 | { |
128 | 128 | // Arrange the search options |
129 | - $args->is_admin = Context::get('is_admin')=='Y'?'Y':''; |
|
130 | - $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; |
|
129 | + $args->is_admin = Context::get('is_admin') == 'Y' ? 'Y' : ''; |
|
130 | + $args->is_denied = Context::get('is_denied') == 'Y' ? 'Y' : ''; |
|
131 | 131 | $args->selected_group_srl = Context::get('selected_group_srl'); |
132 | 132 | |
133 | 133 | $search_target = trim(Context::get('search_target')); |
134 | 134 | $search_keyword = trim(Context::get('search_keyword')); |
135 | 135 | |
136 | 136 | // if search keyword is emtpy, show all list |
137 | - if(!$search_keyword) |
|
137 | + if (!$search_keyword) |
|
138 | 138 | { |
139 | 139 | unset($args->is_admin, $args->is_denied, $args->selected_group_srl, $search_target); |
140 | 140 | } |
141 | 141 | |
142 | - if($search_target && $search_keyword) |
|
142 | + if ($search_target && $search_keyword) |
|
143 | 143 | { |
144 | - switch($search_target) |
|
144 | + switch ($search_target) |
|
145 | 145 | { |
146 | 146 | case 'user_id' : |
147 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
147 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
148 | 148 | $args->s_user_id = $search_keyword; |
149 | 149 | break; |
150 | 150 | case 'user_name' : |
151 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
151 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
152 | 152 | $args->s_user_name = $search_keyword; |
153 | 153 | break; |
154 | 154 | case 'nick_name' : |
155 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
155 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
156 | 156 | $args->s_nick_name = $search_keyword; |
157 | 157 | break; |
158 | 158 | case 'email_address' : |
159 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
159 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
160 | 160 | $args->s_email_address = $search_keyword; |
161 | 161 | break; |
162 | 162 | case 'regdate' : |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | // If there is a selected_group_srl, change the "query id" (for table join) |
174 | - if($args->selected_group_srl) |
|
174 | + if ($args->selected_group_srl) |
|
175 | 175 | { |
176 | 176 | $query_id = 'point.getMemberListWithinGroup'; |
177 | 177 | } |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | |
183 | 183 | $output = executeQuery($query_id, $args, $columnList); |
184 | 184 | |
185 | - if($output->total_count) |
|
185 | + if ($output->total_count) |
|
186 | 186 | { |
187 | 187 | $oModuleModel = getModel('module'); |
188 | 188 | $config = $oModuleModel->getModuleConfig('point'); |
189 | 189 | |
190 | - foreach($output->data as $key => $val) |
|
190 | + foreach ($output->data as $key => $val) |
|
191 | 191 | { |
192 | 192 | $output->data[$key]->level = $this->getLevel($val->point, $config->level_step); |
193 | 193 | } |
@@ -30,7 +30,9 @@ |
||
30 | 30 | { |
31 | 31 | $current_module_info = Context::get('current_module_info'); |
32 | 32 | $current_module_srl = $current_module_info->module_srl; |
33 | - if(!$current_module_srl) return new Object(); |
|
33 | + if(!$current_module_srl) { |
|
34 | + return new Object(); |
|
35 | + } |
|
34 | 36 | } |
35 | 37 | // Get the configuration information |
36 | 38 | $oModuleModel = getModel('module'); |
@@ -26,20 +26,20 @@ |
||
26 | 26 | $current_module_srl = Context::get('module_srl'); |
27 | 27 | $current_module_srls = Context::get('module_srls'); |
28 | 28 | |
29 | - if(!$current_module_srl && !$current_module_srls) |
|
29 | + if (!$current_module_srl && !$current_module_srls) |
|
30 | 30 | { |
31 | 31 | $current_module_info = Context::get('current_module_info'); |
32 | 32 | $current_module_srl = $current_module_info->module_srl; |
33 | - if(!$current_module_srl) return new Object(); |
|
33 | + if (!$current_module_srl) return new Object(); |
|
34 | 34 | } |
35 | 35 | // Get the configuration information |
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | $config = $oModuleModel->getModuleConfig('point'); |
38 | 38 | |
39 | - if($current_module_srl) |
|
39 | + if ($current_module_srl) |
|
40 | 40 | { |
41 | 41 | $module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl); |
42 | - if(!$module_config) |
|
42 | + if (!$module_config) |
|
43 | 43 | { |
44 | 44 | $module_config['insert_document'] = $config->insert_document; |
45 | 45 | $module_config['insert_comment'] = $config->insert_comment; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | function getPollList($args) |
21 | 21 | { |
22 | 22 | $output = executeQueryArray('poll.getPollList', $args); |
23 | - if(!$output->toBool()) return $output; |
|
23 | + if (!$output->toBool()) return $output; |
|
24 | 24 | |
25 | 25 | //if($output->data && !is_array($output->data)) $output->data = array($output->data); |
26 | 26 | return $output; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | function getPollListWithMember($args) |
33 | 33 | { |
34 | 34 | $output = executeQueryArray('poll.getPollListWithMember', $args); |
35 | - if(!$output->toBool()) return $output; |
|
35 | + if (!$output->toBool()) return $output; |
|
36 | 36 | |
37 | 37 | return $output; |
38 | 38 | } |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
52 | 52 | |
53 | - if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
53 | + if (!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
54 | 54 | |
55 | - if($oComment && $oComment->isExists()) |
|
55 | + if ($oComment && $oComment->isExists()) |
|
56 | 56 | { |
57 | 57 | $this->add('document_srl', $oComment->get('document_srl')); |
58 | 58 | $this->add('comment_srl', $oComment->get('comment_srl')); |
59 | 59 | } |
60 | - elseif($oDocument->isExists()) |
|
60 | + elseif ($oDocument->isExists()) |
|
61 | 61 | { |
62 | 62 | $this->add('document_srl', $oDocument->get('document_srl')); |
63 | 63 | } |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | function getPollList($args) |
21 | 21 | { |
22 | 22 | $output = executeQueryArray('poll.getPollList', $args); |
23 | - if(!$output->toBool()) return $output; |
|
23 | + if(!$output->toBool()) { |
|
24 | + return $output; |
|
25 | + } |
|
24 | 26 | |
25 | 27 | //if($output->data && !is_array($output->data)) $output->data = array($output->data); |
26 | 28 | return $output; |
@@ -32,7 +34,9 @@ discard block |
||
32 | 34 | function getPollListWithMember($args) |
33 | 35 | { |
34 | 36 | $output = executeQueryArray('poll.getPollListWithMember', $args); |
35 | - if(!$output->toBool()) return $output; |
|
37 | + if(!$output->toBool()) { |
|
38 | + return $output; |
|
39 | + } |
|
36 | 40 | |
37 | 41 | return $output; |
38 | 42 | } |
@@ -50,18 +54,20 @@ discard block |
||
50 | 54 | |
51 | 55 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
52 | 56 | |
53 | - if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); |
|
57 | + if(!$oDocument->isExists()) { |
|
58 | + $oComment = $oCommentModel->getComment($upload_target_srl); |
|
59 | + } |
|
54 | 60 | |
55 | 61 | if($oComment && $oComment->isExists()) |
56 | 62 | { |
57 | 63 | $this->add('document_srl', $oComment->get('document_srl')); |
58 | 64 | $this->add('comment_srl', $oComment->get('comment_srl')); |
59 | - } |
|
60 | - elseif($oDocument->isExists()) |
|
65 | + } elseif($oDocument->isExists()) |
|
61 | 66 | { |
62 | 67 | $this->add('document_srl', $oDocument->get('document_srl')); |
68 | + } else { |
|
69 | + return new Object(-1, 'msg_not_founded'); |
|
63 | 70 | } |
64 | - else return new Object(-1, 'msg_not_founded'); |
|
65 | 71 | } |
66 | 72 | } |
67 | 73 | /* End of file poll.admin.model.php */ |
@@ -29,7 +29,9 @@ discard block |
||
29 | 29 | switch($search_target) |
30 | 30 | { |
31 | 31 | case 'title' : |
32 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
32 | + if($search_keyword) { |
|
33 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
34 | + } |
|
33 | 35 | $args->s_title= $search_keyword; |
34 | 36 | break; |
35 | 37 | case 'regdate' : |
@@ -62,17 +64,22 @@ discard block |
||
62 | 64 | |
63 | 65 | $oDocumentModel = getModel('document'); |
64 | 66 | $targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList); |
65 | - if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
67 | + if(!is_array($targetDocumentOutput)) { |
|
68 | + $targetDocumentOutput = array(); |
|
69 | + } |
|
66 | 70 | |
67 | 71 | $oCommentModel = getModel('comment'); |
68 | 72 | $columnList = array('comment_srl', 'document_srl'); |
69 | 73 | $targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList); |
70 | - if(!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
74 | + if(!is_array($targetCommentOutput)) { |
|
75 | + $targetCommentOutput = array(); |
|
76 | + } |
|
71 | 77 | |
72 | 78 | foreach($output->data as $value) |
73 | 79 | { |
74 | - if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
75 | - $value->document_srl = $value->upload_target_srl; |
|
80 | + if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) { |
|
81 | + $value->document_srl = $value->upload_target_srl; |
|
82 | + } |
|
76 | 83 | |
77 | 84 | if(array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
78 | 85 | { |
@@ -110,7 +117,9 @@ discard block |
||
110 | 117 | $skin_list = $oModuleModel->getSkins($this->module_path); |
111 | 118 | Context::set('skin_list', $skin_list); |
112 | 119 | |
113 | - if(!$skin_list[$config->skin]) $config->skin = "default"; |
|
120 | + if(!$skin_list[$config->skin]) { |
|
121 | + $config->skin = "default"; |
|
122 | + } |
|
114 | 123 | // Set the skin colorset once the configurations is completed |
115 | 124 | Context::set('colorset_list', $skin_list[$config->skin]->colorset); |
116 | 125 | |
@@ -137,7 +146,9 @@ discard block |
||
137 | 146 | $args->poll_index_srl = Context::get('poll_index_srl'); |
138 | 147 | |
139 | 148 | $output = executeQuery('poll.getPoll', $args); |
140 | - if(!$output->data) return $this->stop('msg_poll_not_exists'); |
|
149 | + if(!$output->data) { |
|
150 | + return $this->stop('msg_poll_not_exists'); |
|
151 | + } |
|
141 | 152 | |
142 | 153 | $poll = new stdClass(); |
143 | 154 | $poll->stop_date = $output->data->stop_date; |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | $search_keyword = trim(Context::get('search_keyword')); |
25 | 25 | |
26 | 26 | $args = new stdClass(); |
27 | - if($search_target && $search_keyword) |
|
27 | + if ($search_target && $search_keyword) |
|
28 | 28 | { |
29 | - switch($search_target) |
|
29 | + switch ($search_target) |
|
30 | 30 | { |
31 | 31 | case 'title' : |
32 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
33 | - $args->s_title= $search_keyword; |
|
32 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
33 | + $args->s_title = $search_keyword; |
|
34 | 34 | break; |
35 | 35 | case 'regdate' : |
36 | 36 | $args->s_regdate = $search_keyword; |
37 | 37 | break; |
38 | 38 | case 'ipaddress' : |
39 | - $args->s_ipaddress= $search_keyword; |
|
39 | + $args->s_ipaddress = $search_keyword; |
|
40 | 40 | break; |
41 | 41 | } |
42 | 42 | } |
@@ -52,29 +52,29 @@ discard block |
||
52 | 52 | $output = $oPollAdminModel->getPollListWithMember($args); |
53 | 53 | |
54 | 54 | // check poll type. document or comment |
55 | - if(is_array($output->data)) |
|
55 | + if (is_array($output->data)) |
|
56 | 56 | { |
57 | 57 | $uploadTargetSrlList = array(); |
58 | - foreach($output->data as $value) |
|
58 | + foreach ($output->data as $value) |
|
59 | 59 | { |
60 | 60 | $uploadTargetSrlList[] = $value->upload_target_srl; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $oDocumentModel = getModel('document'); |
64 | 64 | $targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList); |
65 | - if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
65 | + if (!is_array($targetDocumentOutput)) $targetDocumentOutput = array(); |
|
66 | 66 | |
67 | 67 | $oCommentModel = getModel('comment'); |
68 | 68 | $columnList = array('comment_srl', 'document_srl'); |
69 | 69 | $targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList); |
70 | - if(!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
70 | + if (!is_array($targetCommentOutput)) $targetCommentOutput = array(); |
|
71 | 71 | |
72 | - foreach($output->data as $value) |
|
72 | + foreach ($output->data as $value) |
|
73 | 73 | { |
74 | - if(array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
74 | + if (array_key_exists($value->upload_target_srl, $targetDocumentOutput)) |
|
75 | 75 | $value->document_srl = $value->upload_target_srl; |
76 | 76 | |
77 | - if(array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
|
77 | + if (array_key_exists($value->upload_target_srl, $targetCommentOutput)) |
|
78 | 78 | { |
79 | 79 | $value->comment_srl = $value->upload_target_srl; |
80 | 80 | $value->document_srl = $targetCommentOutput[$value->comment_srl]->document_srl; |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | $skin_list = $oModuleModel->getSkins($this->module_path); |
111 | 111 | Context::set('skin_list', $skin_list); |
112 | 112 | |
113 | - if(!$skin_list[$config->skin]) $config->skin = "default"; |
|
113 | + if (!$skin_list[$config->skin]) $config->skin = "default"; |
|
114 | 114 | // Set the skin colorset once the configurations is completed |
115 | 115 | Context::set('colorset_list', $skin_list[$config->skin]->colorset); |
116 | 116 | |
117 | 117 | $security = new Security(); |
118 | 118 | $security->encodeHTML('config..'); |
119 | 119 | $security->encodeHTML('skin_list..title'); |
120 | - $security->encodeHTML('colorset_list..name','colorset_list..title'); |
|
120 | + $security->encodeHTML('colorset_list..name', 'colorset_list..title'); |
|
121 | 121 | |
122 | 122 | // Set a template |
123 | 123 | $this->setTemplatePath($this->module_path.'tpl'); |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | $args->poll_index_srl = Context::get('poll_index_srl'); |
138 | 138 | |
139 | 139 | $output = executeQuery('poll.getPoll', $args); |
140 | - if(!$output->data) return $this->stop('msg_poll_not_exists'); |
|
140 | + if (!$output->data) return $this->stop('msg_poll_not_exists'); |
|
141 | 141 | |
142 | 142 | $poll = new stdClass(); |
143 | 143 | $poll->stop_date = $output->data->stop_date; |
144 | 144 | $poll->poll_count = $output->data->poll_count; |
145 | 145 | |
146 | 146 | $output = executeQuery('poll.getPollTitle', $args); |
147 | - if(!$output->data) |
|
147 | + if (!$output->data) |
|
148 | 148 | { |
149 | 149 | return $this->stop('msg_poll_not_exists'); |
150 | 150 | } |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | $tmp->poll_count = $output->data->poll_count; |
156 | 156 | |
157 | 157 | $output = executeQuery('poll.getPollItem', $args); |
158 | - foreach($output->data as $val) |
|
158 | + foreach ($output->data as $val) |
|
159 | 159 | { |
160 | 160 | $tmp->item[] = $val; |
161 | 161 | } |
162 | 162 | |
163 | 163 | $poll->poll_srl = $poll_srl; |
164 | 164 | |
165 | - Context::set('poll',$poll); |
|
165 | + Context::set('poll', $poll); |
|
166 | 166 | // Configure the skin and the colorset for the default configuration |
167 | 167 | $oModuleModel = getModel('module'); |
168 | 168 | $poll_config = $oModuleModel->getModuleConfig('poll'); |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | { |
40 | 40 | $oModuleModel = getModel('module'); |
41 | 41 | // 2007.10.17 When deleting posts/comments delete the poll as well |
42 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true; |
|
44 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true; |
|
45 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true; |
|
46 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true; |
|
47 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true; |
|
42 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true; |
|
43 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true; |
|
44 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true; |
|
45 | + if (!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true; |
|
46 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true; |
|
47 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true; |
|
48 | 48 | |
49 | 49 | return false; |
50 | 50 | } |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | $oModuleModel = getModel('module'); |
58 | 58 | $oModuleController = getController('module'); |
59 | 59 | // 2007.10.17 When deleting posts/comments delete the poll as well |
60 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) |
|
60 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) |
|
61 | 61 | $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); |
62 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) |
|
62 | + if (!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) |
|
63 | 63 | $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); |
64 | 64 | // 2008.04.22 A poll connection to add posts/comments |
65 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) |
|
65 | + if (!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) |
|
66 | 66 | $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); |
67 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) |
|
67 | + if (!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) |
|
68 | 68 | $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); |
69 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) |
|
69 | + if (!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) |
|
70 | 70 | $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); |
71 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) |
|
71 | + if (!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) |
|
72 | 72 | $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); |
73 | 73 | |
74 | 74 | return new Object(0, 'success_updated'); |
@@ -39,12 +39,24 @@ discard block |
||
39 | 39 | { |
40 | 40 | $oModuleModel = getModel('module'); |
41 | 41 | // 2007.10.17 When deleting posts/comments delete the poll as well |
42 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true; |
|
43 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true; |
|
44 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true; |
|
45 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true; |
|
46 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true; |
|
47 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true; |
|
42 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) { |
|
43 | + return true; |
|
44 | + } |
|
45 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) { |
|
46 | + return true; |
|
47 | + } |
|
48 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) { |
|
49 | + return true; |
|
50 | + } |
|
51 | + if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) { |
|
52 | + return true; |
|
53 | + } |
|
54 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) { |
|
55 | + return true; |
|
56 | + } |
|
57 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) { |
|
58 | + return true; |
|
59 | + } |
|
48 | 60 | |
49 | 61 | return false; |
50 | 62 | } |
@@ -57,19 +69,25 @@ discard block |
||
57 | 69 | $oModuleModel = getModel('module'); |
58 | 70 | $oModuleController = getController('module'); |
59 | 71 | // 2007.10.17 When deleting posts/comments delete the poll as well |
60 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) |
|
61 | - $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); |
|
62 | - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) |
|
63 | - $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); |
|
72 | + if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) { |
|
73 | + $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); |
|
74 | + } |
|
75 | + if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) { |
|
76 | + $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); |
|
77 | + } |
|
64 | 78 | // 2008.04.22 A poll connection to add posts/comments |
65 | - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) |
|
66 | - $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); |
|
67 | - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) |
|
68 | - $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); |
|
69 | - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) |
|
70 | - $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); |
|
71 | - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) |
|
72 | - $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); |
|
79 | + if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) { |
|
80 | + $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); |
|
81 | + } |
|
82 | + if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) { |
|
83 | + $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); |
|
84 | + } |
|
85 | + if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) { |
|
86 | + $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); |
|
87 | + } |
|
88 | + if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) { |
|
89 | + $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); |
|
90 | + } |
|
73 | 91 | |
74 | 92 | return new Object(0, 'success_updated'); |
75 | 93 | } |