@@ -29,7 +29,9 @@ discard block |
||
29 | 29 | $mid = Context::get('mid'); |
30 | 30 | $editor_sequence = Context::get('editor_sequence'); |
31 | 31 | $upload_target_srl = Context::get('upload_target_srl'); |
32 | - if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
32 | + if(!$upload_target_srl) { |
|
33 | + $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | if($upload_target_srl) |
35 | 37 | { |
@@ -68,26 +70,32 @@ discard block |
||
68 | 70 | } |
69 | 71 | |
70 | 72 | $tmp_files = $this->getFiles($upload_target_srl); |
71 | - if(!$tmp_files) $tmp_files = array(); |
|
73 | + if(!$tmp_files) { |
|
74 | + $tmp_files = array(); |
|
75 | + } |
|
72 | 76 | |
73 | 77 | foreach($tmp_files as $file_info) |
74 | 78 | { |
75 | - if(!$file_info->file_srl) continue; |
|
79 | + if(!$file_info->file_srl) { |
|
80 | + continue; |
|
81 | + } |
|
76 | 82 | |
77 | 83 | $obj = new stdClass; |
78 | 84 | $obj->file_srl = $file_info->file_srl; |
79 | 85 | $obj->source_filename = $file_info->source_filename; |
80 | 86 | $obj->file_size = $file_info->file_size; |
81 | 87 | $obj->disp_file_size = FileHandler::filesize($file_info->file_size); |
82 | - if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
83 | - else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
|
88 | + if($file_info->direct_download=='N') { |
|
89 | + $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
90 | + } else { |
|
91 | + $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
|
92 | + } |
|
84 | 93 | $obj->direct_download = $file_info->direct_download; |
85 | 94 | $obj->cover_image = ($file_info->cover_image === 'Y') ? true : false; |
86 | 95 | $files[] = $obj; |
87 | 96 | $attached_size += $file_info->file_size; |
88 | 97 | } |
89 | - } |
|
90 | - else |
|
98 | + } else |
|
91 | 99 | { |
92 | 100 | $upload_target_srl = 0; |
93 | 101 | $attached_size = 0; |
@@ -155,8 +163,12 @@ discard block |
||
155 | 163 | |
156 | 164 | $file_module_config = $oModuleModel->getModuleConfig('file'); |
157 | 165 | |
158 | - if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
159 | - if(!$file_config) $file_config = $file_module_config; |
|
166 | + if($module_srl) { |
|
167 | + $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
168 | + } |
|
169 | + if(!$file_config) { |
|
170 | + $file_config = $file_module_config; |
|
171 | + } |
|
160 | 172 | |
161 | 173 | $config = new stdClass(); |
162 | 174 | |
@@ -171,25 +183,53 @@ discard block |
||
171 | 183 | $config->allow_outlink_format = $file_config->allow_outlink_format; |
172 | 184 | } |
173 | 185 | // Property for all files comes first than each property |
174 | - if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
175 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
176 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
177 | - if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
178 | - if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
179 | - if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
180 | - if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
186 | + if(!$config->allowed_filesize) { |
|
187 | + $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
188 | + } |
|
189 | + if(!$config->allowed_attach_size) { |
|
190 | + $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
191 | + } |
|
192 | + if(!$config->allowed_filetypes) { |
|
193 | + $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
194 | + } |
|
195 | + if(!$config->allow_outlink) { |
|
196 | + $config->allow_outlink = $file_module_config->allow_outlink; |
|
197 | + } |
|
198 | + if(!$config->allow_outlink_site) { |
|
199 | + $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
200 | + } |
|
201 | + if(!$config->allow_outlink_format) { |
|
202 | + $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
203 | + } |
|
204 | + if(!$config->download_grant) { |
|
205 | + $config->download_grant = $file_module_config->download_grant; |
|
206 | + } |
|
181 | 207 | // Default setting if not exists |
182 | - if(!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
183 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
184 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
185 | - if(!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
186 | - if(!$config->download_grant) $config->download_grant = array(); |
|
208 | + if(!$config->allowed_filesize) { |
|
209 | + $config->allowed_filesize = '2'; |
|
210 | + } |
|
211 | + if(!$config->allowed_attach_size) { |
|
212 | + $config->allowed_attach_size = '3'; |
|
213 | + } |
|
214 | + if(!$config->allowed_filetypes) { |
|
215 | + $config->allowed_filetypes = '*.*'; |
|
216 | + } |
|
217 | + if(!$config->allow_outlink) { |
|
218 | + $config->allow_outlink = 'Y'; |
|
219 | + } |
|
220 | + if(!$config->download_grant) { |
|
221 | + $config->download_grant = array(); |
|
222 | + } |
|
187 | 223 | |
188 | 224 | $size = ini_get('upload_max_filesize'); |
189 | 225 | $unit = strtolower($size[strlen($size) - 1]); |
190 | 226 | $size = (float)$size; |
191 | - if($unit == 'g') $size *= 1024; |
|
192 | - if($unit == 'k') $size /= 1024; |
|
227 | + if($unit == 'g') { |
|
228 | + $size *= 1024; |
|
229 | + } |
|
230 | + if($unit == 'k') { |
|
231 | + $size /= 1024; |
|
232 | + } |
|
193 | 233 | |
194 | 234 | if($config->allowed_filesize > $size) |
195 | 235 | { |
@@ -215,7 +255,9 @@ discard block |
||
215 | 255 | $args = new stdClass(); |
216 | 256 | $args->file_srl = $file_srl; |
217 | 257 | $output = executeQueryArray('file.getFile', $args, $columnList); |
218 | - if(!$output->toBool()) return $output; |
|
258 | + if(!$output->toBool()) { |
|
259 | + return $output; |
|
260 | + } |
|
219 | 261 | |
220 | 262 | // old version compatibility |
221 | 263 | if(count($output->data) == 1) |
@@ -224,8 +266,7 @@ discard block |
||
224 | 266 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
225 | 267 | |
226 | 268 | return $file; |
227 | - } |
|
228 | - else |
|
269 | + } else |
|
229 | 270 | { |
230 | 271 | $fileList = array(); |
231 | 272 | |
@@ -255,13 +296,19 @@ discard block |
||
255 | 296 | $args = new stdClass(); |
256 | 297 | $args->upload_target_srl = $upload_target_srl; |
257 | 298 | $args->sort_index = $sortIndex; |
258 | - if($ckValid) $args->isvalid = 'Y'; |
|
299 | + if($ckValid) { |
|
300 | + $args->isvalid = 'Y'; |
|
301 | + } |
|
259 | 302 | $output = executeQueryArray('file.getFiles', $args, $columnList); |
260 | - if(!$output->data) return; |
|
303 | + if(!$output->data) { |
|
304 | + return; |
|
305 | + } |
|
261 | 306 | |
262 | 307 | $file_list = $output->data; |
263 | 308 | |
264 | - if($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
309 | + if($file_list && !is_array($file_list)) { |
|
310 | + $file_list = array($file_list); |
|
311 | + } |
|
265 | 312 | |
266 | 313 | foreach ($file_list as &$file) |
267 | 314 | { |
@@ -346,7 +393,9 @@ discard block |
||
346 | 393 | */ |
347 | 394 | function getFileGrant($file_info, $member_info) |
348 | 395 | { |
349 | - if(!$file_info) return null; |
|
396 | + if(!$file_info) { |
|
397 | + return null; |
|
398 | + } |
|
350 | 399 | |
351 | 400 | if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
352 | 401 | { |
@@ -359,7 +408,9 @@ discard block |
||
359 | 408 | |
360 | 409 | $oDocumentModel = getModel('document'); |
361 | 410 | $oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl); |
362 | - if($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
411 | + if($oDocument->isExists()) { |
|
412 | + $document_grant = $oDocument->isGranted(); |
|
413 | + } |
|
363 | 414 | |
364 | 415 | $file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager); |
365 | 416 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * It is used when a file list of the upload_target_srl is requested for creating/updating a document. |
21 | 21 | * Attempt to replace with sever-side session if upload_target_srl is not yet determined |
22 | 22 | * |
23 | - * @return void |
|
23 | + * @return BaseObject|null |
|
24 | 24 | */ |
25 | 25 | function getFileList() |
26 | 26 | { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * Get file configurations |
147 | 147 | * |
148 | 148 | * @param int $module_srl If set this, returns specific module's configuration. Otherwise returns global configuration. |
149 | - * @return object Returns configuration. |
|
149 | + * @return stdClass Returns configuration. |
|
150 | 150 | */ |
151 | 151 | function getFileConfig($module_srl = null) |
152 | 152 | { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | /** |
277 | 277 | * Return configurations of the attachement (it automatically checks if an administrator is) |
278 | 278 | * |
279 | - * @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types. |
|
279 | + * @return stdClass Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types. |
|
280 | 280 | */ |
281 | 281 | function getUploadConfig() |
282 | 282 | { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * Return file configuration of the module |
331 | 331 | * |
332 | 332 | * @param int $module_srl The sequence of module to get configuration |
333 | - * @return object |
|
333 | + * @return stdClass |
|
334 | 334 | */ |
335 | 335 | function getFileModuleConfig($module_srl) |
336 | 336 | { |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | $mid = Context::get('mid'); |
30 | 30 | $editor_sequence = Context::get('editor_sequence'); |
31 | 31 | $upload_target_srl = Context::get('upload_target_srl'); |
32 | - if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
32 | + if (!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
33 | 33 | |
34 | - if($upload_target_srl) |
|
34 | + if ($upload_target_srl) |
|
35 | 35 | { |
36 | 36 | $oDocumentModel = getModel('document'); |
37 | 37 | $oCommentModel = getModel('comment'); |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | $oDocument = $oDocumentModel->getDocument($upload_target_srl); |
41 | 41 | |
42 | 42 | // comment 권한 확인 |
43 | - if(!$oDocument->isExists()) |
|
43 | + if (!$oDocument->isExists()) |
|
44 | 44 | { |
45 | 45 | $oComment = $oCommentModel->getComment($upload_target_srl); |
46 | - if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted()) |
|
46 | + if ($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted()) |
|
47 | 47 | { |
48 | 48 | return new BaseObject(-1, 'msg_not_permitted'); |
49 | 49 | } |
@@ -52,34 +52,34 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // document 권한 확인 |
55 | - if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted()) |
|
55 | + if ($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted()) |
|
56 | 56 | { |
57 | 57 | return new BaseObject(-1, 'msg_not_permitted'); |
58 | 58 | } |
59 | 59 | |
60 | 60 | // 모듈 권한 확인 |
61 | - if($oDocument->isExists()) |
|
61 | + if ($oDocument->isExists()) |
|
62 | 62 | { |
63 | 63 | $grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info); |
64 | - if(!$grant->access) |
|
64 | + if (!$grant->access) |
|
65 | 65 | { |
66 | 66 | return new BaseObject(-1, 'msg_not_permitted'); |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | $tmp_files = $this->getFiles($upload_target_srl); |
71 | - if(!$tmp_files) $tmp_files = array(); |
|
71 | + if (!$tmp_files) $tmp_files = array(); |
|
72 | 72 | |
73 | - foreach($tmp_files as $file_info) |
|
73 | + foreach ($tmp_files as $file_info) |
|
74 | 74 | { |
75 | - if(!$file_info->file_srl) continue; |
|
75 | + if (!$file_info->file_srl) continue; |
|
76 | 76 | |
77 | 77 | $obj = new stdClass; |
78 | 78 | $obj->file_srl = $file_info->file_srl; |
79 | 79 | $obj->source_filename = $file_info->source_filename; |
80 | 80 | $obj->file_size = $file_info->file_size; |
81 | 81 | $obj->disp_file_size = FileHandler::filesize($file_info->file_size); |
82 | - if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
82 | + if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); |
|
83 | 83 | else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); |
84 | 84 | $obj->direct_download = $file_info->direct_download; |
85 | 85 | $obj->cover_image = ($file_info->cover_image === 'Y') ? true : false; |
@@ -99,17 +99,17 @@ discard block |
||
99 | 99 | //$config = $oModuleModel->getModuleInfoByMid($mid); //perhaps config varialbles not used |
100 | 100 | |
101 | 101 | $file_config = $this->getUploadConfig(); |
102 | - $left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size; |
|
102 | + $left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size; |
|
103 | 103 | // Settings of required information |
104 | 104 | $attached_size = FileHandler::filesize($attached_size); |
105 | - $allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024); |
|
106 | - $allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024); |
|
105 | + $allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024); |
|
106 | + $allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024); |
|
107 | 107 | $allowed_filetypes = $file_config->allowed_filetypes; |
108 | - $this->add("files",$files); |
|
109 | - $this->add("editor_sequence",$editor_sequence); |
|
110 | - $this->add("upload_target_srl",$upload_target_srl); |
|
111 | - $this->add("upload_status",$upload_status); |
|
112 | - $this->add("left_size",$left_size); |
|
108 | + $this->add("files", $files); |
|
109 | + $this->add("editor_sequence", $editor_sequence); |
|
110 | + $this->add("upload_target_srl", $upload_target_srl); |
|
111 | + $this->add("upload_status", $upload_status); |
|
112 | + $this->add("left_size", $left_size); |
|
113 | 113 | $this->add('attached_size', $attached_size); |
114 | 114 | $this->add('allowed_attach_size', $allowed_attach_size); |
115 | 115 | $this->add('allowed_filesize', $allowed_filesize); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $args = new stdClass(); |
128 | 128 | $args->upload_target_srl = $upload_target_srl; |
129 | 129 | $output = executeQuery('file.getFilesCount', $args); |
130 | - return (int)$output->data->count; |
|
130 | + return (int) $output->data->count; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @param string $sid |
138 | 138 | * @return string Returns a url |
139 | 139 | */ |
140 | - function getDownloadUrl($file_srl, $sid, $module_srl="") |
|
140 | + function getDownloadUrl($file_srl, $sid, $module_srl = "") |
|
141 | 141 | { |
142 | 142 | return sprintf('?module=%s&act=%s&file_srl=%s&sid=%s&module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl); |
143 | 143 | } |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | |
156 | 156 | $file_module_config = $oModuleModel->getModuleConfig('file'); |
157 | 157 | |
158 | - if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl); |
|
159 | - if(!$file_config) $file_config = $file_module_config; |
|
158 | + if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl); |
|
159 | + if (!$file_config) $file_config = $file_module_config; |
|
160 | 160 | |
161 | 161 | $config = new stdClass(); |
162 | 162 | |
163 | - if($file_config) |
|
163 | + if ($file_config) |
|
164 | 164 | { |
165 | 165 | $config->allowed_filesize = $file_config->allowed_filesize; |
166 | 166 | $config->allowed_attach_size = $file_config->allowed_attach_size; |
@@ -171,31 +171,31 @@ discard block |
||
171 | 171 | $config->allow_outlink_format = $file_config->allow_outlink_format; |
172 | 172 | } |
173 | 173 | // Property for all files comes first than each property |
174 | - if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
175 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
176 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
177 | - if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
178 | - if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
179 | - if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
180 | - if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
174 | + if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize; |
|
175 | + if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size; |
|
176 | + if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes; |
|
177 | + if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink; |
|
178 | + if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site; |
|
179 | + if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format; |
|
180 | + if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant; |
|
181 | 181 | // Default setting if not exists |
182 | - if(!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
183 | - if(!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
184 | - if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
185 | - if(!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
186 | - if(!$config->download_grant) $config->download_grant = array(); |
|
182 | + if (!$config->allowed_filesize) $config->allowed_filesize = '2'; |
|
183 | + if (!$config->allowed_attach_size) $config->allowed_attach_size = '3'; |
|
184 | + if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; |
|
185 | + if (!$config->allow_outlink) $config->allow_outlink = 'Y'; |
|
186 | + if (!$config->download_grant) $config->download_grant = array(); |
|
187 | 187 | |
188 | 188 | $size = ini_get('upload_max_filesize'); |
189 | 189 | $unit = strtolower($size[strlen($size) - 1]); |
190 | - $size = (float)$size; |
|
191 | - if($unit == 'g') $size *= 1024; |
|
192 | - if($unit == 'k') $size /= 1024; |
|
190 | + $size = (float) $size; |
|
191 | + if ($unit == 'g') $size *= 1024; |
|
192 | + if ($unit == 'k') $size /= 1024; |
|
193 | 193 | |
194 | - if($config->allowed_filesize > $size) |
|
194 | + if ($config->allowed_filesize > $size) |
|
195 | 195 | { |
196 | 196 | $config->allowed_filesize = $size; |
197 | 197 | } |
198 | - if($config->allowed_attach_size > $size) |
|
198 | + if ($config->allowed_attach_size > $size) |
|
199 | 199 | { |
200 | 200 | $config->allowed_attach_size = $size; |
201 | 201 | } |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | $args = new stdClass(); |
216 | 216 | $args->file_srl = $file_srl; |
217 | 217 | $output = executeQueryArray('file.getFile', $args, $columnList); |
218 | - if(!$output->toBool()) return $output; |
|
218 | + if (!$output->toBool()) return $output; |
|
219 | 219 | |
220 | 220 | // old version compatibility |
221 | - if(count($output->data) == 1) |
|
221 | + if (count($output->data) == 1) |
|
222 | 222 | { |
223 | 223 | $file = $output->data[0]; |
224 | 224 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | { |
230 | 230 | $fileList = array(); |
231 | 231 | |
232 | - if(is_array($output->data)) |
|
232 | + if (is_array($output->data)) |
|
233 | 233 | { |
234 | - foreach($output->data as $key=>$value) |
|
234 | + foreach ($output->data as $key=>$value) |
|
235 | 235 | { |
236 | 236 | $file = $value; |
237 | 237 | $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl); |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | $args = new stdClass(); |
256 | 256 | $args->upload_target_srl = $upload_target_srl; |
257 | 257 | $args->sort_index = $sortIndex; |
258 | - if($ckValid) $args->isvalid = 'Y'; |
|
258 | + if ($ckValid) $args->isvalid = 'Y'; |
|
259 | 259 | $output = executeQueryArray('file.getFiles', $args, $columnList); |
260 | - if(!$output->data) return; |
|
260 | + if (!$output->data) return; |
|
261 | 261 | |
262 | 262 | $file_list = $output->data; |
263 | 263 | |
264 | - if($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
264 | + if ($file_list && !is_array($file_list)) $file_list = array($file_list); |
|
265 | 265 | |
266 | 266 | foreach ($file_list as &$file) |
267 | 267 | { |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | |
285 | 285 | $module_srl = Context::get('module_srl'); |
286 | 286 | // Get the current module if module_srl doesn't exist |
287 | - if(!$module_srl) |
|
287 | + if (!$module_srl) |
|
288 | 288 | { |
289 | 289 | $current_module_info = Context::get('current_module_info'); |
290 | 290 | $module_srl = $current_module_info->module_srl; |
291 | 291 | } |
292 | 292 | $file_config = $this->getFileConfig($module_srl); |
293 | 293 | |
294 | - if($logged_info->is_admin == 'Y') |
|
294 | + if ($logged_info->is_admin == 'Y') |
|
295 | 295 | { |
296 | 296 | $iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size')); |
297 | 297 | $iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize')); |
@@ -317,9 +317,9 @@ discard block |
||
317 | 317 | '%s : %s/ %s<br /> %s : %s (%s : %s)', |
318 | 318 | Context::getLang('allowed_attach_size'), |
319 | 319 | FileHandler::filesize($attached_size), |
320 | - FileHandler::filesize($file_config->allowed_attach_size*1024*1024), |
|
320 | + FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024), |
|
321 | 321 | Context::getLang('allowed_filesize'), |
322 | - FileHandler::filesize($file_config->allowed_filesize*1024*1024), |
|
322 | + FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024), |
|
323 | 323 | Context::getLang('allowed_filetypes'), |
324 | 324 | $file_config->allowed_filetypes |
325 | 325 | ); |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | */ |
347 | 347 | function getFileGrant($file_info, $member_info) |
348 | 348 | { |
349 | - if(!$file_info) return null; |
|
349 | + if (!$file_info) return null; |
|
350 | 350 | |
351 | - if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
|
351 | + if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) |
|
352 | 352 | { |
353 | 353 | $file_grant->is_deletable = true; |
354 | 354 | return $file_grant; |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | $oDocumentModel = getModel('document'); |
361 | 361 | $oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl); |
362 | - if($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
362 | + if ($oDocument->isExists()) $document_grant = $oDocument->isGranted(); |
|
363 | 363 | |
364 | 364 | $file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager); |
365 | 365 |
@@ -36,26 +36,39 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if($obj->is_notice!='Y'||!$this->grant->manager) { |
|
40 | + $obj->is_notice = 'N'; |
|
41 | + } |
|
40 | 42 | $obj->commentStatus = $obj->comment_status; |
41 | 43 | |
42 | 44 | $oModuleModel = getModel('module'); |
43 | 45 | $module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl); |
44 | 46 | if($module_config->mobile_use_editor === 'Y') |
45 | 47 | { |
46 | - if(!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
47 | - if(!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
48 | - } |
|
49 | - else |
|
48 | + if(!isset($obj->use_editor)) { |
|
49 | + $obj->use_editor = 'Y'; |
|
50 | + } |
|
51 | + if(!isset($obj->use_html)) { |
|
52 | + $obj->use_html = 'Y'; |
|
53 | + } |
|
54 | + } else |
|
50 | 55 | { |
51 | - if(!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
52 | - if(!isset($obj->use_html)) $obj->use_html = 'N'; |
|
56 | + if(!isset($obj->use_editor)) { |
|
57 | + $obj->use_editor = 'N'; |
|
58 | + } |
|
59 | + if(!isset($obj->use_html)) { |
|
60 | + $obj->use_html = 'N'; |
|
61 | + } |
|
53 | 62 | } |
54 | 63 | |
55 | 64 | settype($obj->title, "string"); |
56 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
65 | + if($obj->title == '') { |
|
66 | + $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
67 | + } |
|
57 | 68 | //setup dpcument title tp 'Untitled' |
58 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
69 | + if($obj->title == '') { |
|
70 | + $obj->title = 'Untitled'; |
|
71 | + } |
|
59 | 72 | |
60 | 73 | // unset document style if the user is not the document manager |
61 | 74 | if(!$this->grant->manager) |
@@ -96,8 +109,7 @@ discard block |
||
96 | 109 | { |
97 | 110 | $oDocument->add('member_srl', $obj->member_srl); |
98 | 111 | } |
99 | - } |
|
100 | - else |
|
112 | + } else |
|
101 | 113 | { |
102 | 114 | $bAnonymous = false; |
103 | 115 | } |
@@ -169,7 +181,9 @@ discard block |
||
169 | 181 | for($i=0;$i<count($target_mail);$i++) |
170 | 182 | { |
171 | 183 | $email_address = trim($target_mail[$i]); |
172 | - if(!$email_address) continue; |
|
184 | + if(!$email_address) { |
|
185 | + continue; |
|
186 | + } |
|
173 | 187 | $oMail->setReceiptor($email_address, $email_address); |
174 | 188 | $oMail->send(); |
175 | 189 | } |
@@ -263,7 +277,9 @@ discard block |
||
263 | 277 | $obj = Context::getRequestVars(); |
264 | 278 | $obj->module_srl = $this->module_srl; |
265 | 279 | |
266 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
280 | + if(!$this->module_info->use_status) { |
|
281 | + $this->module_info->use_status = 'PUBLIC'; |
|
282 | + } |
|
267 | 283 | if(!is_array($this->module_info->use_status)) |
268 | 284 | { |
269 | 285 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
@@ -272,8 +288,7 @@ discard block |
||
272 | 288 | if(in_array('SECRET', $this->module_info->use_status)) |
273 | 289 | { |
274 | 290 | $this->module_info->secret = 'Y'; |
275 | - } |
|
276 | - else |
|
291 | + } else |
|
277 | 292 | { |
278 | 293 | unset($obj->is_secret); |
279 | 294 | $this->module_info->secret = 'N'; |
@@ -283,13 +298,20 @@ discard block |
||
283 | 298 | $module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl); |
284 | 299 | if($module_config->mobile_use_editor === 'Y') |
285 | 300 | { |
286 | - if(!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
287 | - if(!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
288 | - } |
|
289 | - else |
|
301 | + if(!isset($obj->use_editor)) { |
|
302 | + $obj->use_editor = 'Y'; |
|
303 | + } |
|
304 | + if(!isset($obj->use_html)) { |
|
305 | + $obj->use_html = 'Y'; |
|
306 | + } |
|
307 | + } else |
|
290 | 308 | { |
291 | - if(!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
292 | - if(!isset($obj->use_html)) $obj->use_html = 'N'; |
|
309 | + if(!isset($obj->use_editor)) { |
|
310 | + $obj->use_editor = 'N'; |
|
311 | + } |
|
312 | + if(!isset($obj->use_html)) { |
|
313 | + $obj->use_html = 'N'; |
|
314 | + } |
|
293 | 315 | } |
294 | 316 | |
295 | 317 | // check if the doument is existed |
@@ -309,8 +331,7 @@ discard block |
||
309 | 331 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
310 | 332 | $obj->user_name = $obj->nick_name = 'anonymous'; |
311 | 333 | $bAnonymous = true; |
312 | - } |
|
313 | - else |
|
334 | + } else |
|
314 | 335 | { |
315 | 336 | $bAnonymous = false; |
316 | 337 | } |
@@ -416,7 +437,9 @@ discard block |
||
416 | 437 | // generate trackback module controller object |
417 | 438 | $oTrackbackController = getController('trackback'); |
418 | 439 | |
419 | - if(!$oTrackbackController) return; |
|
440 | + if(!$oTrackbackController) { |
|
441 | + return; |
|
442 | + } |
|
420 | 443 | |
421 | 444 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
422 | 445 | if(!$output->toBool()) |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | function procBoardInsertDocument() |
24 | 24 | { |
25 | 25 | // check grant |
26 | - if($this->module_info->module != "board") |
|
26 | + if ($this->module_info->module != "board") |
|
27 | 27 | { |
28 | 28 | return new BaseObject(-1, "msg_invalid_request"); |
29 | 29 | } |
30 | - if(!$this->grant->write_document) |
|
30 | + if (!$this->grant->write_document) |
|
31 | 31 | { |
32 | 32 | return new BaseObject(-1, 'msg_not_permitted'); |
33 | 33 | } |
@@ -36,29 +36,29 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N'; |
|
40 | 40 | $obj->commentStatus = $obj->comment_status; |
41 | 41 | |
42 | 42 | $oModuleModel = getModel('module'); |
43 | 43 | $module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl); |
44 | - if($module_config->mobile_use_editor === 'Y') |
|
44 | + if ($module_config->mobile_use_editor === 'Y') |
|
45 | 45 | { |
46 | - if(!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
47 | - if(!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
46 | + if (!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
47 | + if (!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
48 | 48 | } |
49 | 49 | else |
50 | 50 | { |
51 | - if(!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
52 | - if(!isset($obj->use_html)) $obj->use_html = 'N'; |
|
51 | + if (!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
52 | + if (!isset($obj->use_html)) $obj->use_html = 'N'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | settype($obj->title, "string"); |
56 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
56 | + if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...'); |
|
57 | 57 | //setup dpcument title tp 'Untitled' |
58 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
58 | + if ($obj->title == '') $obj->title = 'Untitled'; |
|
59 | 59 | |
60 | 60 | // unset document style if the user is not the document manager |
61 | - if(!$this->grant->manager) |
|
61 | + if (!$this->grant->manager) |
|
62 | 62 | { |
63 | 63 | unset($obj->title_color); |
64 | 64 | unset($obj->title_bold); |
@@ -75,24 +75,24 @@ discard block |
||
75 | 75 | |
76 | 76 | // update the document if it is existed |
77 | 77 | $is_update = false; |
78 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
78 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
79 | 79 | { |
80 | 80 | $is_update = true; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // if use anonymous is true |
84 | - if($this->module_info->use_anonymous == 'Y') |
|
84 | + if ($this->module_info->use_anonymous == 'Y') |
|
85 | 85 | { |
86 | 86 | $this->module_info->admin_mail = ''; |
87 | 87 | $obj->notify_message = 'N'; |
88 | - if($is_update===false) |
|
88 | + if ($is_update === false) |
|
89 | 89 | { |
90 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
90 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
91 | 91 | } |
92 | 92 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
93 | 93 | $obj->user_name = $obj->nick_name = 'anonymous'; |
94 | 94 | $bAnonymous = true; |
95 | - if($is_update===false) |
|
95 | + if ($is_update === false) |
|
96 | 96 | { |
97 | 97 | $oDocument->add('member_srl', $obj->member_srl); |
98 | 98 | } |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | $bAnonymous = false; |
103 | 103 | } |
104 | 104 | |
105 | - if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
105 | + if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
106 | 106 | { |
107 | 107 | $use_status = explode('|@|', $this->module_info->use_status); |
108 | - if(!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
108 | + if (!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
109 | 109 | { |
110 | 110 | unset($obj->is_secret); |
111 | 111 | $obj->status = 'PUBLIC'; |
@@ -113,24 +113,24 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | // update the document if it is existed |
116 | - if($is_update) |
|
116 | + if ($is_update) |
|
117 | 117 | { |
118 | - if(!$oDocument->isGranted()) |
|
118 | + if (!$oDocument->isGranted()) |
|
119 | 119 | { |
120 | - return new BaseObject(-1,'msg_not_permitted'); |
|
120 | + return new BaseObject(-1, 'msg_not_permitted'); |
|
121 | 121 | } |
122 | 122 | |
123 | - if($this->module_info->use_anonymous == 'Y') { |
|
123 | + if ($this->module_info->use_anonymous == 'Y') { |
|
124 | 124 | $obj->member_srl = abs($oDocument->get('member_srl')) * -1; |
125 | 125 | $oDocument->add('member_srl', $obj->member_srl); |
126 | 126 | } |
127 | 127 | |
128 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
128 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
129 | 129 | { |
130 | - return new BaseObject(-1,'msg_protect_content'); |
|
130 | + return new BaseObject(-1, 'msg_protect_content'); |
|
131 | 131 | } |
132 | 132 | |
133 | - if(!$this->grant->manager) |
|
133 | + if (!$this->grant->manager) |
|
134 | 134 | { |
135 | 135 | // notice & document style same as before if not manager |
136 | 136 | $obj->is_notice = $oDocument->get('is_notice'); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | // modify list_order if document status is temp |
142 | - if($oDocument->get('status') == 'TEMP') |
|
142 | + if ($oDocument->get('status') == 'TEMP') |
|
143 | 143 | { |
144 | 144 | $obj->last_update = $obj->regdate = date('YmdHis'); |
145 | 145 | $obj->update_order = $obj->list_order = (getNextSequence() * -1); |
@@ -155,21 +155,21 @@ discard block |
||
155 | 155 | $obj->document_srl = $output->get('document_srl'); |
156 | 156 | |
157 | 157 | // send an email to admin user |
158 | - if($output->toBool() && $this->module_info->admin_mail) |
|
158 | + if ($output->toBool() && $this->module_info->admin_mail) |
|
159 | 159 | { |
160 | 160 | $oModuleModel = getModel('module'); |
161 | 161 | $member_config = $oModuleModel->getModuleConfig('member'); |
162 | 162 | |
163 | 163 | $oMail = new Mail(); |
164 | 164 | $oMail->setTitle($obj->title); |
165 | - $oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); |
|
165 | + $oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content)); |
|
166 | 166 | $oMail->setSender($obj->user_name ? $obj->user_name : 'anonymous', $obj->email_address ? $obj->email_address : $member_config->webmaster_email); |
167 | 167 | |
168 | - $target_mail = explode(',',$this->module_info->admin_mail); |
|
169 | - for($i=0;$i<count($target_mail);$i++) |
|
168 | + $target_mail = explode(',', $this->module_info->admin_mail); |
|
169 | + for ($i = 0; $i < count($target_mail); $i++) |
|
170 | 170 | { |
171 | 171 | $email_address = trim($target_mail[$i]); |
172 | - if(!$email_address) continue; |
|
172 | + if (!$email_address) continue; |
|
173 | 173 | $oMail->setReceiptor($email_address, $email_address); |
174 | 174 | $oMail->send(); |
175 | 175 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | // if there is an error |
180 | - if(!$output->toBool()) |
|
180 | + if (!$output->toBool()) |
|
181 | 181 | { |
182 | 182 | return $output; |
183 | 183 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->add('document_srl', $output->get('document_srl')); |
188 | 188 | |
189 | 189 | // alert a message |
190 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
190 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
191 | 191 | { |
192 | 192 | $this->setMessage($msg_code); |
193 | 193 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $document_srl = Context::get('document_srl'); |
203 | 203 | |
204 | 204 | // if the document is not existed |
205 | - if(!$document_srl) |
|
205 | + if (!$document_srl) |
|
206 | 206 | { |
207 | 207 | return $this->doError('msg_invalid_document'); |
208 | 208 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $oDocumentModel = &getModel('document'); |
211 | 211 | $oDocument = $oDocumentModel->getDocument($document_srl); |
212 | 212 | // check protect content |
213 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
213 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
214 | 214 | { |
215 | 215 | return new BaseObject(-1, 'msg_protect_content'); |
216 | 216 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | |
221 | 221 | // delete the document |
222 | 222 | $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); |
223 | - if(!$output->toBool()) |
|
223 | + if (!$output->toBool()) |
|
224 | 224 | { |
225 | 225 | return $output; |
226 | 226 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', '')); |
230 | 230 | $this->add('mid', Context::get('mid')); |
231 | 231 | $this->add('page', Context::get('page')); |
232 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
232 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
233 | 233 | { |
234 | 234 | $this->setMessage('success_deleted'); |
235 | 235 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | function procBoardInsertComment() |
254 | 254 | { |
255 | 255 | // check grant |
256 | - if(!$this->grant->write_comment) |
|
256 | + if (!$this->grant->write_comment) |
|
257 | 257 | { |
258 | 258 | return new BaseObject(-1, 'msg_not_permitted'); |
259 | 259 | } |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | $obj = Context::getRequestVars(); |
264 | 264 | $obj->module_srl = $this->module_srl; |
265 | 265 | |
266 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
267 | - if(!is_array($this->module_info->use_status)) |
|
266 | + if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
267 | + if (!is_array($this->module_info->use_status)) |
|
268 | 268 | { |
269 | 269 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
270 | 270 | } |
271 | 271 | |
272 | - if(in_array('SECRET', $this->module_info->use_status)) |
|
272 | + if (in_array('SECRET', $this->module_info->use_status)) |
|
273 | 273 | { |
274 | 274 | $this->module_info->secret = 'Y'; |
275 | 275 | } |
@@ -281,31 +281,31 @@ discard block |
||
281 | 281 | |
282 | 282 | $oModuleModel = getModel('module'); |
283 | 283 | $module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl); |
284 | - if($module_config->mobile_use_editor === 'Y') |
|
284 | + if ($module_config->mobile_use_editor === 'Y') |
|
285 | 285 | { |
286 | - if(!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
287 | - if(!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
286 | + if (!isset($obj->use_editor)) $obj->use_editor = 'Y'; |
|
287 | + if (!isset($obj->use_html)) $obj->use_html = 'Y'; |
|
288 | 288 | } |
289 | 289 | else |
290 | 290 | { |
291 | - if(!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
292 | - if(!isset($obj->use_html)) $obj->use_html = 'N'; |
|
291 | + if (!isset($obj->use_editor)) $obj->use_editor = 'N'; |
|
292 | + if (!isset($obj->use_html)) $obj->use_html = 'N'; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | // check if the doument is existed |
296 | 296 | $oDocumentModel = getModel('document'); |
297 | 297 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
298 | - if(!$oDocument->isExists()) |
|
298 | + if (!$oDocument->isExists()) |
|
299 | 299 | { |
300 | - return new BaseObject(-1,'msg_not_founded'); |
|
300 | + return new BaseObject(-1, 'msg_not_founded'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | // For anonymous use, remove writer's information and notifying information |
304 | - if($this->module_info->use_anonymous == 'Y') |
|
304 | + if ($this->module_info->use_anonymous == 'Y') |
|
305 | 305 | { |
306 | 306 | $this->module_info->admin_mail = ''; |
307 | 307 | $obj->notify_message = 'N'; |
308 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
308 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
309 | 309 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
310 | 310 | $obj->user_name = $obj->nick_name = 'anonymous'; |
311 | 311 | $bAnonymous = true; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | // check the comment is existed |
325 | 325 | // if the comment is not existed, then generate a new sequence |
326 | - if(!$obj->comment_srl) |
|
326 | + if (!$obj->comment_srl) |
|
327 | 327 | { |
328 | 328 | $obj->comment_srl = getNextSequence(); |
329 | 329 | } else { |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | // if comment_srl is not existed, then insert the comment |
334 | - if($comment->comment_srl != $obj->comment_srl) |
|
334 | + if ($comment->comment_srl != $obj->comment_srl) |
|
335 | 335 | { |
336 | 336 | |
337 | 337 | // parent_srl is existed |
338 | - if($obj->parent_srl) |
|
338 | + if ($obj->parent_srl) |
|
339 | 339 | { |
340 | 340 | $parent_comment = $oCommentModel->getComment($obj->parent_srl); |
341 | - if(!$parent_comment->comment_srl) |
|
341 | + if (!$parent_comment->comment_srl) |
|
342 | 342 | { |
343 | 343 | return new BaseObject(-1, 'msg_invalid_request'); |
344 | 344 | } |
@@ -352,9 +352,9 @@ discard block |
||
352 | 352 | // update the comment if it is not existed |
353 | 353 | } else { |
354 | 354 | // check the grant |
355 | - if(!$comment->isGranted()) |
|
355 | + if (!$comment->isGranted()) |
|
356 | 356 | { |
357 | - return new BaseObject(-1,'msg_not_permitted'); |
|
357 | + return new BaseObject(-1, 'msg_not_permitted'); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | $obj->parent_srl = $comment->parent_srl; |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | $comment_srl = $obj->comment_srl; |
363 | 363 | } |
364 | 364 | |
365 | - if(!$output->toBool()) |
|
365 | + if (!$output->toBool()) |
|
366 | 366 | { |
367 | 367 | return $output; |
368 | 368 | } |
369 | 369 | |
370 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
370 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
371 | 371 | { |
372 | 372 | $this->setMessage('success_registed'); |
373 | 373 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | { |
384 | 384 | // get the comment_srl |
385 | 385 | $comment_srl = Context::get('comment_srl'); |
386 | - if(!$comment_srl) |
|
386 | + if (!$comment_srl) |
|
387 | 387 | { |
388 | 388 | return $this->doError('msg_invalid_request'); |
389 | 389 | } |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $oCommentController = getController('comment'); |
393 | 393 | |
394 | 394 | $output = $oCommentController->deleteComment($comment_srl, $this->grant->manager); |
395 | - if(!$output->toBool()) |
|
395 | + if (!$output->toBool()) |
|
396 | 396 | { |
397 | 397 | return $output; |
398 | 398 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $this->add('mid', Context::get('mid')); |
401 | 401 | $this->add('page', Context::get('page')); |
402 | 402 | $this->add('document_srl', $output->get('document_srl')); |
403 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
403 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
404 | 404 | { |
405 | 405 | $this->setMessage('success_deleted'); |
406 | 406 | } |
@@ -416,10 +416,10 @@ discard block |
||
416 | 416 | // generate trackback module controller object |
417 | 417 | $oTrackbackController = getController('trackback'); |
418 | 418 | |
419 | - if(!$oTrackbackController) return; |
|
419 | + if (!$oTrackbackController) return; |
|
420 | 420 | |
421 | 421 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
422 | - if(!$output->toBool()) |
|
422 | + if (!$output->toBool()) |
|
423 | 423 | { |
424 | 424 | return $output; |
425 | 425 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $this->add('mid', Context::get('mid')); |
428 | 428 | $this->add('page', Context::get('page')); |
429 | 429 | $this->add('document_srl', $output->get('document_srl')); |
430 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
430 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
431 | 431 | { |
432 | 432 | $this->setMessage('success_deleted'); |
433 | 433 | } |
@@ -446,18 +446,18 @@ discard block |
||
446 | 446 | $oMemberModel = getModel('member'); |
447 | 447 | |
448 | 448 | // if the comment exists |
449 | - if($comment_srl) |
|
449 | + if ($comment_srl) |
|
450 | 450 | { |
451 | 451 | // get the comment information |
452 | 452 | $oCommentModel = getModel('comment'); |
453 | 453 | $oComment = $oCommentModel->getComment($comment_srl); |
454 | - if(!$oComment->isExists()) |
|
454 | + if (!$oComment->isExists()) |
|
455 | 455 | { |
456 | 456 | return new BaseObject(-1, 'msg_invalid_request'); |
457 | 457 | } |
458 | 458 | |
459 | 459 | // compare the comment password and the user input password |
460 | - if(!$oMemberModel->isValidPassword($oComment->get('password'),$password)) |
|
460 | + if (!$oMemberModel->isValidPassword($oComment->get('password'), $password)) |
|
461 | 461 | { |
462 | 462 | return new BaseObject(-1, 'msg_invalid_password'); |
463 | 463 | } |
@@ -467,13 +467,13 @@ discard block |
||
467 | 467 | // get the document information |
468 | 468 | $oDocumentModel = getModel('document'); |
469 | 469 | $oDocument = $oDocumentModel->getDocument($document_srl); |
470 | - if(!$oDocument->isExists()) |
|
470 | + if (!$oDocument->isExists()) |
|
471 | 471 | { |
472 | 472 | return new BaseObject(-1, 'msg_invalid_request'); |
473 | 473 | } |
474 | 474 | |
475 | 475 | // compare the document password and the user input password |
476 | - if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password)) |
|
476 | + if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password)) |
|
477 | 477 | { |
478 | 478 | return new BaseObject(-1, 'msg_invalid_password'); |
479 | 479 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $member_srl = Context::get('target_srl'); |
491 | 491 | $mid = Context::get('cur_mid'); |
492 | 492 | |
493 | - if(!$member_srl || !$mid) |
|
493 | + if (!$member_srl || !$mid) |
|
494 | 494 | { |
495 | 495 | return new BaseObject(); |
496 | 496 | } |
@@ -502,13 +502,13 @@ discard block |
||
502 | 502 | $columnList = array('module'); |
503 | 503 | $cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList); |
504 | 504 | |
505 | - if($cur_module_info->module != 'board') |
|
505 | + if ($cur_module_info->module != 'board') |
|
506 | 506 | { |
507 | 507 | return new BaseObject(); |
508 | 508 | } |
509 | 509 | |
510 | 510 | // get the member information |
511 | - if($member_srl == $logged_info->member_srl) |
|
511 | + if ($member_srl == $logged_info->member_srl) |
|
512 | 512 | { |
513 | 513 | $member_info = $logged_info; |
514 | 514 | } else { |
@@ -516,13 +516,13 @@ discard block |
||
516 | 516 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
517 | 517 | } |
518 | 518 | |
519 | - if(!$member_info->user_id) |
|
519 | + if (!$member_info->user_id) |
|
520 | 520 | { |
521 | 521 | return new BaseObject(); |
522 | 522 | } |
523 | 523 | |
524 | 524 | //search |
525 | - $url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name); |
|
525 | + $url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name); |
|
526 | 526 | $oMemberController = getController('member'); |
527 | 527 | $oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', ''); |
528 | 528 |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | $oModuleModel = getModel('module'); |
31 | 31 | $oModuleController = getController('module'); |
32 | 32 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
33 | - if($oModuleModel->needUpdate($version_update_id)) |
|
33 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
34 | 34 | { |
35 | 35 | // widget compile display.after trigger for further (04/14/2009) |
36 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
36 | + if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
37 | 37 | |
38 | 38 | $oModuleController->insertUpdatedLog($version_update_id); |
39 | 39 | } |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | $oModuleController = getController('module'); |
51 | 51 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
52 | - if($oModuleModel->needUpdate($version_update_id)) |
|
52 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
53 | 53 | { |
54 | 54 | // widget compile display.after trigger for further (04/14/2009) |
55 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) |
|
55 | + if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) |
|
56 | 56 | { |
57 | 57 | $oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'); |
58 | 58 | } |
@@ -33,7 +33,9 @@ |
||
33 | 33 | if($oModuleModel->needUpdate($version_update_id)) |
34 | 34 | { |
35 | 35 | // widget compile display.after trigger for further (04/14/2009) |
36 | - if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true; |
|
36 | + if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) { |
|
37 | + return true; |
|
38 | + } |
|
37 | 39 | |
38 | 40 | $oModuleController->insertUpdatedLog($version_update_id); |
39 | 41 | } |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | $oModuleModel = getModel('module'); |
24 | 24 | $oModuleController = getController('module'); |
25 | 25 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
26 | - if($oModuleModel->needUpdate($version_update_id)) |
|
26 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
27 | 27 | { |
28 | 28 | $config = $oModuleModel->getModuleConfig('message'); |
29 | 29 | |
30 | - if($config->skin) |
|
30 | + if ($config->skin) |
|
31 | 31 | { |
32 | 32 | $config_parse = explode('.', $config->skin); |
33 | 33 | if (count($config_parse) > 1) |
34 | 34 | { |
35 | 35 | $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]); |
36 | - if(is_dir($template_path)) return true; |
|
36 | + if (is_dir($template_path)) return true; |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | $oModuleModel = getModel('module'); |
52 | 52 | $oModuleController = getController('module'); |
53 | 53 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
54 | - if($oModuleModel->needUpdate($version_update_id)) |
|
54 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
55 | 55 | { |
56 | 56 | $config = $oModuleModel->getModuleConfig('message'); |
57 | 57 | |
58 | - if($config->skin) |
|
58 | + if ($config->skin) |
|
59 | 59 | { |
60 | 60 | $config_parse = explode('.', $config->skin); |
61 | 61 | if (count($config_parse) > 1) |
62 | 62 | { |
63 | 63 | $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]); |
64 | - if(is_dir($template_path)) |
|
64 | + if (is_dir($template_path)) |
|
65 | 65 | { |
66 | 66 | $config->skin = implode('|@|', $config_parse); |
67 | 67 | $oModuleController = getController('module'); |
@@ -33,7 +33,9 @@ |
||
33 | 33 | if (count($config_parse) > 1) |
34 | 34 | { |
35 | 35 | $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]); |
36 | - if(is_dir($template_path)) return true; |
|
36 | + if(is_dir($template_path)) { |
|
37 | + return true; |
|
38 | + } |
|
37 | 39 | } |
38 | 40 | } |
39 | 41 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | |
4 | -require_once(_XE_PATH_ . 'modules/comment/comment.item.php'); |
|
4 | +require_once(_XE_PATH_.'modules/comment/comment.item.php'); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * comment |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // 2008. 02. 22 add comment setting when a new module added |
37 | 37 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); |
38 | 38 | |
39 | - if(!is_dir('./files/cache/tmp')) |
|
39 | + if (!is_dir('./files/cache/tmp')) |
|
40 | 40 | { |
41 | 41 | FileHandler::makeDir('./files/cache/tmp'); |
42 | 42 | } |
@@ -54,63 +54,63 @@ discard block |
||
54 | 54 | $oModuleModel = getModel('module'); |
55 | 55 | $oModuleController = getController('module'); |
56 | 56 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
57 | - if($oModuleModel->needUpdate($version_update_id)) |
|
57 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
58 | 58 | { |
59 | 59 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
60 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
60 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
61 | 61 | { |
62 | 62 | return TRUE; |
63 | 63 | } |
64 | 64 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
65 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
65 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
66 | 66 | { |
67 | 67 | return TRUE; |
68 | 68 | } |
69 | 69 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
70 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
70 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
71 | 71 | { |
72 | 72 | return TRUE; |
73 | 73 | } |
74 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
74 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
75 | 75 | { |
76 | 76 | return TRUE; |
77 | 77 | } |
78 | 78 | // 2008. 02. 22 add comment setting when a new module added |
79 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
79 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
80 | 80 | { |
81 | 81 | return TRUE; |
82 | 82 | } |
83 | 83 | // 2008. 05. 14 add a column for blamed count |
84 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
84 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
85 | 85 | { |
86 | 86 | return TRUE; |
87 | 87 | } |
88 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
88 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
89 | 89 | { |
90 | 90 | return TRUE; |
91 | 91 | } |
92 | 92 | |
93 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
93 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
94 | 94 | { |
95 | 95 | return TRUE; |
96 | 96 | } |
97 | 97 | //2012. 02. 24 add comment published status column and index |
98 | - if(!$oDB->isColumnExists("comments", "status")) |
|
98 | + if (!$oDB->isColumnExists("comments", "status")) |
|
99 | 99 | { |
100 | 100 | return TRUE; |
101 | 101 | } |
102 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
102 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
103 | 103 | { |
104 | 104 | return TRUE; |
105 | 105 | } |
106 | 106 | |
107 | 107 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
108 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
108 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
109 | 109 | { |
110 | 110 | return TRUE; |
111 | 111 | } |
112 | 112 | |
113 | - if(!$oDB->isIndexExists("comments", "idx_parent_srl")) |
|
113 | + if (!$oDB->isIndexExists("comments", "idx_parent_srl")) |
|
114 | 114 | { |
115 | 115 | return TRUE; |
116 | 116 | } |
@@ -131,46 +131,46 @@ discard block |
||
131 | 131 | $oModuleModel = getModel('module'); |
132 | 132 | $oModuleController = getController('module'); |
133 | 133 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
134 | - if($oModuleModel->needUpdate($version_update_id)) |
|
134 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
135 | 135 | { |
136 | 136 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
137 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
137 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
138 | 138 | { |
139 | 139 | $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); |
140 | 140 | } |
141 | 141 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
142 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
142 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
143 | 143 | { |
144 | 144 | $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); |
145 | 145 | } |
146 | 146 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
147 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
147 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
148 | 148 | { |
149 | 149 | $oDB->addColumn("comments", "voted_count", "number", "11"); |
150 | 150 | $oDB->addIndex("comments", "idx_voted_count", array("voted_count")); |
151 | 151 | } |
152 | 152 | |
153 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
153 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
154 | 154 | { |
155 | 155 | $oDB->addColumn("comments", "notify_message", "char", "1"); |
156 | 156 | } |
157 | 157 | // 2008. 02. 22 add comment setting when a new module added |
158 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
158 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
159 | 159 | { |
160 | 160 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); |
161 | 161 | } |
162 | 162 | // 2008. 05. 14 add a column for blamed count |
163 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
163 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
164 | 164 | { |
165 | 165 | $oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE); |
166 | 166 | $oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count')); |
167 | 167 | } |
168 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
168 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
169 | 169 | { |
170 | 170 | $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE); |
171 | 171 | } |
172 | 172 | |
173 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
173 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
174 | 174 | { |
175 | 175 | $oDB->addIndex( |
176 | 176 | "comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | //2012. 02. 24 add comment published status column and index |
181 | - if(!$oDB->isColumnExists("comments", "status")) |
|
181 | + if (!$oDB->isColumnExists("comments", "status")) |
|
182 | 182 | { |
183 | 183 | $oDB->addColumn("comments", "status", "number", 1, 1, TRUE); |
184 | 184 | } |
185 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
185 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
186 | 186 | { |
187 | 187 | $oDB->addIndex( |
188 | 188 | "comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
193 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
193 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
194 | 194 | { |
195 | 195 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'); |
196 | 196 | } |
197 | 197 | |
198 | - if(!$oDB->isIndexExists("comments", "idx_parent_srl")) |
|
198 | + if (!$oDB->isIndexExists("comments", "idx_parent_srl")) |
|
199 | 199 | { |
200 | 200 | $oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl')); |
201 | 201 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | function recompileCache() |
214 | 214 | { |
215 | - if(!is_dir('./files/cache/tmp')) |
|
215 | + if (!is_dir('./files/cache/tmp')) |
|
216 | 216 | { |
217 | 217 | FileHandler::makeDir('./files/cache/tmp'); |
218 | 218 | } |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | |
44 | 44 | // if member_srl exists, set memberInfo |
45 | 45 | $member_srl = Context::get('member_srl'); |
46 | - if($member_srl) |
|
46 | + if ($member_srl) |
|
47 | 47 | { |
48 | 48 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
49 | - if(!$this->memberInfo) |
|
49 | + if (!$this->memberInfo) |
|
50 | 50 | { |
51 | - Context::set('member_srl',''); |
|
51 | + Context::set('member_srl', ''); |
|
52 | 52 | } |
53 | 53 | else |
54 | 54 | { |
55 | - Context::set('member_info',$this->memberInfo); |
|
55 | + Context::set('member_info', $this->memberInfo); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -79,30 +79,30 @@ discard block |
||
79 | 79 | |
80 | 80 | $filter = Context::get('filter_type'); |
81 | 81 | global $lang; |
82 | - switch($filter) |
|
82 | + switch ($filter) |
|
83 | 83 | { |
84 | - case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break; |
|
85 | - case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break; |
|
86 | - default : Context::set('filter_type_title', $lang->cmd_show_all_member);break; |
|
84 | + case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break; |
|
85 | + case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break; |
|
86 | + default : Context::set('filter_type_title', $lang->cmd_show_all_member); break; |
|
87 | 87 | } |
88 | 88 | // retrieve list of groups for each member |
89 | - if($output->data) |
|
89 | + if ($output->data) |
|
90 | 90 | { |
91 | - foreach($output->data as $key => $member) |
|
91 | + foreach ($output->data as $key => $member) |
|
92 | 92 | { |
93 | - $output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0); |
|
93 | + $output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | $config = $this->memberConfig; |
97 | 97 | $memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name'); |
98 | 98 | $usedIdentifiers = array(); |
99 | 99 | |
100 | - if(is_array($config->signupForm)) |
|
100 | + if (is_array($config->signupForm)) |
|
101 | 101 | { |
102 | - foreach($config->signupForm as $signupItem) |
|
102 | + foreach ($config->signupForm as $signupItem) |
|
103 | 103 | { |
104 | - if(!count($memberIdentifiers)) break; |
|
105 | - if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse)) |
|
104 | + if (!count($memberIdentifiers)) break; |
|
105 | + if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse)) |
|
106 | 106 | { |
107 | 107 | unset($memberIdentifiers[$signupItem->name]); |
108 | 108 | $usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name}; |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | { |
141 | 141 | $config = $this->memberConfig; |
142 | 142 | |
143 | - if($config->redirect_url) |
|
143 | + if ($config->redirect_url) |
|
144 | 144 | { |
145 | 145 | $mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url); |
146 | 146 | |
147 | 147 | $siteModuleInfo = Context::get('site_module_info'); |
148 | 148 | |
149 | 149 | $oModuleModel = getModel('module'); |
150 | - $moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl); |
|
150 | + $moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl); |
|
151 | 151 | |
152 | 152 | $config->redirect_url = $moduleInfo->module_srl; |
153 | 153 | Context::set('config', $config); |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | Context::set('editor', $editor); |
174 | 174 | |
175 | 175 | $signupForm = $config->signupForm; |
176 | - foreach($signupForm as $val) |
|
176 | + foreach ($signupForm as $val) |
|
177 | 177 | { |
178 | - if($val->name == 'user_id') |
|
178 | + if ($val->name == 'user_id') |
|
179 | 179 | { |
180 | 180 | $userIdInfo = $val; |
181 | 181 | break; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | $oSecurity = new Security(); |
186 | - if($userIdInfo->isUse) |
|
186 | + if ($userIdInfo->isUse) |
|
187 | 187 | { |
188 | 188 | // get denied ID list |
189 | 189 | Context::set('useUserID', 1); |
@@ -274,16 +274,16 @@ discard block |
||
274 | 274 | Context::set('editor', $editor); |
275 | 275 | |
276 | 276 | $signupForm = $config->signupForm; |
277 | - foreach($signupForm as $val) |
|
277 | + foreach ($signupForm as $val) |
|
278 | 278 | { |
279 | - if($val->name == 'user_id') |
|
279 | + if ($val->name == 'user_id') |
|
280 | 280 | { |
281 | 281 | $userIdInfo = $val; |
282 | 282 | break; |
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
286 | - if($userIdInfo->isUse) |
|
286 | + if ($userIdInfo->isUse) |
|
287 | 287 | { |
288 | 288 | // get denied ID list |
289 | 289 | Context::set('useUserID', 1); |
@@ -344,14 +344,14 @@ discard block |
||
344 | 344 | $oMemberModel = getModel('member'); |
345 | 345 | |
346 | 346 | $memberInfo = Context::get('member_info'); |
347 | - if(isset($memberInfo)) |
|
347 | + if (isset($memberInfo)) |
|
348 | 348 | { |
349 | 349 | $memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl); |
350 | 350 | } |
351 | 351 | Context::set('member_info', $memberInfo); |
352 | 352 | |
353 | 353 | // get an editor for the signature |
354 | - if($memberInfo->member_srl) |
|
354 | + if ($memberInfo->member_srl) |
|
355 | 355 | { |
356 | 356 | $oEditorModel = getModel('editor'); |
357 | 357 | $option = new stdClass(); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | } |
406 | 406 | |
407 | 407 | $member_config = $this->memberConfig; |
408 | - if(!$this->memberConfig) |
|
408 | + if (!$this->memberConfig) |
|
409 | 409 | { |
410 | 410 | $member_config = $this->memberConfig = $oMemberModel->getMemberConfig(); |
411 | 411 | } |
@@ -416,25 +416,25 @@ discard block |
||
416 | 416 | $formTags = array(); |
417 | 417 | global $lang; |
418 | 418 | |
419 | - foreach($member_config->signupForm as $no=>$formInfo) |
|
419 | + foreach ($member_config->signupForm as $no=>$formInfo) |
|
420 | 420 | { |
421 | - if(!$formInfo->isUse)continue; |
|
421 | + if (!$formInfo->isUse)continue; |
|
422 | 422 | |
423 | 423 | // 회원 본인이 아닌 경우 입력 폼 제거 |
424 | - if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl) |
|
424 | + if ($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl) |
|
425 | 425 | { |
426 | 426 | unset($member_config->signupForm[$no]); |
427 | 427 | continue; |
428 | 428 | } |
429 | 429 | |
430 | - if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue; |
|
430 | + if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue; |
|
431 | 431 | |
432 | 432 | $formTag = new stdClass(); |
433 | 433 | $inputTag = ''; |
434 | 434 | $formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title; |
435 | - if($isAdmin) |
|
435 | + if ($isAdmin) |
|
436 | 436 | { |
437 | - if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
437 | + if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
438 | 438 | } |
439 | 439 | else |
440 | 440 | { |
@@ -442,28 +442,28 @@ discard block |
||
442 | 442 | } |
443 | 443 | $formTag->name = $formInfo->name; |
444 | 444 | |
445 | - if($formInfo->isDefaultForm) |
|
445 | + if ($formInfo->isDefaultForm) |
|
446 | 446 | { |
447 | - if($formInfo->imageType) |
|
447 | + if ($formInfo->imageType) |
|
448 | 448 | { |
449 | 449 | $formTag->type = 'image'; |
450 | - if($formInfo->name == 'profile_image') |
|
450 | + if ($formInfo->name == 'profile_image') |
|
451 | 451 | { |
452 | 452 | $target = $memberInfo['profile_image']; |
453 | 453 | $functionName = 'doDeleteProfileImage'; |
454 | 454 | } |
455 | - else if($formInfo->name == 'image_name') |
|
455 | + else if ($formInfo->name == 'image_name') |
|
456 | 456 | { |
457 | 457 | $target = $memberInfo['image_name']; |
458 | 458 | $functionName = 'doDeleteImageName'; |
459 | 459 | } |
460 | - else if($formInfo->name == 'image_mark') |
|
460 | + else if ($formInfo->name == 'image_mark') |
|
461 | 461 | { |
462 | 462 | $target = $memberInfo['image_mark']; |
463 | 463 | $functionName = 'doDeleteImageMark'; |
464 | 464 | } |
465 | 465 | |
466 | - if($target->src) |
|
466 | + if ($target->src) |
|
467 | 467 | { |
468 | 468 | $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>', |
469 | 469 | $formInfo->name, |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $lang->{$formInfo->name.'_max_height'}, |
487 | 487 | $member_config->{$formInfo->name.'_max_height'}); |
488 | 488 | }//end imageType |
489 | - else if($formInfo->name == 'birthday') |
|
489 | + else if ($formInfo->name == 'birthday') |
|
490 | 490 | { |
491 | 491 | $formTag->type = 'date'; |
492 | 492 | $inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />', |
@@ -494,16 +494,16 @@ discard block |
||
494 | 494 | zdate($memberInfo['birthday'], 'Y-m-d', false), |
495 | 495 | $lang->cmd_delete); |
496 | 496 | } |
497 | - else if($formInfo->name == 'find_account_question') |
|
497 | + else if ($formInfo->name == 'find_account_question') |
|
498 | 498 | { |
499 | 499 | $disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : ''; |
500 | 500 | |
501 | 501 | $formTag->type = 'select'; |
502 | 502 | $inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0" %s>%s</select>'; |
503 | 503 | $optionTag = array(); |
504 | - foreach($lang->find_account_question_items as $key=>$val) |
|
504 | + foreach ($lang->find_account_question_items as $key=>$val) |
|
505 | 505 | { |
506 | - if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"'; |
|
506 | + if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"'; |
|
507 | 507 | else $selected = ''; |
508 | 508 | $optionTag[] = sprintf('<option value="%s" %s >%s</option>', |
509 | 509 | $key, |
@@ -511,24 +511,24 @@ discard block |
||
511 | 511 | $val); |
512 | 512 | } |
513 | 513 | $inputTag = sprintf($inputTag, $disabled, implode('', $optionTag)); |
514 | - $inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" ' . $disabled . ' />'; |
|
514 | + $inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" '.$disabled.' />'; |
|
515 | 515 | |
516 | - if($disabled) { |
|
517 | - $inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>'; |
|
516 | + if ($disabled) { |
|
517 | + $inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> '.Context::getLang('cmd_modify').'</label>'; |
|
518 | 518 | $inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>'; |
519 | 519 | } |
520 | 520 | } |
521 | - else if($formInfo->name == 'email_address') |
|
521 | + else if ($formInfo->name == 'email_address') |
|
522 | 522 | { |
523 | 523 | $formTag->type = 'email'; |
524 | 524 | $inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />'; |
525 | 525 | } |
526 | - else if($formInfo->name == 'homepage') |
|
526 | + else if ($formInfo->name == 'homepage') |
|
527 | 527 | { |
528 | 528 | $formTag->type = 'url'; |
529 | 529 | $inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />'; |
530 | 530 | } |
531 | - else if($formInfo->name == 'blog') |
|
531 | + else if ($formInfo->name == 'blog') |
|
532 | 532 | { |
533 | 533 | $formTag->type = 'url'; |
534 | 534 | $inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />'; |
@@ -549,92 +549,92 @@ discard block |
||
549 | 549 | $extentionReplace = array(); |
550 | 550 | |
551 | 551 | $formTag->type = $extendForm->column_type; |
552 | - if($extendForm->column_type == 'text') |
|
552 | + if ($extendForm->column_type == 'text') |
|
553 | 553 | { |
554 | 554 | $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />'; |
555 | 555 | } |
556 | - else if($extendForm->column_type == 'homepage') |
|
556 | + else if ($extendForm->column_type == 'homepage') |
|
557 | 557 | { |
558 | 558 | $template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />'; |
559 | 559 | } |
560 | - else if($extendForm->column_type == 'email_address') |
|
560 | + else if ($extendForm->column_type == 'email_address') |
|
561 | 561 | { |
562 | 562 | $template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />'; |
563 | 563 | } |
564 | - else if($extendForm->column_type == 'tel') |
|
564 | + else if ($extendForm->column_type == 'tel') |
|
565 | 565 | { |
566 | 566 | $extentionReplace = array('tel_0' => $extendForm->value[0], |
567 | 567 | 'tel_1' => $extendForm->value[1], |
568 | 568 | 'tel_2' => $extendForm->value[2]); |
569 | 569 | $template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />'; |
570 | 570 | } |
571 | - else if($extendForm->column_type == 'textarea') |
|
571 | + else if ($extendForm->column_type == 'textarea') |
|
572 | 572 | { |
573 | 573 | $template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>'; |
574 | 574 | } |
575 | - else if($extendForm->column_type == 'checkbox') |
|
575 | + else if ($extendForm->column_type == 'checkbox') |
|
576 | 576 | { |
577 | 577 | $template = ''; |
578 | - if($extendForm->default_value) |
|
578 | + if ($extendForm->default_value) |
|
579 | 579 | { |
580 | 580 | $template = '<div style="padding-top:5px">%s</div>'; |
581 | 581 | $__i = 0; |
582 | 582 | $optionTag = array(); |
583 | - foreach($extendForm->default_value as $v) |
|
583 | + foreach ($extendForm->default_value as $v) |
|
584 | 584 | { |
585 | 585 | $checked = ''; |
586 | - if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"'; |
|
586 | + if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"'; |
|
587 | 587 | $optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>'; |
588 | 588 | $__i++; |
589 | 589 | } |
590 | 590 | $template = sprintf($template, implode('', $optionTag)); |
591 | 591 | } |
592 | 592 | } |
593 | - else if($extendForm->column_type == 'radio') |
|
593 | + else if ($extendForm->column_type == 'radio') |
|
594 | 594 | { |
595 | 595 | $template = ''; |
596 | - if($extendForm->default_value) |
|
596 | + if ($extendForm->default_value) |
|
597 | 597 | { |
598 | 598 | $template = '<div style="padding-top:5px">%s</div>'; |
599 | 599 | $optionTag = array(); |
600 | - foreach($extendForm->default_value as $v) |
|
600 | + foreach ($extendForm->default_value as $v) |
|
601 | 601 | { |
602 | - if($extendForm->value == $v)$checked = 'checked="checked"'; |
|
602 | + if ($extendForm->value == $v)$checked = 'checked="checked"'; |
|
603 | 603 | else $checked = ''; |
604 | 604 | $optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>'; |
605 | 605 | } |
606 | 606 | $template = sprintf($template, implode('', $optionTag)); |
607 | 607 | } |
608 | 608 | } |
609 | - else if($extendForm->column_type == 'select') |
|
609 | + else if ($extendForm->column_type == 'select') |
|
610 | 610 | { |
611 | 611 | $template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>'; |
612 | 612 | $optionTag = array(); |
613 | 613 | $optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select); |
614 | - if($extendForm->default_value) |
|
614 | + if ($extendForm->default_value) |
|
615 | 615 | { |
616 | - foreach($extendForm->default_value as $v) |
|
616 | + foreach ($extendForm->default_value as $v) |
|
617 | 617 | { |
618 | - if($v == $extendForm->value) $selected = 'selected="selected"'; |
|
618 | + if ($v == $extendForm->value) $selected = 'selected="selected"'; |
|
619 | 619 | else $selected = ''; |
620 | 620 | $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v); |
621 | 621 | } |
622 | 622 | } |
623 | 623 | $template = sprintf($template, implode('', $optionTag)); |
624 | 624 | } |
625 | - else if($extendForm->column_type == 'kr_zip') |
|
625 | + else if ($extendForm->column_type == 'kr_zip') |
|
626 | 626 | { |
627 | 627 | $krzipModel = getModel('krzip'); |
628 | - if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' )) |
|
628 | + if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml')) |
|
629 | 629 | { |
630 | 630 | $template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value); |
631 | 631 | } |
632 | 632 | } |
633 | - else if($extendForm->column_type == 'jp_zip') |
|
633 | + else if ($extendForm->column_type == 'jp_zip') |
|
634 | 634 | { |
635 | 635 | $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />'; |
636 | 636 | } |
637 | - else if($extendForm->column_type == 'date') |
|
637 | + else if ($extendForm->column_type == 'date') |
|
638 | 638 | { |
639 | 639 | $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete); |
640 | 640 | $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />'; |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | $replace = array_merge($extentionReplace, $replace); |
644 | 644 | $inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template); |
645 | 645 | |
646 | - if($extendForm->description) |
|
646 | + if ($extendForm->description) |
|
647 | 647 | $inputTag .= '<p class="help-block">'.$extendForm->description.'</p>'; |
648 | 648 | } |
649 | 649 | $formTag->inputTag = $inputTag; |
@@ -674,12 +674,12 @@ discard block |
||
674 | 674 | function dispMemberAdminInsertJoinForm() { |
675 | 675 | // Get the value of join_form |
676 | 676 | $member_join_form_srl = Context::get('member_join_form_srl'); |
677 | - if($member_join_form_srl) |
|
677 | + if ($member_join_form_srl) |
|
678 | 678 | { |
679 | 679 | $oMemberModel = getModel('member'); |
680 | 680 | $join_form = $oMemberModel->getJoinForm($member_join_form_srl); |
681 | 681 | |
682 | - if(!$join_form) Context::set('member_join_form_srl','',true); |
|
682 | + if (!$join_form) Context::set('member_join_form_srl', '', true); |
|
683 | 683 | else |
684 | 684 | { |
685 | 685 | Context::set('join_form', $join_form); |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | if(!$this->memberInfo) |
50 | 50 | { |
51 | 51 | Context::set('member_srl',''); |
52 | - } |
|
53 | - else |
|
52 | + } else |
|
54 | 53 | { |
55 | 54 | Context::set('member_info',$this->memberInfo); |
56 | 55 | } |
@@ -101,7 +100,9 @@ discard block |
||
101 | 100 | { |
102 | 101 | foreach($config->signupForm as $signupItem) |
103 | 102 | { |
104 | - if(!count($memberIdentifiers)) break; |
|
103 | + if(!count($memberIdentifiers)) { |
|
104 | + break; |
|
105 | + } |
|
105 | 106 | if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse)) |
106 | 107 | { |
107 | 108 | unset($memberIdentifiers[$signupItem->name]); |
@@ -316,7 +317,9 @@ discard block |
||
316 | 317 | $extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo); |
317 | 318 | Context::set('extend_form_list', $extendForm); |
318 | 319 | $memberInfo = get_object_vars(Context::get('member_info')); |
319 | - if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array(); |
|
320 | + if (!is_array($memberInfo['group_list'])) { |
|
321 | + $memberInfo['group_list'] = array(); |
|
322 | + } |
|
320 | 323 | Context::set('memberInfo', $memberInfo); |
321 | 324 | |
322 | 325 | $disableColumns = array('password', 'find_account_question', 'find_account_answer'); |
@@ -418,7 +421,9 @@ discard block |
||
418 | 421 | |
419 | 422 | foreach($member_config->signupForm as $no=>$formInfo) |
420 | 423 | { |
421 | - if(!$formInfo->isUse)continue; |
|
424 | + if(!$formInfo->isUse) { |
|
425 | + continue; |
|
426 | + } |
|
422 | 427 | |
423 | 428 | // 회원 본인이 아닌 경우 입력 폼 제거 |
424 | 429 | if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl) |
@@ -427,18 +432,23 @@ discard block |
||
427 | 432 | continue; |
428 | 433 | } |
429 | 434 | |
430 | - if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue; |
|
435 | + if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') { |
|
436 | + continue; |
|
437 | + } |
|
431 | 438 | |
432 | 439 | $formTag = new stdClass(); |
433 | 440 | $inputTag = ''; |
434 | 441 | $formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title; |
435 | 442 | if($isAdmin) |
436 | 443 | { |
437 | - if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
438 | - } |
|
439 | - else |
|
444 | + if($formInfo->mustRequired) { |
|
445 | + $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
446 | + } |
|
447 | + } else |
|
440 | 448 | { |
441 | - if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
449 | + if ($formInfo->required && $formInfo->name != 'password') { |
|
450 | + $formTag->title = '<em style="color:red">*</em> '.$formTag->title; |
|
451 | + } |
|
442 | 452 | } |
443 | 453 | $formTag->name = $formInfo->name; |
444 | 454 | |
@@ -451,13 +461,11 @@ discard block |
||
451 | 461 | { |
452 | 462 | $target = $memberInfo['profile_image']; |
453 | 463 | $functionName = 'doDeleteProfileImage'; |
454 | - } |
|
455 | - else if($formInfo->name == 'image_name') |
|
464 | + } else if($formInfo->name == 'image_name') |
|
456 | 465 | { |
457 | 466 | $target = $memberInfo['image_name']; |
458 | 467 | $functionName = 'doDeleteImageName'; |
459 | - } |
|
460 | - else if($formInfo->name == 'image_mark') |
|
468 | + } else if($formInfo->name == 'image_mark') |
|
461 | 469 | { |
462 | 470 | $target = $memberInfo['image_mark']; |
463 | 471 | $functionName = 'doDeleteImageMark'; |
@@ -473,8 +481,7 @@ discard block |
||
473 | 481 | $functionName, |
474 | 482 | $memberInfo['member_srl'], |
475 | 483 | $lang->cmd_delete); |
476 | - } |
|
477 | - else |
|
484 | + } else |
|
478 | 485 | { |
479 | 486 | $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name); |
480 | 487 | } |
@@ -493,8 +500,7 @@ discard block |
||
493 | 500 | $memberInfo['birthday'], |
494 | 501 | zdate($memberInfo['birthday'], 'Y-m-d', false), |
495 | 502 | $lang->cmd_delete); |
496 | - } |
|
497 | - else if($formInfo->name == 'find_account_question') |
|
503 | + } else if($formInfo->name == 'find_account_question') |
|
498 | 504 | { |
499 | 505 | $disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : ''; |
500 | 506 | |
@@ -503,8 +509,11 @@ discard block |
||
503 | 509 | $optionTag = array(); |
504 | 510 | foreach($lang->find_account_question_items as $key=>$val) |
505 | 511 | { |
506 | - if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"'; |
|
507 | - else $selected = ''; |
|
512 | + if($key == $memberInfo['find_account_question']) { |
|
513 | + $selected = 'selected="selected"'; |
|
514 | + } else { |
|
515 | + $selected = ''; |
|
516 | + } |
|
508 | 517 | $optionTag[] = sprintf('<option value="%s" %s >%s</option>', |
509 | 518 | $key, |
510 | 519 | $selected, |
@@ -517,23 +526,19 @@ discard block |
||
517 | 526 | $inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>'; |
518 | 527 | $inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>'; |
519 | 528 | } |
520 | - } |
|
521 | - else if($formInfo->name == 'email_address') |
|
529 | + } else if($formInfo->name == 'email_address') |
|
522 | 530 | { |
523 | 531 | $formTag->type = 'email'; |
524 | 532 | $inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />'; |
525 | - } |
|
526 | - else if($formInfo->name == 'homepage') |
|
533 | + } else if($formInfo->name == 'homepage') |
|
527 | 534 | { |
528 | 535 | $formTag->type = 'url'; |
529 | 536 | $inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />'; |
530 | - } |
|
531 | - else if($formInfo->name == 'blog') |
|
537 | + } else if($formInfo->name == 'blog') |
|
532 | 538 | { |
533 | 539 | $formTag->type = 'url'; |
534 | 540 | $inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />'; |
535 | - } |
|
536 | - else |
|
541 | + } else |
|
537 | 542 | { |
538 | 543 | $formTag->type = 'text'; |
539 | 544 | $inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />', |
@@ -552,27 +557,22 @@ discard block |
||
552 | 557 | if($extendForm->column_type == 'text') |
553 | 558 | { |
554 | 559 | $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />'; |
555 | - } |
|
556 | - else if($extendForm->column_type == 'homepage') |
|
560 | + } else if($extendForm->column_type == 'homepage') |
|
557 | 561 | { |
558 | 562 | $template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />'; |
559 | - } |
|
560 | - else if($extendForm->column_type == 'email_address') |
|
563 | + } else if($extendForm->column_type == 'email_address') |
|
561 | 564 | { |
562 | 565 | $template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />'; |
563 | - } |
|
564 | - else if($extendForm->column_type == 'tel') |
|
566 | + } else if($extendForm->column_type == 'tel') |
|
565 | 567 | { |
566 | 568 | $extentionReplace = array('tel_0' => $extendForm->value[0], |
567 | 569 | 'tel_1' => $extendForm->value[1], |
568 | 570 | 'tel_2' => $extendForm->value[2]); |
569 | 571 | $template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />'; |
570 | - } |
|
571 | - else if($extendForm->column_type == 'textarea') |
|
572 | + } else if($extendForm->column_type == 'textarea') |
|
572 | 573 | { |
573 | 574 | $template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>'; |
574 | - } |
|
575 | - else if($extendForm->column_type == 'checkbox') |
|
575 | + } else if($extendForm->column_type == 'checkbox') |
|
576 | 576 | { |
577 | 577 | $template = ''; |
578 | 578 | if($extendForm->default_value) |
@@ -583,14 +583,15 @@ discard block |
||
583 | 583 | foreach($extendForm->default_value as $v) |
584 | 584 | { |
585 | 585 | $checked = ''; |
586 | - if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"'; |
|
586 | + if(is_array($extendForm->value) && in_array($v, $extendForm->value)) { |
|
587 | + $checked = 'checked="checked"'; |
|
588 | + } |
|
587 | 589 | $optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>'; |
588 | 590 | $__i++; |
589 | 591 | } |
590 | 592 | $template = sprintf($template, implode('', $optionTag)); |
591 | 593 | } |
592 | - } |
|
593 | - else if($extendForm->column_type == 'radio') |
|
594 | + } else if($extendForm->column_type == 'radio') |
|
594 | 595 | { |
595 | 596 | $template = ''; |
596 | 597 | if($extendForm->default_value) |
@@ -599,14 +600,16 @@ discard block |
||
599 | 600 | $optionTag = array(); |
600 | 601 | foreach($extendForm->default_value as $v) |
601 | 602 | { |
602 | - if($extendForm->value == $v)$checked = 'checked="checked"'; |
|
603 | - else $checked = ''; |
|
603 | + if($extendForm->value == $v) { |
|
604 | + $checked = 'checked="checked"'; |
|
605 | + } else { |
|
606 | + $checked = ''; |
|
607 | + } |
|
604 | 608 | $optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>'; |
605 | 609 | } |
606 | 610 | $template = sprintf($template, implode('', $optionTag)); |
607 | 611 | } |
608 | - } |
|
609 | - else if($extendForm->column_type == 'select') |
|
612 | + } else if($extendForm->column_type == 'select') |
|
610 | 613 | { |
611 | 614 | $template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>'; |
612 | 615 | $optionTag = array(); |
@@ -615,26 +618,26 @@ discard block |
||
615 | 618 | { |
616 | 619 | foreach($extendForm->default_value as $v) |
617 | 620 | { |
618 | - if($v == $extendForm->value) $selected = 'selected="selected"'; |
|
619 | - else $selected = ''; |
|
621 | + if($v == $extendForm->value) { |
|
622 | + $selected = 'selected="selected"'; |
|
623 | + } else { |
|
624 | + $selected = ''; |
|
625 | + } |
|
620 | 626 | $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v); |
621 | 627 | } |
622 | 628 | } |
623 | 629 | $template = sprintf($template, implode('', $optionTag)); |
624 | - } |
|
625 | - else if($extendForm->column_type == 'kr_zip') |
|
630 | + } else if($extendForm->column_type == 'kr_zip') |
|
626 | 631 | { |
627 | 632 | $krzipModel = getModel('krzip'); |
628 | 633 | if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' )) |
629 | 634 | { |
630 | 635 | $template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value); |
631 | 636 | } |
632 | - } |
|
633 | - else if($extendForm->column_type == 'jp_zip') |
|
637 | + } else if($extendForm->column_type == 'jp_zip') |
|
634 | 638 | { |
635 | 639 | $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />'; |
636 | - } |
|
637 | - else if($extendForm->column_type == 'date') |
|
640 | + } else if($extendForm->column_type == 'date') |
|
638 | 641 | { |
639 | 642 | $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete); |
640 | 643 | $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />'; |
@@ -643,8 +646,9 @@ discard block |
||
643 | 646 | $replace = array_merge($extentionReplace, $replace); |
644 | 647 | $inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template); |
645 | 648 | |
646 | - if($extendForm->description) |
|
647 | - $inputTag .= '<p class="help-block">'.$extendForm->description.'</p>'; |
|
649 | + if($extendForm->description) { |
|
650 | + $inputTag .= '<p class="help-block">'.$extendForm->description.'</p>'; |
|
651 | + } |
|
648 | 652 | } |
649 | 653 | $formTag->inputTag = $inputTag; |
650 | 654 | $formTags[] = $formTag; |
@@ -679,8 +683,9 @@ discard block |
||
679 | 683 | $oMemberModel = getModel('member'); |
680 | 684 | $join_form = $oMemberModel->getJoinForm($member_join_form_srl); |
681 | 685 | |
682 | - if(!$join_form) Context::set('member_join_form_srl','',true); |
|
683 | - else |
|
686 | + if(!$join_form) { |
|
687 | + Context::set('member_join_form_srl','',true); |
|
688 | + } else |
|
684 | 689 | { |
685 | 690 | Context::set('join_form', $join_form); |
686 | 691 | $security = new Security(); |
@@ -386,7 +386,7 @@ |
||
386 | 386 | /** |
387 | 387 | * Get tags by the member info type |
388 | 388 | * |
389 | - * @param object $memberInfo |
|
389 | + * @param string $memberInfo |
|
390 | 390 | * @param boolean $isAdmin (true : admin, false : not admin) |
391 | 391 | * |
392 | 392 | * @return array |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | $oModuleModel = getModel('module'); |
30 | 30 | $oModuleController = getController('module'); |
31 | 31 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
32 | - if($oModuleModel->needUpdate($version_update_id)) |
|
32 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
33 | 33 | { |
34 | 34 | $config = $oModuleModel->getModuleConfig('message'); |
35 | 35 | |
36 | - if($config->skin) |
|
36 | + if ($config->skin) |
|
37 | 37 | { |
38 | 38 | $config_parse = explode('.', $config->skin); |
39 | - if(count($config_parse) > 1) |
|
39 | + if (count($config_parse) > 1) |
|
40 | 40 | { |
41 | 41 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
42 | - if(is_dir($template_path)) |
|
42 | + if (is_dir($template_path)) |
|
43 | 43 | { |
44 | 44 | return TRUE; |
45 | 45 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $oModuleController->insertUpdatedLog($version_update_id); |
50 | 50 | } |
51 | 51 | |
52 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
52 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
53 | 53 | { |
54 | 54 | return TRUE; |
55 | 55 | } |
@@ -66,21 +66,21 @@ discard block |
||
66 | 66 | $oModuleModel = getModel('module'); |
67 | 67 | $oModuleController = getController('module'); |
68 | 68 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
69 | - if($oModuleModel->needUpdate($version_update_id)) |
|
69 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
70 | 70 | { |
71 | 71 | $config = $oModuleModel->getModuleConfig('message'); |
72 | - if(!is_object($config)) |
|
72 | + if (!is_object($config)) |
|
73 | 73 | { |
74 | 74 | $config = new stdClass(); |
75 | 75 | } |
76 | 76 | |
77 | - if($config->skin) |
|
77 | + if ($config->skin) |
|
78 | 78 | { |
79 | 79 | $config_parse = explode('.', $config->skin); |
80 | - if(count($config_parse) > 1) |
|
80 | + if (count($config_parse) > 1) |
|
81 | 81 | { |
82 | 82 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
83 | - if(is_dir($template_path)) |
|
83 | + if (is_dir($template_path)) |
|
84 | 84 | { |
85 | 85 | $config->skin = implode('|@|', $config_parse); |
86 | 86 | $oModuleController = getController('module'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $oModuleController->insertUpdatedLog($version_update_id); |
93 | 93 | } |
94 | 94 | |
95 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
95 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
96 | 96 | { |
97 | 97 | FileHandler::makeDir('./files/member_extra_info/new_message_flags'); |
98 | 98 | } |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | $oModuleModel = getModel('module'); |
39 | 39 | $oModuleController = getController('module'); |
40 | 40 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
41 | - if($oModuleModel->needUpdate($version_update_id)) |
|
41 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
42 | 42 | { |
43 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
43 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
44 | 44 | { |
45 | 45 | return TRUE; |
46 | 46 | } |
47 | 47 | |
48 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
48 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
49 | 49 | { |
50 | 50 | return TRUE; |
51 | 51 | } |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | $oModuleModel = getModel('module'); |
70 | 70 | $oModuleController = getController('module'); |
71 | 71 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
72 | - if($oModuleModel->needUpdate($version_update_id)) |
|
72 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
73 | 73 | { |
74 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
74 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
75 | 75 | { |
76 | 76 | $oDB->addColumn('counter_log', 'site_srl', 'number', 11, 0, TRUE); |
77 | 77 | } |
78 | 78 | |
79 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
79 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
80 | 80 | { |
81 | 81 | $oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE); |
82 | 82 | } |
@@ -29,10 +29,14 @@ discard block |
||
29 | 29 | if($oModuleModel->needUpdate($version_update_id)) |
30 | 30 | { |
31 | 31 | $output = executeQuery('page.pageTypeOpageCheck'); |
32 | - if($output->toBool() && $output->data) return true; |
|
32 | + if($output->toBool() && $output->data) { |
|
33 | + return true; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | $output = executeQuery('page.pageTypeNullCheck'); |
35 | - if($output->toBool() && $output->data) return true; |
|
37 | + if($output->toBool() && $output->data) { |
|
38 | + return true; |
|
39 | + } |
|
36 | 40 | |
37 | 41 | $oModuleController->insertUpdatedLog($version_update_id); |
38 | 42 | } |
@@ -63,7 +67,9 @@ discard block |
||
63 | 67 | $in_out = executeQuery('page.insertPageType', $args); |
64 | 68 | } |
65 | 69 | $output = executeQuery('page.updateAllOpage'); |
66 | - if(!$output->toBool()) return $output; |
|
70 | + if(!$output->toBool()) { |
|
71 | + return $output; |
|
72 | + } |
|
67 | 73 | } |
68 | 74 | |
69 | 75 | // old page module instance update |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | $oModuleModel = getModel('module'); |
27 | 27 | $oModuleController = getController('module'); |
28 | 28 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
29 | - if($oModuleModel->needUpdate($version_update_id)) |
|
29 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
30 | 30 | { |
31 | 31 | $output = executeQuery('page.pageTypeOpageCheck'); |
32 | - if($output->toBool() && $output->data) return true; |
|
32 | + if ($output->toBool() && $output->data) return true; |
|
33 | 33 | |
34 | 34 | $output = executeQuery('page.pageTypeNullCheck'); |
35 | - if($output->toBool() && $output->data) return true; |
|
35 | + if ($output->toBool() && $output->data) return true; |
|
36 | 36 | |
37 | 37 | $oModuleController->insertUpdatedLog($version_update_id); |
38 | 38 | } |
@@ -48,44 +48,44 @@ discard block |
||
48 | 48 | $oModuleModel = getModel('module'); |
49 | 49 | $oModuleController = getController('module'); |
50 | 50 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
51 | - if($oModuleModel->needUpdate($version_update_id)) |
|
51 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
52 | 52 | { |
53 | 53 | $args = new stdClass; |
54 | 54 | // opage module instance update |
55 | 55 | $output = executeQueryArray('page.pageTypeOpageCheck'); |
56 | - if($output->toBool() && count($output->data) > 0) |
|
56 | + if ($output->toBool() && count($output->data) > 0) |
|
57 | 57 | { |
58 | - foreach($output->data as $val) |
|
58 | + foreach ($output->data as $val) |
|
59 | 59 | { |
60 | 60 | $args->module_srl = $val->module_srl; |
61 | 61 | $args->name = 'page_type'; |
62 | - $args->value= 'OUTSIDE'; |
|
62 | + $args->value = 'OUTSIDE'; |
|
63 | 63 | $in_out = executeQuery('page.insertPageType', $args); |
64 | 64 | } |
65 | 65 | $output = executeQuery('page.updateAllOpage'); |
66 | - if(!$output->toBool()) return $output; |
|
66 | + if (!$output->toBool()) return $output; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // old page module instance update |
70 | 70 | $output = executeQueryArray('page.pageTypeNullCheck'); |
71 | 71 | $skin_update_srls = array(); |
72 | - if($output->toBool() && $output->data) |
|
72 | + if ($output->toBool() && $output->data) |
|
73 | 73 | { |
74 | - foreach($output->data as $val) |
|
74 | + foreach ($output->data as $val) |
|
75 | 75 | { |
76 | 76 | $args->module_srl = $val->module_srl; |
77 | 77 | $args->name = 'page_type'; |
78 | - $args->value= 'WIDGET'; |
|
78 | + $args->value = 'WIDGET'; |
|
79 | 79 | $in_out = executeQuery('page.insertPageType', $args); |
80 | 80 | |
81 | 81 | $skin_update_srls[] = $val->module_srl; |
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | - if(count($skin_update_srls)>0) |
|
85 | + if (count($skin_update_srls) > 0) |
|
86 | 86 | { |
87 | 87 | $skin_args = new stdClass; |
88 | - $skin_args->module_srls = implode(',',$skin_update_srls); |
|
88 | + $skin_args->module_srls = implode(',', $skin_update_srls); |
|
89 | 89 | $skin_args->is_skin_fix = "Y"; |
90 | 90 | $ouput = executeQuery('page.updateSkinFix', $skin_args); |
91 | 91 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $oModuleController->insertUpdatedLog($version_update_id); |
94 | 94 | } |
95 | 95 | |
96 | - return new BaseObject(0,'success_updated'); |
|
96 | + return new BaseObject(0, 'success_updated'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |