@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | $oModuleModel = getModel('module'); |
35 | 35 | $skin_info = $oModuleModel->loadSkinInfo($path, $skin); |
36 | 36 | |
37 | - for($i=0;$i<count($skin_info->colorset);$i++) |
|
37 | + for ($i = 0; $i < count($skin_info->colorset); $i++) |
|
38 | 38 | { |
39 | 39 | $colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title); |
40 | 40 | $colorset_list[] = $colorset; |
41 | 41 | } |
42 | 42 | |
43 | - if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
43 | + if (count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
44 | 44 | $this->add('colorset_list', $colorsets); |
45 | 45 | } |
46 | 46 | |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | function procWidgetGenerateCode() |
51 | 51 | { |
52 | 52 | $widget = Context::get('selected_widget'); |
53 | - if(!$widget) return new Object(-1,'msg_invalid_request'); |
|
54 | - if(!Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
53 | + if (!$widget) return new Object(-1, 'msg_invalid_request'); |
|
54 | + if (!Context::get('skin')) return new Object(-1, Context::getLang('msg_widget_skin_is_null')); |
|
55 | 55 | |
56 | 56 | $attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars); |
57 | 57 | |
58 | - $widget_code = sprintf('<img class="zbxe_widget_output" widget="%s" %s />', $widget, implode(' ',$attribute)); |
|
58 | + $widget_code = sprintf('<img class="zbxe_widget_output" widget="%s" %s />', $widget, implode(' ', $attribute)); |
|
59 | 59 | // Code output |
60 | 60 | $this->add('widget_code', $widget_code); |
61 | 61 | } |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | function procWidgetGenerateCodeInPage() |
67 | 67 | { |
68 | 68 | $widget = Context::get('selected_widget'); |
69 | - if(!$widget) return new Object(-1,'msg_invalid_request'); |
|
69 | + if (!$widget) return new Object(-1, 'msg_invalid_request'); |
|
70 | 70 | |
71 | - if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
71 | + if (!in_array($widget, array('widgetBox', 'widgetContent')) && !Context::get('skin')) return new Object(-1, Context::getLang('msg_widget_skin_is_null')); |
|
72 | 72 | |
73 | 73 | $attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars); |
74 | 74 | // Wanted results |
@@ -107,26 +107,26 @@ discard block |
||
107 | 107 | $err = 0; |
108 | 108 | $oLayoutModel = getModel('layout'); |
109 | 109 | $layout_info = $oLayoutModel->getLayout($module_srl); |
110 | - if(!$layout_info || $layout_info->type != 'faceoff') $err++; |
|
110 | + if (!$layout_info || $layout_info->type != 'faceoff') $err++; |
|
111 | 111 | |
112 | 112 | // Destination Information Wanted page module |
113 | 113 | $oModuleModel = getModel('module'); |
114 | 114 | $columnList = array('module_srl', 'module'); |
115 | 115 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
116 | - if(!$page_info->module_srl || $page_info->module != 'page') $err++; |
|
116 | + if (!$page_info->module_srl || $page_info->module != 'page') $err++; |
|
117 | 117 | |
118 | - if($err > 1) return new Object(-1,'msg_invalid_request'); |
|
118 | + if ($err > 1) return new Object(-1, 'msg_invalid_request'); |
|
119 | 119 | |
120 | 120 | // Check permissions |
121 | 121 | $logged_info = Context::get('logged_info'); |
122 | - if(!$logged_info->member_srl) |
|
122 | + if (!$logged_info->member_srl) |
|
123 | 123 | { |
124 | - return new Object(-1,'msg_not_permitted'); |
|
124 | + return new Object(-1, 'msg_not_permitted'); |
|
125 | 125 | } |
126 | 126 | $module_grant = $oModuleModel->getGrant($page_info, $logged_info); |
127 | - if(!$module_grant->manager) |
|
127 | + if (!$module_grant->manager) |
|
128 | 128 | { |
129 | - return new Object(-1,'msg_not_permitted'); |
|
129 | + return new Object(-1, 'msg_not_permitted'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // Enter post |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $obj->document_srl = $document_srl; |
140 | 140 | |
141 | 141 | $oDocument = $oDocumentModel->getDocument($obj->document_srl, true); |
142 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
142 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
143 | 143 | { |
144 | 144 | $output = $oDocumentController->updateDocument($oDocument, $obj); |
145 | 145 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | // Stop when an error occurs |
153 | - if(!$output->toBool()) return $output; |
|
153 | + if (!$output->toBool()) return $output; |
|
154 | 154 | |
155 | 155 | // Return results |
156 | 156 | $this->add('document_srl', $obj->document_srl); |
@@ -169,29 +169,29 @@ discard block |
||
169 | 169 | $oDocumentAdminController = getAdminController('document'); |
170 | 170 | |
171 | 171 | $oDocument = $oDocumentModel->getDocument($document_srl, true); |
172 | - if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request'); |
|
172 | + if (!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request'); |
|
173 | 173 | $module_srl = $oDocument->get('module_srl'); |
174 | 174 | |
175 | 175 | // Destination Information Wanted page module |
176 | 176 | $oModuleModel = getModel('module'); |
177 | 177 | $columnList = array('module_srl', 'module'); |
178 | 178 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
179 | - if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request'); |
|
179 | + if (!$page_info->module_srl || $page_info->module != 'page') return new Object(-1, 'msg_invalid_request'); |
|
180 | 180 | |
181 | 181 | // Check permissions |
182 | 182 | $logged_info = Context::get('logged_info'); |
183 | - if(!$logged_info->member_srl) |
|
183 | + if (!$logged_info->member_srl) |
|
184 | 184 | { |
185 | - return new Object(-1,'msg_not_permitted'); |
|
185 | + return new Object(-1, 'msg_not_permitted'); |
|
186 | 186 | } |
187 | 187 | $module_grant = $oModuleModel->getGrant($page_info, $logged_info); |
188 | - if(!$module_grant->manager) |
|
188 | + if (!$module_grant->manager) |
|
189 | 189 | { |
190 | - return new Object(-1,'msg_not_permitted'); |
|
190 | + return new Object(-1, 'msg_not_permitted'); |
|
191 | 191 | } |
192 | 192 | |
193 | - $output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0); |
|
194 | - if(!$output->toBool()) return $output; |
|
193 | + $output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'), 0); |
|
194 | + if (!$output->toBool()) return $output; |
|
195 | 195 | |
196 | 196 | // Return results |
197 | 197 | $copied_srls = $output->get('copied_srls'); |
@@ -210,28 +210,28 @@ discard block |
||
210 | 210 | $oDocumentController = getController('document'); |
211 | 211 | |
212 | 212 | $oDocument = $oDocumentModel->getDocument($document_srl, true); |
213 | - if(!$oDocument->isExists()) return new Object(); |
|
213 | + if (!$oDocument->isExists()) return new Object(); |
|
214 | 214 | $module_srl = $oDocument->get('module_srl'); |
215 | 215 | |
216 | 216 | // Destination Information Wanted page module |
217 | 217 | $oModuleModel = getModel('module'); |
218 | 218 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
219 | - if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request'); |
|
219 | + if (!$page_info->module_srl || $page_info->module != 'page') return new Object(-1, 'msg_invalid_request'); |
|
220 | 220 | |
221 | 221 | // Check permissions |
222 | 222 | $logged_info = Context::get('logged_info'); |
223 | - if(!$logged_info->member_srl) |
|
223 | + if (!$logged_info->member_srl) |
|
224 | 224 | { |
225 | 225 | return new Object(-1, 'msg_not_permitted'); |
226 | 226 | } |
227 | 227 | $module_grant = $oModuleModel->getGrant($page_info, $logged_info); |
228 | - if(!$module_grant->manager) |
|
228 | + if (!$module_grant->manager) |
|
229 | 229 | { |
230 | 230 | return new Object(-1, 'msg_not_permitted'); |
231 | 231 | } |
232 | 232 | |
233 | 233 | $output = $oDocumentController->deleteDocument($oDocument->get('document_srl'), true); |
234 | - if(!$output->toBool()) return $output; |
|
234 | + if (!$output->toBool()) return $output; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | function triggerWidgetCompile(&$content) |
250 | 250 | { |
251 | - if(Context::getResponseMethod()!='HTML') return new Object(); |
|
251 | + if (Context::getResponseMethod() != 'HTML') return new Object(); |
|
252 | 252 | $content = $this->transWidgetCode($content, $this->layout_javascript_mode); |
253 | 253 | return new Object(); |
254 | 254 | } |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | // Check whether to include information about editing |
265 | 265 | $this->javascript_mode = $javascript_mode; |
266 | 266 | // Widget code box change |
267 | - $content = preg_replace_callback('!<div([^\>]*)widget=([^\>]*?)\><div><div>((<img.*?>)*)!is', array($this,'transWidgetBox'), $content); |
|
267 | + $content = preg_replace_callback('!<div([^\>]*)widget=([^\>]*?)\><div><div>((<img.*?>)*)!is', array($this, 'transWidgetBox'), $content); |
|
268 | 268 | // Widget code information byeogyeong |
269 | - $content = preg_replace_callback('!<img([^\>]*)widget=([^\>]*?)\>!is', array($this,'transWidget'), $content); |
|
269 | + $content = preg_replace_callback('!<img([^\>]*)widget=([^\>]*?)\>!is', array($this, 'transWidget'), $content); |
|
270 | 270 | |
271 | 271 | return $content; |
272 | 272 | } |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | $oXmlParser = new XmlParser(); |
282 | 282 | $xml_doc = $oXmlParser->parse(trim($buff)); |
283 | 283 | |
284 | - if($xml_doc->img) $vars = $xml_doc->img->attrs; |
|
284 | + if ($xml_doc->img) $vars = $xml_doc->img->attrs; |
|
285 | 285 | else $vars = $xml_doc->attrs; |
286 | 286 | |
287 | 287 | $widget = $vars->widget; |
288 | - if(!$widget) return $matches[0]; |
|
288 | + if (!$widget) return $matches[0]; |
|
289 | 289 | unset($vars->widget); |
290 | 290 | |
291 | 291 | return $this->execute($widget, $vars, $this->javascript_mode); |
@@ -296,13 +296,13 @@ discard block |
||
296 | 296 | */ |
297 | 297 | function transWidgetBox($matches) |
298 | 298 | { |
299 | - $buff = preg_replace('/<div><div>(.*)$/i','</div>',$matches[0]); |
|
299 | + $buff = preg_replace('/<div><div>(.*)$/i', '</div>', $matches[0]); |
|
300 | 300 | $oXmlParser = new XmlParser(); |
301 | 301 | $xml_doc = $oXmlParser->parse($buff); |
302 | 302 | |
303 | 303 | $vars = $xml_doc->div->attrs; |
304 | 304 | $widget = $vars->widget; |
305 | - if(!$widget) return $matches[0]; |
|
305 | + if (!$widget) return $matches[0]; |
|
306 | 306 | unset($vars->widget); |
307 | 307 | |
308 | 308 | $vars->widgetbox_content = $matches[3]; |
@@ -323,28 +323,28 @@ discard block |
||
323 | 323 | $oXmlParser = new XmlParser(); |
324 | 324 | |
325 | 325 | $cnt = count($matches[1]); |
326 | - for($i=0;$i<$cnt;$i++) |
|
326 | + for ($i = 0; $i < $cnt; $i++) |
|
327 | 327 | { |
328 | 328 | $buff = $matches[0][$i]; |
329 | 329 | $xml_doc = $oXmlParser->parse(trim($buff)); |
330 | 330 | |
331 | 331 | $args = $xml_doc->img->attrs; |
332 | - if(!$args) continue; |
|
332 | + if (!$args) continue; |
|
333 | 333 | // If you are not caching path |
334 | 334 | $widget = $args->widget; |
335 | 335 | $sequence = $args->widget_sequence; |
336 | 336 | $cache = $args->widget_cache; |
337 | - if(!$sequence || !$cache) continue; |
|
337 | + if (!$sequence || !$cache) continue; |
|
338 | 338 | |
339 | - if(count($args)) |
|
339 | + if (count($args)) |
|
340 | 340 | { |
341 | - foreach($args as $k => $v) $args->{$k} = urldecode($v); |
|
341 | + foreach ($args as $k => $v) $args->{$k} = urldecode($v); |
|
342 | 342 | } |
343 | 343 | // If the cache file for each language widget regeneration |
344 | - foreach($lang_list as $lang_type => $val) |
|
344 | + foreach ($lang_list as $lang_type => $val) |
|
345 | 345 | { |
346 | 346 | $cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $sequence, $lang_type); |
347 | - if(!file_exists($cache_file)) continue; |
|
347 | + if (!file_exists($cache_file)) continue; |
|
348 | 348 | $this->getCache($widget, $args, $lang_type, true); |
349 | 349 | } |
350 | 350 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | function getCache($widget, $args, $lang_type = null, $ignore_cache = false) |
357 | 357 | { |
358 | 358 | // If the specified language specifies the current language |
359 | - if(!$lang_type) $lang_type = Context::getLangType(); |
|
359 | + if (!$lang_type) $lang_type = Context::getLangType(); |
|
360 | 360 | // widget, the cache number and cache values are set |
361 | 361 | $widget_sequence = $args->widget_sequence; |
362 | 362 | $widget_cache = $args->widget_cache; |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | /** |
365 | 365 | * Even if the cache number and value of the cache and return it to extract data |
366 | 366 | */ |
367 | - if(!$ignore_cache && (!$widget_cache || !$widget_sequence)) |
|
367 | + if (!$ignore_cache && (!$widget_cache || !$widget_sequence)) |
|
368 | 368 | { |
369 | 369 | $oWidget = $this->getWidgetObject($widget); |
370 | - if(!$oWidget || !method_exists($oWidget, 'proc')) return; |
|
370 | + if (!$oWidget || !method_exists($oWidget, 'proc')) return; |
|
371 | 371 | |
372 | 372 | $widget_content = $oWidget->proc($args); |
373 | 373 | $oModuleController = getController('module'); |
@@ -376,15 +376,15 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | $oCacheHandler = CacheHandler::getInstance('template'); |
379 | - if($oCacheHandler->isSupport()) |
|
379 | + if ($oCacheHandler->isSupport()) |
|
380 | 380 | { |
381 | - $key = 'widget_cache:' . $widget_sequence; |
|
381 | + $key = 'widget_cache:'.$widget_sequence; |
|
382 | 382 | |
383 | 383 | $cache_body = $oCacheHandler->get($key); |
384 | 384 | $cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body); |
385 | 385 | } |
386 | 386 | |
387 | - if($cache_body) |
|
387 | + if ($cache_body) |
|
388 | 388 | { |
389 | 389 | return $cache_body; |
390 | 390 | } |
@@ -397,11 +397,11 @@ discard block |
||
397 | 397 | // Wanted cache file |
398 | 398 | $cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $widget_sequence, $lang_type); |
399 | 399 | // If the file exists in the cache, the file validation |
400 | - if(!$ignore_cache && file_exists($cache_file)) |
|
400 | + if (!$ignore_cache && file_exists($cache_file)) |
|
401 | 401 | { |
402 | 402 | $filemtime = filemtime($cache_file); |
403 | 403 | // Should be modified compared to the time of the cache or in the future if creating more than widget.controller.php file a return value of the cache |
404 | - if($filemtime + $widget_cache * 60 > $_SERVER['REQUEST_TIME'] && $filemtime > filemtime(_XE_PATH_.'modules/widget/widget.controller.php')) |
|
404 | + if ($filemtime + $widget_cache * 60 > $_SERVER['REQUEST_TIME'] && $filemtime > filemtime(_XE_PATH_.'modules/widget/widget.controller.php')) |
|
405 | 405 | { |
406 | 406 | $cache_body = FileHandler::readFile($cache_file); |
407 | 407 | $cache_body = preg_replace('@<\!--#Meta:@', '<!--Meta:', $cache_body); |
@@ -410,18 +410,18 @@ discard block |
||
410 | 410 | } |
411 | 411 | } |
412 | 412 | // cache update and cache renewal of the file mtime |
413 | - if(!$oCacheHandler->isSupport()) |
|
413 | + if (!$oCacheHandler->isSupport()) |
|
414 | 414 | { |
415 | 415 | touch($cache_file); |
416 | 416 | } |
417 | 417 | |
418 | 418 | $oWidget = $this->getWidgetObject($widget); |
419 | - if(!$oWidget || !method_exists($oWidget,'proc')) return; |
|
419 | + if (!$oWidget || !method_exists($oWidget, 'proc')) return; |
|
420 | 420 | |
421 | 421 | $widget_content = $oWidget->proc($args); |
422 | 422 | $oModuleController = getController('module'); |
423 | 423 | $oModuleController->replaceDefinedLangCode($widget_content); |
424 | - if($oCacheHandler->isSupport()) |
|
424 | + if ($oCacheHandler->isSupport()) |
|
425 | 425 | { |
426 | 426 | $oCacheHandler->put($key, $widget_content, $widget_cache * 60); |
427 | 427 | } |
@@ -443,16 +443,16 @@ discard block |
||
443 | 443 | function execute($widget, $args, $javascript_mode = false, $escaped = true) |
444 | 444 | { |
445 | 445 | // Save for debug run-time widget |
446 | - if(__DEBUG__==3) $start = getMicroTime(); |
|
446 | + if (__DEBUG__ == 3) $start = getMicroTime(); |
|
447 | 447 | $before = microtime(true); |
448 | 448 | // urldecode the value of args haejum |
449 | 449 | $object_vars = get_object_vars($args); |
450 | - if(count($object_vars)) |
|
450 | + if (count($object_vars)) |
|
451 | 451 | { |
452 | - foreach($object_vars as $key => $val) |
|
452 | + foreach ($object_vars as $key => $val) |
|
453 | 453 | { |
454 | - if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue; |
|
455 | - if($escaped) $args->{$key} = utf8RawUrlDecode($val); |
|
454 | + if (in_array($key, array('widgetbox_content', 'body', 'class', 'style', 'widget_sequence', 'widget', 'widget_padding_left', 'widget_padding_top', 'widget_padding_bottom', 'widget_padding_right', 'widgetstyle', 'document_srl'))) continue; |
|
455 | + if ($escaped) $args->{$key} = utf8RawUrlDecode($val); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
@@ -461,14 +461,14 @@ discard block |
||
461 | 461 | * Widgets widgetContent/widgetBox Wanted If you are not content |
462 | 462 | */ |
463 | 463 | $widget_content = ''; |
464 | - if($widget != 'widgetContent' && $widget != 'widgetBox') |
|
464 | + if ($widget != 'widgetContent' && $widget != 'widgetBox') |
|
465 | 465 | { |
466 | - if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) return; |
|
466 | + if (!is_dir(sprintf(_XE_PATH_.'widgets/%s/', $widget))) return; |
|
467 | 467 | // Hold the contents of the widget parameter |
468 | 468 | $widget_content = $this->getCache($widget, $args); |
469 | 469 | } |
470 | 470 | |
471 | - if($widget == 'widgetBox') |
|
471 | + if ($widget == 'widgetBox') |
|
472 | 472 | { |
473 | 473 | $widgetbox_content = $args->widgetbox_content; |
474 | 474 | } |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | * Wanted specified by the administrator of the widget style |
478 | 478 | */ |
479 | 479 | // Sometimes the wrong code, background-image: url (none) can be heard but none in this case, the request for the url so unconditionally Removed |
480 | - $style = preg_replace('/url\((.+)(\/?)none\)/is','', $args->style); |
|
480 | + $style = preg_replace('/url\((.+)(\/?)none\)/is', '', $args->style); |
|
481 | 481 | // Find a style statement that based on the internal margin dropping pre-change |
482 | 482 | $widget_padding_left = $args->widget_padding_left; |
483 | 483 | $widget_padding_right = $args->widget_padding_right; |
@@ -493,18 +493,18 @@ discard block |
||
493 | 493 | $widget_content_body = ''; |
494 | 494 | $widget_content_footer = ''; |
495 | 495 | // If general call is given on page styles should return immediately dreamin ' |
496 | - if(!$javascript_mode) |
|
496 | + if (!$javascript_mode) |
|
497 | 497 | { |
498 | - if($args->id) $args->id = ' id="'.$args->id.'" '; |
|
499 | - switch($widget) |
|
498 | + if ($args->id) $args->id = ' id="'.$args->id.'" '; |
|
499 | + switch ($widget) |
|
500 | 500 | { |
501 | 501 | // If a direct orthogonal addition information |
502 | 502 | case 'widgetContent' : |
503 | - if($args->document_srl) |
|
503 | + if ($args->document_srl) |
|
504 | 504 | { |
505 | 505 | $oDocumentModel = getModel('document'); |
506 | 506 | $oDocument = $oDocumentModel->getDocument($args->document_srl); |
507 | - $body = $oDocument->getContent(false,false,false, false); |
|
507 | + $body = $oDocument->getContent(false, false, false, false); |
|
508 | 508 | } |
509 | 509 | else |
510 | 510 | { |
@@ -514,21 +514,21 @@ discard block |
||
514 | 514 | $oEditorController = getController('editor'); |
515 | 515 | $body = $oEditorController->transComponent($body); |
516 | 516 | |
517 | - $widget_content_header = sprintf('<div class="xe_content xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s"><div style="%s">', $args->id, $style, $inner_style); |
|
517 | + $widget_content_header = sprintf('<div class="xe_content xe-widget-wrapper '.$args->css_class.'" %sstyle="%s"><div style="%s">', $args->id, $style, $inner_style); |
|
518 | 518 | $widget_content_body = $body; |
519 | 519 | $widget_content_footer = '</div></div>'; |
520 | 520 | |
521 | 521 | break; |
522 | 522 | // If the widget box; it could |
523 | 523 | case 'widgetBox' : |
524 | - $widget_content_header = sprintf('<div class="xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s;"><div style="%s"><div>', $args->id, $style, $inner_style); |
|
524 | + $widget_content_header = sprintf('<div class="xe-widget-wrapper '.$args->css_class.'" %sstyle="%s;"><div style="%s"><div>', $args->id, $style, $inner_style); |
|
525 | 525 | $widget_content_body = $widgetbox_content; |
526 | 526 | |
527 | 527 | break; |
528 | 528 | // If the General wijetil |
529 | 529 | default : |
530 | - $widget_content_header = sprintf('<div class="xe-widget-wrapper ' . $args->css_class . '" %sstyle="%s">',$args->id,$style); |
|
531 | - $widget_content_body = sprintf('<div style="*zoom:1;%s">%s</div>', $inner_style,$widget_content); |
|
530 | + $widget_content_header = sprintf('<div class="xe-widget-wrapper '.$args->css_class.'" %sstyle="%s">', $args->id, $style); |
|
531 | + $widget_content_body = sprintf('<div style="*zoom:1;%s">%s</div>', $inner_style, $widget_content); |
|
532 | 532 | $widget_content_footer = '</div>'; |
533 | 533 | break; |
534 | 534 | } |
@@ -536,15 +536,15 @@ discard block |
||
536 | 536 | } |
537 | 537 | else |
538 | 538 | { |
539 | - switch($widget) |
|
539 | + switch ($widget) |
|
540 | 540 | { |
541 | 541 | // If a direct orthogonal addition information |
542 | 542 | case 'widgetContent' : |
543 | - if($args->document_srl) |
|
543 | + if ($args->document_srl) |
|
544 | 544 | { |
545 | 545 | $oDocumentModel = getModel('document'); |
546 | 546 | $oDocument = $oDocumentModel->getDocument($args->document_srl); |
547 | - $body = $oDocument->getContent(false,false,false); |
|
547 | + $body = $oDocument->getContent(false, false, false); |
|
548 | 548 | } |
549 | 549 | else |
550 | 550 | { |
@@ -552,12 +552,12 @@ discard block |
||
552 | 552 | } |
553 | 553 | // by args |
554 | 554 | $attribute = array(); |
555 | - if($args) |
|
555 | + if ($args) |
|
556 | 556 | { |
557 | - foreach($args as $key => $val) |
|
557 | + foreach ($args as $key => $val) |
|
558 | 558 | { |
559 | - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; |
|
560 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
559 | + if (in_array($key, array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget', 'widgetstyle', 'document_srl'))) continue; |
|
560 | + if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
561 | 561 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
562 | 562 | } |
563 | 563 | } |
@@ -565,44 +565,44 @@ discard block |
||
565 | 565 | $oWidgetController = getController('widget'); |
566 | 566 | |
567 | 567 | $widget_content_header = sprintf( |
568 | - '<div class="xe_content widgetOutput ' . $args->css_class . '" widgetstyle="%s" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent" document_srl="%d" %s>'. |
|
568 | + '<div class="xe_content widgetOutput '.$args->css_class.'" widgetstyle="%s" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent" document_srl="%d" %s>'. |
|
569 | 569 | '<div class="widgetResize"></div>'. |
570 | 570 | '<div class="widgetResizeLeft"></div>'. |
571 | 571 | '<div class="widgetBorder">'. |
572 | - '<div style="%s">',$args->widgetstyle, |
|
572 | + '<div style="%s">', $args->widgetstyle, |
|
573 | 573 | $style, |
574 | 574 | $args->widget_padding_left, $args->widget_padding_right, $args->widget_padding_top, $args->widget_padding_bottom, |
575 | 575 | $args->document_srl, |
576 | - implode(' ',$attribute), |
|
576 | + implode(' ', $attribute), |
|
577 | 577 | $inner_style); |
578 | 578 | |
579 | 579 | $widget_content_body = $body; |
580 | 580 | $widget_content_footer = sprintf('</div>'. |
581 | 581 | '</div>'. |
582 | 582 | '<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;">%s</div>'. |
583 | - '</div>',base64_encode($body)); |
|
583 | + '</div>', base64_encode($body)); |
|
584 | 584 | |
585 | 585 | break; |
586 | 586 | // If the widget box; it could |
587 | 587 | case 'widgetBox' : |
588 | 588 | // by args |
589 | 589 | $attribute = array(); |
590 | - if($args) |
|
590 | + if ($args) |
|
591 | 591 | { |
592 | - foreach($args as $key => $val) |
|
592 | + foreach ($args as $key => $val) |
|
593 | 593 | { |
594 | - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; |
|
595 | - if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue; |
|
596 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
594 | + if (in_array($key, array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget', 'widgetstyle', 'document_srl'))) continue; |
|
595 | + if (!is_numeric($val) && (!is_string($val) || strlen($val) == 0)) continue; |
|
596 | + if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
597 | 597 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
598 | 598 | } |
599 | 599 | } |
600 | 600 | |
601 | 601 | $widget_content_header = sprintf( |
602 | - '<div class="widgetOutput ' . $args->css_class . '" widgetstyle="%s" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" %s >'. |
|
602 | + '<div class="widgetOutput '.$args->css_class.'" widgetstyle="%s" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" %s >'. |
|
603 | 603 | '<div class="widgetBoxResize"></div>'. |
604 | 604 | '<div class="widgetBoxResizeLeft"></div>'. |
605 | - '<div class="widgetBoxBorder"><div class="nullWidget" style="%s">',$args->widgetstyle,$style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,implode(' ',$attribute),$inner_style); |
|
605 | + '<div class="widgetBoxBorder"><div class="nullWidget" style="%s">', $args->widgetstyle, $style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, implode(' ', $attribute), $inner_style); |
|
606 | 606 | |
607 | 607 | $widget_content_body = $widgetbox_content; |
608 | 608 | |
@@ -611,26 +611,26 @@ discard block |
||
611 | 611 | default : |
612 | 612 | // by args |
613 | 613 | $attribute = array(); |
614 | - if($args) |
|
614 | + if ($args) |
|
615 | 615 | { |
616 | - $allowed_key = array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget'); |
|
617 | - foreach($args as $key => $val) |
|
616 | + $allowed_key = array('class', 'style', 'widget_padding_top', 'widget_padding_right', 'widget_padding_bottom', 'widget_padding_left', 'widget'); |
|
617 | + foreach ($args as $key => $val) |
|
618 | 618 | { |
619 | - if(in_array($key, $allowed_key)) continue; |
|
620 | - if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue; |
|
621 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
619 | + if (in_array($key, $allowed_key)) continue; |
|
620 | + if (!is_numeric($val) && (!is_string($val) || strlen($val) == 0)) continue; |
|
621 | + if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
622 | 622 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
623 | 623 | } |
624 | 624 | } |
625 | 625 | |
626 | - $widget_content_header = sprintf('<div class="widgetOutput ' . $args->css_class . '" widgetstyle="%s" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'. |
|
626 | + $widget_content_header = sprintf('<div class="widgetOutput '.$args->css_class.'" widgetstyle="%s" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'. |
|
627 | 627 | '<div class="widgetResize"></div>'. |
628 | 628 | '<div class="widgetResizeLeft"></div>'. |
629 | - '<div class="widgetBorder">',$args->widgetstyle,$style, |
|
629 | + '<div class="widgetBorder">', $args->widgetstyle, $style, |
|
630 | 630 | $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, |
631 | - $widget, implode(' ',$attribute)); |
|
631 | + $widget, implode(' ', $attribute)); |
|
632 | 632 | |
633 | - $widget_content_body = sprintf('<div style="%s">%s</div>',$inner_style, $widget_content); |
|
633 | + $widget_content_body = sprintf('<div style="%s">%s</div>', $inner_style, $widget_content); |
|
634 | 634 | |
635 | 635 | $widget_content_footer = '</div></div>'; |
636 | 636 | |
@@ -638,11 +638,11 @@ discard block |
||
638 | 638 | } |
639 | 639 | } |
640 | 640 | // Compile the widget style. |
641 | - if($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode); |
|
641 | + if ($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle, $widget, $widget_content_body, $args, $javascript_mode); |
|
642 | 642 | |
643 | - $output = $widget_content_header . $widget_content_body . $widget_content_footer; |
|
643 | + $output = $widget_content_header.$widget_content_body.$widget_content_footer; |
|
644 | 644 | // Debug widget creation time information added to the results |
645 | - if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start; |
|
645 | + if (__DEBUG__ == 3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start; |
|
646 | 646 | |
647 | 647 | $after = microtime(true); |
648 | 648 | |
@@ -663,32 +663,32 @@ discard block |
||
663 | 663 | */ |
664 | 664 | function getWidgetObject($widget) |
665 | 665 | { |
666 | - if(!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $widget)) |
|
666 | + if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $widget)) |
|
667 | 667 | { |
668 | 668 | return Context::getLang('msg_invalid_request'); |
669 | 669 | } |
670 | 670 | |
671 | - if(!$GLOBALS['_xe_loaded_widgets_'][$widget]) |
|
671 | + if (!$GLOBALS['_xe_loaded_widgets_'][$widget]) |
|
672 | 672 | { |
673 | 673 | // Finding the location of a widget |
674 | 674 | $oWidgetModel = getModel('widget'); |
675 | 675 | $path = $oWidgetModel->getWidgetPath($widget); |
676 | 676 | // If you do not find the class file error output widget (html output) |
677 | 677 | $class_file = sprintf('%s%s.class.php', $path, $widget); |
678 | - if(!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget); |
|
678 | + if (!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget); |
|
679 | 679 | // Widget classes include |
680 | 680 | require_once($class_file); |
681 | 681 | |
682 | 682 | // Creating Objects |
683 | - if(!class_exists($widget, false)) |
|
683 | + if (!class_exists($widget, false)) |
|
684 | 684 | { |
685 | 685 | return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); |
686 | 686 | } |
687 | 687 | |
688 | 688 | $oWidget = new $widget(); |
689 | - if(!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); |
|
689 | + if (!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); |
|
690 | 690 | |
691 | - if(!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget); |
|
691 | + if (!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget); |
|
692 | 692 | |
693 | 693 | $oWidget->widget_path = $path; |
694 | 694 | |
@@ -697,29 +697,29 @@ discard block |
||
697 | 697 | return $GLOBALS['_xe_loaded_widgets_'][$widget]; |
698 | 698 | } |
699 | 699 | |
700 | - function compileWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $javascript_mode) |
|
700 | + function compileWidgetStyle($widgetStyle, $widget, $widget_content_body, $args, $javascript_mode) |
|
701 | 701 | { |
702 | - if(!$widgetStyle) return $widget_content_body; |
|
702 | + if (!$widgetStyle) return $widget_content_body; |
|
703 | 703 | |
704 | 704 | $oWidgetModel = getModel('widget'); |
705 | 705 | // Bring extra_var widget style tie |
706 | 706 | $widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetStyle); |
707 | - if(!$widgetstyle_info) return $widget_content_body; |
|
707 | + if (!$widgetstyle_info) return $widget_content_body; |
|
708 | 708 | |
709 | 709 | $widgetstyle_extra_var = new stdClass(); |
710 | 710 | $widgetstyle_extra_var_key = get_object_vars($widgetstyle_info); |
711 | - if(count($widgetstyle_extra_var_key['extra_var'])) |
|
711 | + if (count($widgetstyle_extra_var_key['extra_var'])) |
|
712 | 712 | { |
713 | - foreach($widgetstyle_extra_var_key['extra_var'] as $key => $val) |
|
713 | + foreach ($widgetstyle_extra_var_key['extra_var'] as $key => $val) |
|
714 | 714 | { |
715 | - $widgetstyle_extra_var->{$key} = $args->{$key}; |
|
715 | + $widgetstyle_extra_var->{$key} = $args->{$key}; |
|
716 | 716 | } |
717 | 717 | } |
718 | 718 | Context::set('widgetstyle_extra_var', $widgetstyle_extra_var); |
719 | 719 | // #18994272 오타를 수정했으나 하위 호환성을 위해 남겨둠 - deprecated |
720 | 720 | Context::set('widgetstyle_extar_var', $widgetstyle_extra_var); |
721 | 721 | |
722 | - if($javascript_mode && $widget=='widgetBox') |
|
722 | + if ($javascript_mode && $widget == 'widgetBox') |
|
723 | 723 | { |
724 | 724 | Context::set('widget_content', '<div class="widget_inner">'.$widget_content_body.'</div>'); |
725 | 725 | } |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $oWidgetModel = getModel('widget'); |
744 | 744 | $widget_info = $oWidgetModel->getWidgetInfo($widget); |
745 | 745 | |
746 | - if(!$vars) |
|
746 | + if (!$vars) |
|
747 | 747 | { |
748 | 748 | $vars = new stdClass(); |
749 | 749 | } |
@@ -754,31 +754,31 @@ discard block |
||
754 | 754 | |
755 | 755 | $vars->skin = trim($request_vars->skin); |
756 | 756 | $vars->colorset = trim($request_vars->colorset); |
757 | - $vars->widget_sequence = (int)($request_vars->widget_sequence); |
|
758 | - $vars->widget_cache = (int)($request_vars->widget_cache); |
|
757 | + $vars->widget_sequence = (int) ($request_vars->widget_sequence); |
|
758 | + $vars->widget_cache = (int) ($request_vars->widget_cache); |
|
759 | 759 | $vars->style = trim($request_vars->style); |
760 | 760 | $vars->widget_padding_left = trim($request_vars->widget_padding_left); |
761 | 761 | $vars->widget_padding_right = trim($request_vars->widget_padding_right); |
762 | 762 | $vars->widget_padding_top = trim($request_vars->widget_padding_top); |
763 | 763 | $vars->widget_padding_bottom = trim($request_vars->widget_padding_bottom); |
764 | - $vars->document_srl= trim($request_vars->document_srl); |
|
764 | + $vars->document_srl = trim($request_vars->document_srl); |
|
765 | 765 | |
766 | - if(count($widget_info->extra_var)) |
|
766 | + if (count($widget_info->extra_var)) |
|
767 | 767 | { |
768 | - foreach($widget_info->extra_var as $key=>$val) |
|
768 | + foreach ($widget_info->extra_var as $key=>$val) |
|
769 | 769 | { |
770 | 770 | $vars->{$key} = trim($request_vars->{$key}); |
771 | 771 | } |
772 | 772 | } |
773 | 773 | // If the widget style |
774 | - if($request_vars->widgetstyle) |
|
774 | + if ($request_vars->widgetstyle) |
|
775 | 775 | { |
776 | 776 | $widgetStyle_info = $oWidgetModel->getWidgetStyleInfo($request_vars->widgetstyle); |
777 | - if(count($widgetStyle_info->extra_var)) |
|
777 | + if (count($widgetStyle_info->extra_var)) |
|
778 | 778 | { |
779 | - foreach($widgetStyle_info->extra_var as $key=>$val) |
|
779 | + foreach ($widgetStyle_info->extra_var as $key=>$val) |
|
780 | 780 | { |
781 | - if($val->type =='color' || $val->type =='text' || $val->type =='select' || $val->type =='filebox' || $val->type == 'textarea') |
|
781 | + if ($val->type == 'color' || $val->type == 'text' || $val->type == 'select' || $val->type == 'filebox' || $val->type == 'textarea') |
|
782 | 782 | { |
783 | 783 | $vars->{$key} = trim($request_vars->{$key}); |
784 | 784 | } |
@@ -786,23 +786,23 @@ discard block |
||
786 | 786 | } |
787 | 787 | } |
788 | 788 | |
789 | - if($vars->widget_sequence) |
|
789 | + if ($vars->widget_sequence) |
|
790 | 790 | { |
791 | 791 | $cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $vars->widget_sequence, Context::getLangType()); |
792 | 792 | FileHandler::removeFile($cache_file); |
793 | 793 | } |
794 | 794 | |
795 | - if($vars->widget_cache>0) $vars->widget_sequence = getNextSequence(); |
|
795 | + if ($vars->widget_cache > 0) $vars->widget_sequence = getNextSequence(); |
|
796 | 796 | |
797 | 797 | $attribute = array(); |
798 | - foreach($vars as $key => $val) |
|
798 | + foreach ($vars as $key => $val) |
|
799 | 799 | { |
800 | - if(!$val) |
|
800 | + if (!$val) |
|
801 | 801 | { |
802 | 802 | unset($vars->{$key}); |
803 | 803 | continue; |
804 | 804 | } |
805 | - if(strpos($val,'|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
805 | + if (strpos($val, '|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
806 | 806 | $vars->{$key} = Context::convertEncodingStr($val); |
807 | 807 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars(Context::convertEncodingStr($val), ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
808 | 808 | } |
@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | $colorset_list[] = $colorset; |
41 | 41 | } |
42 | 42 | |
43 | - if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
43 | + if(count($colorset_list)) { |
|
44 | + $colorsets = implode("\n", $colorset_list); |
|
45 | + } |
|
44 | 46 | $this->add('colorset_list', $colorsets); |
45 | 47 | } |
46 | 48 | |
@@ -50,8 +52,12 @@ discard block |
||
50 | 52 | function procWidgetGenerateCode() |
51 | 53 | { |
52 | 54 | $widget = Context::get('selected_widget'); |
53 | - if(!$widget) return new Object(-1,'msg_invalid_request'); |
|
54 | - if(!Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
55 | + if(!$widget) { |
|
56 | + return new Object(-1,'msg_invalid_request'); |
|
57 | + } |
|
58 | + if(!Context::get('skin')) { |
|
59 | + return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
60 | + } |
|
55 | 61 | |
56 | 62 | $attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars); |
57 | 63 | |
@@ -66,9 +72,13 @@ discard block |
||
66 | 72 | function procWidgetGenerateCodeInPage() |
67 | 73 | { |
68 | 74 | $widget = Context::get('selected_widget'); |
69 | - if(!$widget) return new Object(-1,'msg_invalid_request'); |
|
75 | + if(!$widget) { |
|
76 | + return new Object(-1,'msg_invalid_request'); |
|
77 | + } |
|
70 | 78 | |
71 | - if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
79 | + if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) { |
|
80 | + return new Object(-1,Context::getLang('msg_widget_skin_is_null')); |
|
81 | + } |
|
72 | 82 | |
73 | 83 | $attribute = $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars); |
74 | 84 | // Wanted results |
@@ -107,15 +117,21 @@ discard block |
||
107 | 117 | $err = 0; |
108 | 118 | $oLayoutModel = getModel('layout'); |
109 | 119 | $layout_info = $oLayoutModel->getLayout($module_srl); |
110 | - if(!$layout_info || $layout_info->type != 'faceoff') $err++; |
|
120 | + if(!$layout_info || $layout_info->type != 'faceoff') { |
|
121 | + $err++; |
|
122 | + } |
|
111 | 123 | |
112 | 124 | // Destination Information Wanted page module |
113 | 125 | $oModuleModel = getModel('module'); |
114 | 126 | $columnList = array('module_srl', 'module'); |
115 | 127 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
116 | - if(!$page_info->module_srl || $page_info->module != 'page') $err++; |
|
128 | + if(!$page_info->module_srl || $page_info->module != 'page') { |
|
129 | + $err++; |
|
130 | + } |
|
117 | 131 | |
118 | - if($err > 1) return new Object(-1,'msg_invalid_request'); |
|
132 | + if($err > 1) { |
|
133 | + return new Object(-1,'msg_invalid_request'); |
|
134 | + } |
|
119 | 135 | |
120 | 136 | // Check permissions |
121 | 137 | $logged_info = Context::get('logged_info'); |
@@ -142,15 +158,16 @@ discard block |
||
142 | 158 | if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
143 | 159 | { |
144 | 160 | $output = $oDocumentController->updateDocument($oDocument, $obj); |
145 | - } |
|
146 | - else |
|
161 | + } else |
|
147 | 162 | { |
148 | 163 | $output = $oDocumentController->insertDocument($obj); |
149 | 164 | $obj->document_srl = $output->get('document_srl'); |
150 | 165 | } |
151 | 166 | |
152 | 167 | // Stop when an error occurs |
153 | - if(!$output->toBool()) return $output; |
|
168 | + if(!$output->toBool()) { |
|
169 | + return $output; |
|
170 | + } |
|
154 | 171 | |
155 | 172 | // Return results |
156 | 173 | $this->add('document_srl', $obj->document_srl); |
@@ -169,14 +186,18 @@ discard block |
||
169 | 186 | $oDocumentAdminController = getAdminController('document'); |
170 | 187 | |
171 | 188 | $oDocument = $oDocumentModel->getDocument($document_srl, true); |
172 | - if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request'); |
|
189 | + if(!$oDocument->isExists()) { |
|
190 | + return new Object(-1,'msg_invalid_request'); |
|
191 | + } |
|
173 | 192 | $module_srl = $oDocument->get('module_srl'); |
174 | 193 | |
175 | 194 | // Destination Information Wanted page module |
176 | 195 | $oModuleModel = getModel('module'); |
177 | 196 | $columnList = array('module_srl', 'module'); |
178 | 197 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
179 | - if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request'); |
|
198 | + if(!$page_info->module_srl || $page_info->module != 'page') { |
|
199 | + return new Object(-1,'msg_invalid_request'); |
|
200 | + } |
|
180 | 201 | |
181 | 202 | // Check permissions |
182 | 203 | $logged_info = Context::get('logged_info'); |
@@ -191,7 +212,9 @@ discard block |
||
191 | 212 | } |
192 | 213 | |
193 | 214 | $output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0); |
194 | - if(!$output->toBool()) return $output; |
|
215 | + if(!$output->toBool()) { |
|
216 | + return $output; |
|
217 | + } |
|
195 | 218 | |
196 | 219 | // Return results |
197 | 220 | $copied_srls = $output->get('copied_srls'); |
@@ -210,13 +233,17 @@ discard block |
||
210 | 233 | $oDocumentController = getController('document'); |
211 | 234 | |
212 | 235 | $oDocument = $oDocumentModel->getDocument($document_srl, true); |
213 | - if(!$oDocument->isExists()) return new Object(); |
|
236 | + if(!$oDocument->isExists()) { |
|
237 | + return new Object(); |
|
238 | + } |
|
214 | 239 | $module_srl = $oDocument->get('module_srl'); |
215 | 240 | |
216 | 241 | // Destination Information Wanted page module |
217 | 242 | $oModuleModel = getModel('module'); |
218 | 243 | $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
219 | - if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request'); |
|
244 | + if(!$page_info->module_srl || $page_info->module != 'page') { |
|
245 | + return new Object(-1,'msg_invalid_request'); |
|
246 | + } |
|
220 | 247 | |
221 | 248 | // Check permissions |
222 | 249 | $logged_info = Context::get('logged_info'); |
@@ -231,7 +258,9 @@ discard block |
||
231 | 258 | } |
232 | 259 | |
233 | 260 | $output = $oDocumentController->deleteDocument($oDocument->get('document_srl'), true); |
234 | - if(!$output->toBool()) return $output; |
|
261 | + if(!$output->toBool()) { |
|
262 | + return $output; |
|
263 | + } |
|
235 | 264 | } |
236 | 265 | |
237 | 266 | /** |
@@ -248,7 +277,9 @@ discard block |
||
248 | 277 | */ |
249 | 278 | function triggerWidgetCompile(&$content) |
250 | 279 | { |
251 | - if(Context::getResponseMethod()!='HTML') return new Object(); |
|
280 | + if(Context::getResponseMethod()!='HTML') { |
|
281 | + return new Object(); |
|
282 | + } |
|
252 | 283 | $content = $this->transWidgetCode($content, $this->layout_javascript_mode); |
253 | 284 | return new Object(); |
254 | 285 | } |
@@ -281,11 +312,16 @@ discard block |
||
281 | 312 | $oXmlParser = new XmlParser(); |
282 | 313 | $xml_doc = $oXmlParser->parse(trim($buff)); |
283 | 314 | |
284 | - if($xml_doc->img) $vars = $xml_doc->img->attrs; |
|
285 | - else $vars = $xml_doc->attrs; |
|
315 | + if($xml_doc->img) { |
|
316 | + $vars = $xml_doc->img->attrs; |
|
317 | + } else { |
|
318 | + $vars = $xml_doc->attrs; |
|
319 | + } |
|
286 | 320 | |
287 | 321 | $widget = $vars->widget; |
288 | - if(!$widget) return $matches[0]; |
|
322 | + if(!$widget) { |
|
323 | + return $matches[0]; |
|
324 | + } |
|
289 | 325 | unset($vars->widget); |
290 | 326 | |
291 | 327 | return $this->execute($widget, $vars, $this->javascript_mode); |
@@ -302,7 +338,9 @@ discard block |
||
302 | 338 | |
303 | 339 | $vars = $xml_doc->div->attrs; |
304 | 340 | $widget = $vars->widget; |
305 | - if(!$widget) return $matches[0]; |
|
341 | + if(!$widget) { |
|
342 | + return $matches[0]; |
|
343 | + } |
|
306 | 344 | unset($vars->widget); |
307 | 345 | |
308 | 346 | $vars->widgetbox_content = $matches[3]; |
@@ -329,22 +367,30 @@ discard block |
||
329 | 367 | $xml_doc = $oXmlParser->parse(trim($buff)); |
330 | 368 | |
331 | 369 | $args = $xml_doc->img->attrs; |
332 | - if(!$args) continue; |
|
370 | + if(!$args) { |
|
371 | + continue; |
|
372 | + } |
|
333 | 373 | // If you are not caching path |
334 | 374 | $widget = $args->widget; |
335 | 375 | $sequence = $args->widget_sequence; |
336 | 376 | $cache = $args->widget_cache; |
337 | - if(!$sequence || !$cache) continue; |
|
377 | + if(!$sequence || !$cache) { |
|
378 | + continue; |
|
379 | + } |
|
338 | 380 | |
339 | 381 | if(count($args)) |
340 | 382 | { |
341 | - foreach($args as $k => $v) $args->{$k} = urldecode($v); |
|
383 | + foreach($args as $k => $v) { |
|
384 | + $args->{$k} = urldecode($v); |
|
385 | + } |
|
342 | 386 | } |
343 | 387 | // If the cache file for each language widget regeneration |
344 | 388 | foreach($lang_list as $lang_type => $val) |
345 | 389 | { |
346 | 390 | $cache_file = sprintf('%s%d.%s.cache', $this->cache_path, $sequence, $lang_type); |
347 | - if(!file_exists($cache_file)) continue; |
|
391 | + if(!file_exists($cache_file)) { |
|
392 | + continue; |
|
393 | + } |
|
348 | 394 | $this->getCache($widget, $args, $lang_type, true); |
349 | 395 | } |
350 | 396 | } |
@@ -356,7 +402,9 @@ discard block |
||
356 | 402 | function getCache($widget, $args, $lang_type = null, $ignore_cache = false) |
357 | 403 | { |
358 | 404 | // If the specified language specifies the current language |
359 | - if(!$lang_type) $lang_type = Context::getLangType(); |
|
405 | + if(!$lang_type) { |
|
406 | + $lang_type = Context::getLangType(); |
|
407 | + } |
|
360 | 408 | // widget, the cache number and cache values are set |
361 | 409 | $widget_sequence = $args->widget_sequence; |
362 | 410 | $widget_cache = $args->widget_cache; |
@@ -367,7 +415,9 @@ discard block |
||
367 | 415 | if(!$ignore_cache && (!$widget_cache || !$widget_sequence)) |
368 | 416 | { |
369 | 417 | $oWidget = $this->getWidgetObject($widget); |
370 | - if(!$oWidget || !method_exists($oWidget, 'proc')) return; |
|
418 | + if(!$oWidget || !method_exists($oWidget, 'proc')) { |
|
419 | + return; |
|
420 | + } |
|
371 | 421 | |
372 | 422 | $widget_content = $oWidget->proc($args); |
373 | 423 | $oModuleController = getController('module'); |
@@ -387,8 +437,7 @@ discard block |
||
387 | 437 | if($cache_body) |
388 | 438 | { |
389 | 439 | return $cache_body; |
390 | - } |
|
391 | - else |
|
440 | + } else |
|
392 | 441 | { |
393 | 442 | /** |
394 | 443 | * Cache number and cache values are set so that the cache file should call |
@@ -416,7 +465,9 @@ discard block |
||
416 | 465 | } |
417 | 466 | |
418 | 467 | $oWidget = $this->getWidgetObject($widget); |
419 | - if(!$oWidget || !method_exists($oWidget,'proc')) return; |
|
468 | + if(!$oWidget || !method_exists($oWidget,'proc')) { |
|
469 | + return; |
|
470 | + } |
|
420 | 471 | |
421 | 472 | $widget_content = $oWidget->proc($args); |
422 | 473 | $oModuleController = getController('module'); |
@@ -424,8 +475,7 @@ discard block |
||
424 | 475 | if($oCacheHandler->isSupport()) |
425 | 476 | { |
426 | 477 | $oCacheHandler->put($key, $widget_content, $widget_cache * 60); |
427 | - } |
|
428 | - else |
|
478 | + } else |
|
429 | 479 | { |
430 | 480 | FileHandler::writeFile($cache_file, $widget_content); |
431 | 481 | } |
@@ -443,7 +493,9 @@ discard block |
||
443 | 493 | function execute($widget, $args, $javascript_mode = false, $escaped = true) |
444 | 494 | { |
445 | 495 | // Save for debug run-time widget |
446 | - if(__DEBUG__==3) $start = getMicroTime(); |
|
496 | + if(__DEBUG__==3) { |
|
497 | + $start = getMicroTime(); |
|
498 | + } |
|
447 | 499 | $before = microtime(true); |
448 | 500 | // urldecode the value of args haejum |
449 | 501 | $object_vars = get_object_vars($args); |
@@ -451,8 +503,12 @@ discard block |
||
451 | 503 | { |
452 | 504 | foreach($object_vars as $key => $val) |
453 | 505 | { |
454 | - if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) continue; |
|
455 | - if($escaped) $args->{$key} = utf8RawUrlDecode($val); |
|
506 | + if(in_array($key, array('widgetbox_content','body','class','style','widget_sequence','widget','widget_padding_left','widget_padding_top','widget_padding_bottom','widget_padding_right','widgetstyle','document_srl'))) { |
|
507 | + continue; |
|
508 | + } |
|
509 | + if($escaped) { |
|
510 | + $args->{$key} = utf8RawUrlDecode($val); |
|
511 | + } |
|
456 | 512 | } |
457 | 513 | } |
458 | 514 | |
@@ -463,7 +519,9 @@ discard block |
||
463 | 519 | $widget_content = ''; |
464 | 520 | if($widget != 'widgetContent' && $widget != 'widgetBox') |
465 | 521 | { |
466 | - if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) return; |
|
522 | + if(!is_dir(sprintf(_XE_PATH_.'widgets/%s/',$widget))) { |
|
523 | + return; |
|
524 | + } |
|
467 | 525 | // Hold the contents of the widget parameter |
468 | 526 | $widget_content = $this->getCache($widget, $args); |
469 | 527 | } |
@@ -495,7 +553,9 @@ discard block |
||
495 | 553 | // If general call is given on page styles should return immediately dreamin ' |
496 | 554 | if(!$javascript_mode) |
497 | 555 | { |
498 | - if($args->id) $args->id = ' id="'.$args->id.'" '; |
|
556 | + if($args->id) { |
|
557 | + $args->id = ' id="'.$args->id.'" '; |
|
558 | + } |
|
499 | 559 | switch($widget) |
500 | 560 | { |
501 | 561 | // If a direct orthogonal addition information |
@@ -505,8 +565,7 @@ discard block |
||
505 | 565 | $oDocumentModel = getModel('document'); |
506 | 566 | $oDocument = $oDocumentModel->getDocument($args->document_srl); |
507 | 567 | $body = $oDocument->getContent(false,false,false, false); |
508 | - } |
|
509 | - else |
|
568 | + } else |
|
510 | 569 | { |
511 | 570 | $body = base64_decode($args->body); |
512 | 571 | } |
@@ -533,8 +592,7 @@ discard block |
||
533 | 592 | break; |
534 | 593 | } |
535 | 594 | // Edit page is called when a widget if you add the code for handling |
536 | - } |
|
537 | - else |
|
595 | + } else |
|
538 | 596 | { |
539 | 597 | switch($widget) |
540 | 598 | { |
@@ -545,8 +603,7 @@ discard block |
||
545 | 603 | $oDocumentModel = getModel('document'); |
546 | 604 | $oDocument = $oDocumentModel->getDocument($args->document_srl); |
547 | 605 | $body = $oDocument->getContent(false,false,false); |
548 | - } |
|
549 | - else |
|
606 | + } else |
|
550 | 607 | { |
551 | 608 | $body = base64_decode($args->body); |
552 | 609 | } |
@@ -556,8 +613,12 @@ discard block |
||
556 | 613 | { |
557 | 614 | foreach($args as $key => $val) |
558 | 615 | { |
559 | - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; |
|
560 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
616 | + if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) { |
|
617 | + continue; |
|
618 | + } |
|
619 | + if(strpos($val,'|@|')>0) { |
|
620 | + $val = str_replace('|@|',',',$val); |
|
621 | + } |
|
561 | 622 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
562 | 623 | } |
563 | 624 | } |
@@ -591,9 +652,15 @@ discard block |
||
591 | 652 | { |
592 | 653 | foreach($args as $key => $val) |
593 | 654 | { |
594 | - if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) continue; |
|
595 | - if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue; |
|
596 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
655 | + if(in_array($key, array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget','widgetstyle','document_srl'))) { |
|
656 | + continue; |
|
657 | + } |
|
658 | + if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) { |
|
659 | + continue; |
|
660 | + } |
|
661 | + if(strpos($val,'|@|')>0) { |
|
662 | + $val = str_replace('|@|',',',$val); |
|
663 | + } |
|
597 | 664 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
598 | 665 | } |
599 | 666 | } |
@@ -616,9 +683,15 @@ discard block |
||
616 | 683 | $allowed_key = array('class','style','widget_padding_top','widget_padding_right','widget_padding_bottom','widget_padding_left','widget'); |
617 | 684 | foreach($args as $key => $val) |
618 | 685 | { |
619 | - if(in_array($key, $allowed_key)) continue; |
|
620 | - if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) continue; |
|
621 | - if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val); |
|
686 | + if(in_array($key, $allowed_key)) { |
|
687 | + continue; |
|
688 | + } |
|
689 | + if(!is_numeric($val) && (!is_string($val) || strlen($val)==0)) { |
|
690 | + continue; |
|
691 | + } |
|
692 | + if(strpos($val,'|@|')>0) { |
|
693 | + $val = str_replace('|@|',',',$val); |
|
694 | + } |
|
622 | 695 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
623 | 696 | } |
624 | 697 | } |
@@ -638,11 +711,15 @@ discard block |
||
638 | 711 | } |
639 | 712 | } |
640 | 713 | // Compile the widget style. |
641 | - if($args->widgetstyle) $widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode); |
|
714 | + if($args->widgetstyle) { |
|
715 | + $widget_content_body = $this->compileWidgetStyle($args->widgetstyle,$widget, $widget_content_body, $args, $javascript_mode); |
|
716 | + } |
|
642 | 717 | |
643 | 718 | $output = $widget_content_header . $widget_content_body . $widget_content_footer; |
644 | 719 | // Debug widget creation time information added to the results |
645 | - if(__DEBUG__==3) $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start; |
|
720 | + if(__DEBUG__==3) { |
|
721 | + $GLOBALS['__widget_excute_elapsed__'] += getMicroTime() - $start; |
|
722 | + } |
|
646 | 723 | |
647 | 724 | $after = microtime(true); |
648 | 725 | |
@@ -675,7 +752,9 @@ discard block |
||
675 | 752 | $path = $oWidgetModel->getWidgetPath($widget); |
676 | 753 | // If you do not find the class file error output widget (html output) |
677 | 754 | $class_file = sprintf('%s%s.class.php', $path, $widget); |
678 | - if(!file_exists($class_file)) return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget); |
|
755 | + if(!file_exists($class_file)) { |
|
756 | + return sprintf(Context::getLang('msg_widget_is_not_exists'), $widget); |
|
757 | + } |
|
679 | 758 | // Widget classes include |
680 | 759 | require_once($class_file); |
681 | 760 | |
@@ -686,9 +765,13 @@ discard block |
||
686 | 765 | } |
687 | 766 | |
688 | 767 | $oWidget = new $widget(); |
689 | - if(!is_object($oWidget)) return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); |
|
768 | + if(!is_object($oWidget)) { |
|
769 | + return sprintf(Context::getLang('msg_widget_object_is_null'), $widget); |
|
770 | + } |
|
690 | 771 | |
691 | - if(!method_exists($oWidget, 'proc')) return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget); |
|
772 | + if(!method_exists($oWidget, 'proc')) { |
|
773 | + return sprintf(Context::getLang('msg_widget_proc_is_null'), $widget); |
|
774 | + } |
|
692 | 775 | |
693 | 776 | $oWidget->widget_path = $path; |
694 | 777 | |
@@ -699,12 +782,16 @@ discard block |
||
699 | 782 | |
700 | 783 | function compileWidgetStyle($widgetStyle,$widget,$widget_content_body, $args, $javascript_mode) |
701 | 784 | { |
702 | - if(!$widgetStyle) return $widget_content_body; |
|
785 | + if(!$widgetStyle) { |
|
786 | + return $widget_content_body; |
|
787 | + } |
|
703 | 788 | |
704 | 789 | $oWidgetModel = getModel('widget'); |
705 | 790 | // Bring extra_var widget style tie |
706 | 791 | $widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetStyle); |
707 | - if(!$widgetstyle_info) return $widget_content_body; |
|
792 | + if(!$widgetstyle_info) { |
|
793 | + return $widget_content_body; |
|
794 | + } |
|
708 | 795 | |
709 | 796 | $widgetstyle_extra_var = new stdClass(); |
710 | 797 | $widgetstyle_extra_var_key = get_object_vars($widgetstyle_info); |
@@ -722,8 +809,7 @@ discard block |
||
722 | 809 | if($javascript_mode && $widget=='widgetBox') |
723 | 810 | { |
724 | 811 | Context::set('widget_content', '<div class="widget_inner">'.$widget_content_body.'</div>'); |
725 | - } |
|
726 | - else |
|
812 | + } else |
|
727 | 813 | { |
728 | 814 | Context::set('widget_content', $widget_content_body); |
729 | 815 | } |
@@ -792,7 +878,9 @@ discard block |
||
792 | 878 | FileHandler::removeFile($cache_file); |
793 | 879 | } |
794 | 880 | |
795 | - if($vars->widget_cache>0) $vars->widget_sequence = getNextSequence(); |
|
881 | + if($vars->widget_cache>0) { |
|
882 | + $vars->widget_sequence = getNextSequence(); |
|
883 | + } |
|
796 | 884 | |
797 | 885 | $attribute = array(); |
798 | 886 | foreach($vars as $key => $val) |
@@ -802,7 +890,9 @@ discard block |
||
802 | 890 | unset($vars->{$key}); |
803 | 891 | continue; |
804 | 892 | } |
805 | - if(strpos($val,'|@|') > 0) $val = str_replace('|@|', ',', $val); |
|
893 | + if(strpos($val,'|@|') > 0) { |
|
894 | + $val = str_replace('|@|', ',', $val); |
|
895 | + } |
|
806 | 896 | $vars->{$key} = Context::convertEncodingStr($val); |
807 | 897 | $attribute[] = sprintf('%s="%s"', $key, htmlspecialchars(Context::convertEncodingStr($val), ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
808 | 898 | } |
@@ -24,28 +24,28 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if ($this->pointList[$member_srl]) return true; |
|
28 | 28 | |
29 | 29 | // Get from file cache |
30 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
30 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
31 | 31 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | - if(file_exists($cache_filename)) |
|
32 | + if (file_exists($cache_filename)) |
|
33 | 33 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
34 | + if (!$this->pointList[$member_srl]) |
|
35 | 35 | $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
36 | 36 | return true; |
37 | 37 | } |
38 | 38 | |
39 | - $args =new stdClass(); |
|
39 | + $args = new stdClass(); |
|
40 | 40 | $args->member_srl = $member_srl; |
41 | 41 | $output = executeQuery('point.getPoint', $args); |
42 | - if($output->data->member_srl == $member_srl) |
|
42 | + if ($output->data->member_srl == $member_srl) |
|
43 | 43 | { |
44 | - if(!$this->pointList[$member_srl]) |
|
44 | + if (!$this->pointList[$member_srl]) |
|
45 | 45 | { |
46 | - $this->pointList[$member_srl] = (int)$output->data->point; |
|
46 | + $this->pointList[$member_srl] = (int) $output->data->point; |
|
47 | 47 | FileHandler::makeDir($path); |
48 | - FileHandler::writeFile($cache_filename, (int)$output->data->point); |
|
48 | + FileHandler::writeFile($cache_filename, (int) $output->data->point); |
|
49 | 49 | } |
50 | 50 | return true; |
51 | 51 | } |
@@ -60,25 +60,25 @@ discard block |
||
60 | 60 | $member_srl = abs($member_srl); |
61 | 61 | |
62 | 62 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
63 | + if (!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
64 | 64 | |
65 | 65 | // Get from file cache |
66 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
66 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
67 | 67 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 68 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
69 | + if (!$from_db && file_exists($cache_filename)) |
|
70 | 70 | return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
71 | 71 | |
72 | 72 | // Get from the DB |
73 | - $args =new stdClass(); |
|
73 | + $args = new stdClass(); |
|
74 | 74 | $args->member_srl = $member_srl; |
75 | 75 | $output = executeQuery('point.getPoint', $args); |
76 | 76 | |
77 | - if(isset($output->data->member_srl)) |
|
77 | + if (isset($output->data->member_srl)) |
|
78 | 78 | { |
79 | - $point = (int)$output->data->point; |
|
79 | + $point = (int) $output->data->point; |
|
80 | 80 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
81 | + if (!is_dir($path)) FileHandler::makeDir($path); |
|
82 | 82 | FileHandler::writeFile($cache_filename, $point); |
83 | 83 | return $point; |
84 | 84 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | function getLevel($point, $level_step) |
92 | 92 | { |
93 | 93 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
95 | - $level --; |
|
94 | + for ($level = 0; $level <= $level_count; $level++) if ($point < $level_step[$level]) break; |
|
95 | + $level--; |
|
96 | 96 | return $level; |
97 | 97 | } |
98 | 98 | |
@@ -103,20 +103,20 @@ discard block |
||
103 | 103 | { |
104 | 104 | $member_srls = Context::get('member_srls'); |
105 | 105 | $member_srls = array_unique(explode(',', $member_srls)); |
106 | - if(!count($member_srls)) |
|
106 | + if (!count($member_srls)) |
|
107 | 107 | { |
108 | 108 | return; |
109 | 109 | } |
110 | 110 | |
111 | 111 | $logged_info = Context::get('logged_info'); |
112 | - if(!$logged_info->member_srl) |
|
112 | + if (!$logged_info->member_srl) |
|
113 | 113 | { |
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | - if(!getModel('module')->isSiteAdmin($logged_info)) |
|
117 | + if (!getModel('module')->isSiteAdmin($logged_info)) |
|
118 | 118 | { |
119 | - if(in_array($logged_info->member_srl, $member_srls)) |
|
119 | + if (in_array($logged_info->member_srl, $member_srls)) |
|
120 | 120 | { |
121 | 121 | $member_srls = array($logged_info->member_srl); |
122 | 122 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $config = $oModuleModel->getModuleConfig('point'); |
131 | 131 | |
132 | 132 | $info = array(); |
133 | - foreach($member_srls as $v) |
|
133 | + foreach ($member_srls as $v) |
|
134 | 134 | { |
135 | 135 | $obj = new stdClass; |
136 | 136 | $obj->point = $this->getPoint($v); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $info[] = $obj; |
140 | 140 | } |
141 | 141 | |
142 | - $this->add('point_info',$info); |
|
142 | + $this->add('point_info', $info); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | |
@@ -149,37 +149,37 @@ discard block |
||
149 | 149 | function getMemberList($args = null, $columnList = array()) |
150 | 150 | { |
151 | 151 | // Arrange the search options |
152 | - $args->is_admin = Context::get('is_admin')=='Y'?'Y':''; |
|
153 | - $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; |
|
152 | + $args->is_admin = Context::get('is_admin') == 'Y' ? 'Y' : ''; |
|
153 | + $args->is_denied = Context::get('is_denied') == 'Y' ? 'Y' : ''; |
|
154 | 154 | $args->selected_group_srl = Context::get('selected_group_srl'); |
155 | 155 | |
156 | 156 | $search_target = trim(Context::get('search_target')); |
157 | 157 | $search_keyword = trim(Context::get('search_keyword')); |
158 | 158 | |
159 | 159 | // if search keyword is emtpy, show all list |
160 | - if(!$search_keyword) |
|
160 | + if (!$search_keyword) |
|
161 | 161 | { |
162 | 162 | unset($args->is_admin, $args->is_denied, $args->selected_group_srl, $search_target); |
163 | 163 | } |
164 | 164 | |
165 | - if($search_target && $search_keyword) |
|
165 | + if ($search_target && $search_keyword) |
|
166 | 166 | { |
167 | - switch($search_target) |
|
167 | + switch ($search_target) |
|
168 | 168 | { |
169 | 169 | case 'user_id' : |
170 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
170 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
171 | 171 | $args->s_user_id = $search_keyword; |
172 | 172 | break; |
173 | 173 | case 'user_name' : |
174 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
174 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
175 | 175 | $args->s_user_name = $search_keyword; |
176 | 176 | break; |
177 | 177 | case 'nick_name' : |
178 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
178 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
179 | 179 | $args->s_nick_name = $search_keyword; |
180 | 180 | break; |
181 | 181 | case 'email_address' : |
182 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
182 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
183 | 183 | $args->s_email_address = $search_keyword; |
184 | 184 | break; |
185 | 185 | case 'regdate' : |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | } |
196 | 196 | // If there is a selected_group_srl, change the "query id" (for table join) |
197 | - if($args->selected_group_srl) |
|
197 | + if ($args->selected_group_srl) |
|
198 | 198 | { |
199 | 199 | $query_id = 'point.getMemberListWithinGroup'; |
200 | 200 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | |
206 | 206 | $output = executeQuery($query_id, $args, $columnList); |
207 | 207 | |
208 | - if($output->total_count) |
|
208 | + if ($output->total_count) |
|
209 | 209 | { |
210 | 210 | $oModuleModel = getModel('module'); |
211 | 211 | $config = $oModuleModel->getModuleConfig('point'); |
212 | 212 | |
213 | - foreach($output->data as $key => $val) |
|
213 | + foreach ($output->data as $key => $val) |
|
214 | 214 | { |
215 | 215 | $output->data[$key]->level = $this->getLevel($val->point, $config->level_step); |
216 | 216 | } |
@@ -24,15 +24,18 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if($this->pointList[$member_srl]) { |
|
28 | + return true; |
|
29 | + } |
|
28 | 30 | |
29 | 31 | // Get from file cache |
30 | 32 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
31 | 33 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | 34 | if(file_exists($cache_filename)) |
33 | 35 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
35 | - $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
36 | + if(!$this->pointList[$member_srl]) { |
|
37 | + $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
38 | + } |
|
36 | 39 | return true; |
37 | 40 | } |
38 | 41 | |
@@ -60,14 +63,17 @@ discard block |
||
60 | 63 | $member_srl = abs($member_srl); |
61 | 64 | |
62 | 65 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
66 | + if(!$from_db && $this->pointList[$member_srl]) { |
|
67 | + return $this->pointList[$member_srl]; |
|
68 | + } |
|
64 | 69 | |
65 | 70 | // Get from file cache |
66 | 71 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
67 | 72 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 73 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
70 | - return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
74 | + if(!$from_db && file_exists($cache_filename)) { |
|
75 | + return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
76 | + } |
|
71 | 77 | |
72 | 78 | // Get from the DB |
73 | 79 | $args =new stdClass(); |
@@ -78,7 +84,9 @@ discard block |
||
78 | 84 | { |
79 | 85 | $point = (int)$output->data->point; |
80 | 86 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
87 | + if(!is_dir($path)) { |
|
88 | + FileHandler::makeDir($path); |
|
89 | + } |
|
82 | 90 | FileHandler::writeFile($cache_filename, $point); |
83 | 91 | return $point; |
84 | 92 | } |
@@ -91,7 +99,9 @@ discard block |
||
91 | 99 | function getLevel($point, $level_step) |
92 | 100 | { |
93 | 101 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
102 | + for($level=0;$level<=$level_count;$level++) { |
|
103 | + if($point < $level_step[$level]) break; |
|
104 | + } |
|
95 | 105 | $level --; |
96 | 106 | return $level; |
97 | 107 | } |
@@ -119,8 +129,7 @@ discard block |
||
119 | 129 | if(in_array($logged_info->member_srl, $member_srls)) |
120 | 130 | { |
121 | 131 | $member_srls = array($logged_info->member_srl); |
122 | - } |
|
123 | - else |
|
132 | + } else |
|
124 | 133 | { |
125 | 134 | return; |
126 | 135 | } |
@@ -167,19 +176,27 @@ discard block |
||
167 | 176 | switch($search_target) |
168 | 177 | { |
169 | 178 | case 'user_id' : |
170 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
179 | + if($search_keyword) { |
|
180 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
181 | + } |
|
171 | 182 | $args->s_user_id = $search_keyword; |
172 | 183 | break; |
173 | 184 | case 'user_name' : |
174 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
185 | + if($search_keyword) { |
|
186 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
187 | + } |
|
175 | 188 | $args->s_user_name = $search_keyword; |
176 | 189 | break; |
177 | 190 | case 'nick_name' : |
178 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
191 | + if($search_keyword) { |
|
192 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
193 | + } |
|
179 | 194 | $args->s_nick_name = $search_keyword; |
180 | 195 | break; |
181 | 196 | case 'email_address' : |
182 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
197 | + if($search_keyword) { |
|
198 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
199 | + } |
|
183 | 200 | $args->s_email_address = $search_keyword; |
184 | 201 | break; |
185 | 202 | case 'regdate' : |
@@ -197,8 +214,7 @@ discard block |
||
197 | 214 | if($args->selected_group_srl) |
198 | 215 | { |
199 | 216 | $query_id = 'point.getMemberListWithinGroup'; |
200 | - } |
|
201 | - else |
|
217 | + } else |
|
202 | 218 | { |
203 | 219 | $query_id = 'point.getMemberList'; |
204 | 220 | } |
@@ -47,28 +47,28 @@ discard block |
||
47 | 47 | { |
48 | 48 | $component = Context::get('component'); |
49 | 49 | $method = Context::get('method'); |
50 | - if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
50 | + if (!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
51 | 51 | |
52 | 52 | $oEditorModel = getModel('editor'); |
53 | 53 | $oComponent = &$oEditorModel->getComponentObject($component); |
54 | - if(!$oComponent->toBool()) return $oComponent; |
|
54 | + if (!$oComponent->toBool()) return $oComponent; |
|
55 | 55 | |
56 | - if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
56 | + if (!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
57 | 57 | |
58 | 58 | //$output = call_user_method($method, $oComponent); |
59 | 59 | //$output = call_user_func(array($oComponent, $method)); |
60 | - if(method_exists($oComponent, $method)) $output = $oComponent->{$method}(); |
|
61 | - else return new Object(-1,sprintf('%s method is not exists', $method)); |
|
60 | + if (method_exists($oComponent, $method)) $output = $oComponent->{$method}(); |
|
61 | + else return new Object(-1, sprintf('%s method is not exists', $method)); |
|
62 | 62 | |
63 | - if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; |
|
63 | + if ((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; |
|
64 | 64 | |
65 | 65 | $this->setError($oComponent->getError()); |
66 | 66 | $this->setMessage($oComponent->getMessage()); |
67 | 67 | |
68 | 68 | $vars = $oComponent->getVariables(); |
69 | - if(count($vars)) |
|
69 | + if (count($vars)) |
|
70 | 70 | { |
71 | - foreach($vars as $key => $val) |
|
71 | + foreach ($vars as $key => $val) |
|
72 | 72 | { |
73 | 73 | $this->add($key, $val); |
74 | 74 | } |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | $module_srl = array(); |
87 | 87 | $oModuleModel = getModel('module'); |
88 | 88 | |
89 | - foreach($target_module_srl as $srl) |
|
89 | + foreach ($target_module_srl as $srl) |
|
90 | 90 | { |
91 | - if(!$srl) continue; |
|
91 | + if (!$srl) continue; |
|
92 | 92 | |
93 | 93 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($srl); |
94 | - if(!$module_info->module_srl) |
|
94 | + if (!$module_info->module_srl) |
|
95 | 95 | { |
96 | 96 | return new Object(-1, 'msg_invalid_request'); |
97 | 97 | } |
98 | 98 | |
99 | 99 | $module_grant = $oModuleModel->getGrant($module_info, $logged_info); |
100 | - if(!$module_grant->manager) |
|
100 | + if (!$module_grant->manager) |
|
101 | 101 | { |
102 | 102 | return new Object(-1, 'msg_not_permitted'); |
103 | 103 | } |
@@ -111,32 +111,32 @@ discard block |
||
111 | 111 | $editor_config->content_style = Context::get('content_style'); |
112 | 112 | $editor_config->comment_content_style = Context::get('comment_content_style'); |
113 | 113 | $editor_config->content_font = Context::get('content_font'); |
114 | - if($editor_config->content_font) |
|
114 | + if ($editor_config->content_font) |
|
115 | 115 | { |
116 | 116 | $font_list = array(); |
117 | - $fonts = explode(',',$editor_config->content_font); |
|
118 | - for($i=0,$c=count($fonts);$i<$c;$i++) |
|
117 | + $fonts = explode(',', $editor_config->content_font); |
|
118 | + for ($i = 0, $c = count($fonts); $i < $c; $i++) |
|
119 | 119 | { |
120 | - $font = trim(str_replace(array('"','\''),'',$fonts[$i])); |
|
121 | - if(!$font) continue; |
|
120 | + $font = trim(str_replace(array('"', '\''), '', $fonts[$i])); |
|
121 | + if (!$font) continue; |
|
122 | 122 | $font_list[] = $font; |
123 | 123 | } |
124 | - if(count($font_list)) $editor_config->content_font = '"'.implode('","',$font_list).'"'; |
|
124 | + if (count($font_list)) $editor_config->content_font = '"'.implode('","', $font_list).'"'; |
|
125 | 125 | } |
126 | 126 | $editor_config->content_font_size = Context::get('content_font_size'); |
127 | 127 | $editor_config->sel_editor_colorset = Context::get('sel_editor_colorset'); |
128 | 128 | $editor_config->sel_comment_editor_colorset = Context::get('sel_comment_editor_colorset'); |
129 | 129 | |
130 | - $grants = array('enable_html_grant','enable_comment_html_grant','upload_file_grant','comment_upload_file_grant','enable_default_component_grant','enable_comment_default_component_grant','enable_component_grant','enable_comment_component_grant'); |
|
130 | + $grants = array('enable_html_grant', 'enable_comment_html_grant', 'upload_file_grant', 'comment_upload_file_grant', 'enable_default_component_grant', 'enable_comment_default_component_grant', 'enable_component_grant', 'enable_comment_component_grant'); |
|
131 | 131 | |
132 | - foreach($grants as $key) |
|
132 | + foreach ($grants as $key) |
|
133 | 133 | { |
134 | 134 | $grant = Context::get($key); |
135 | - if(!$grant) |
|
135 | + if (!$grant) |
|
136 | 136 | { |
137 | 137 | $editor_config->{$key} = array(); |
138 | 138 | } |
139 | - else if(is_array($grant)) |
|
139 | + else if (is_array($grant)) |
|
140 | 140 | { |
141 | 141 | $editor_config->{$key} = $grant; |
142 | 142 | } |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
149 | - $editor_config->editor_height = (int)Context::get('editor_height'); |
|
150 | - $editor_config->comment_editor_height = (int)Context::get('comment_editor_height'); |
|
149 | + $editor_config->editor_height = (int) Context::get('editor_height'); |
|
150 | + $editor_config->comment_editor_height = (int) Context::get('comment_editor_height'); |
|
151 | 151 | $editor_config->enable_autosave = Context::get('enable_autosave'); |
152 | - if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N'; |
|
152 | + if ($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N'; |
|
153 | 153 | |
154 | 154 | $oModuleController = getController('module'); |
155 | - foreach($module_srl as $srl) |
|
155 | + foreach ($module_srl as $srl) |
|
156 | 156 | { |
157 | 157 | $oModuleController->insertModulePartConfig('editor', $srl, $editor_config); |
158 | 158 | } |
@@ -169,31 +169,31 @@ discard block |
||
169 | 169 | */ |
170 | 170 | function triggerEditorComponentCompile(&$content) |
171 | 171 | { |
172 | - if(Context::getResponseMethod()!='HTML') return new Object(); |
|
172 | + if (Context::getResponseMethod() != 'HTML') return new Object(); |
|
173 | 173 | |
174 | 174 | $module_info = Context::get('module_info'); |
175 | 175 | $module_srl = $module_info->module_srl; |
176 | - if($module_srl) |
|
176 | + if ($module_srl) |
|
177 | 177 | { |
178 | 178 | $oEditorModel = getModel('editor'); |
179 | 179 | $editor_config = $oEditorModel->getEditorConfig($module_srl); |
180 | 180 | $content_style = $editor_config->content_style; |
181 | - if($content_style) |
|
181 | + if ($content_style) |
|
182 | 182 | { |
183 | - $path = _XE_PATH_ . 'modules/editor/styles/'.$content_style.'/'; |
|
184 | - if(is_dir($path) && file_exists($path . 'style.ini')) |
|
183 | + $path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/'; |
|
184 | + if (is_dir($path) && file_exists($path.'style.ini')) |
|
185 | 185 | { |
186 | 186 | $ini = file($path.'style.ini'); |
187 | - for($i = 0, $c = count($ini); $i < $c; $i++) |
|
187 | + for ($i = 0, $c = count($ini); $i < $c; $i++) |
|
188 | 188 | { |
189 | 189 | $file = trim($ini[$i]); |
190 | - if(!$file) continue; |
|
190 | + if (!$file) continue; |
|
191 | 191 | |
192 | - if(substr_compare($file, '.css', -4) === 0) |
|
192 | + if (substr_compare($file, '.css', -4) === 0) |
|
193 | 193 | { |
194 | 194 | Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false); |
195 | 195 | } |
196 | - elseif(substr_compare($file, '.js', -3) === 0) |
|
196 | + elseif (substr_compare($file, '.js', -3) === 0) |
|
197 | 197 | { |
198 | 198 | Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false); |
199 | 199 | } |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | } |
203 | 203 | $content_font = $editor_config->content_font; |
204 | 204 | $content_font_size = $editor_config->content_font_size; |
205 | - if($content_font || $content_font_size) |
|
205 | + if ($content_font || $content_font_size) |
|
206 | 206 | { |
207 | 207 | $buff = array(); |
208 | 208 | $buff[] = '<style> .xe_content { '; |
209 | - if($content_font) $buff[] = 'font-family:'.$content_font.';'; |
|
210 | - if($content_font_size) $buff[] = 'font-size:'.$content_font_size.';'; |
|
209 | + if ($content_font) $buff[] = 'font-family:'.$content_font.';'; |
|
210 | + if ($content_font_size) $buff[] = 'font-size:'.$content_font_size.';'; |
|
211 | 211 | $buff[] = ' }</style>'; |
212 | 212 | Context::addHtmlHeader(implode('', $buff)); |
213 | 213 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | function transComponent($content) |
224 | 224 | { |
225 | - $content = preg_replace_callback('!<(?:(div)|img)([^>]*)editor_component=([^>]*)>(?(1)(.*?)</div>)!is', array($this,'transEditorComponent'), $content); |
|
225 | + $content = preg_replace_callback('!<(?:(div)|img)([^>]*)editor_component=([^>]*)>(?(1)(.*?)</div>)!is', array($this, 'transEditorComponent'), $content); |
|
226 | 226 | return $content; |
227 | 227 | } |
228 | 228 | |
@@ -237,19 +237,19 @@ discard block |
||
237 | 237 | |
238 | 238 | $xml_obj = new stdClass; |
239 | 239 | $xml_obj->attrs = new stdClass; |
240 | - for($i=0,$c=count($m[0]);$i<$c;$i++) |
|
240 | + for ($i = 0, $c = count($m[0]); $i < $c; $i++) |
|
241 | 241 | { |
242 | - if(!isset($xml_obj->attrs)) $xml_obj->attrs = new stdClass; |
|
242 | + if (!isset($xml_obj->attrs)) $xml_obj->attrs = new stdClass; |
|
243 | 243 | $xml_obj->attrs->{$m[1][$i]} = $m[2][$i]; |
244 | 244 | } |
245 | 245 | $xml_obj->body = $match[4]; |
246 | 246 | |
247 | - if(!$xml_obj->attrs->editor_component) return $match[0]; |
|
247 | + if (!$xml_obj->attrs->editor_component) return $match[0]; |
|
248 | 248 | |
249 | 249 | // Get converted codes by using component::transHTML() |
250 | 250 | $oEditorModel = getModel('editor'); |
251 | 251 | $oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0); |
252 | - if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $match[0]; |
|
252 | + if (!is_object($oComponent) || !method_exists($oComponent, 'transHTML')) return $match[0]; |
|
253 | 253 | |
254 | 254 | return $oComponent->transHTML($xml_obj); |
255 | 255 | } |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | */ |
260 | 260 | function doSaveDoc($args) |
261 | 261 | { |
262 | - if(!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
263 | - if(Context::get('is_logged')) |
|
262 | + if (!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
263 | + if (Context::get('is_logged')) |
|
264 | 264 | { |
265 | 265 | $logged_info = Context::get('logged_info'); |
266 | 266 | $args->member_srl = $logged_info->member_srl; |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | // Get the current module if module_srl doesn't exist |
274 | - if(!$args->module_srl) |
|
274 | + if (!$args->module_srl) |
|
275 | 275 | { |
276 | 276 | $args->module_srl = Context::get('module_srl'); |
277 | 277 | } |
278 | - if(!$args->module_srl) |
|
278 | + if (!$args->module_srl) |
|
279 | 279 | { |
280 | 280 | $current_module_info = Context::get('current_module_info'); |
281 | 281 | $args->module_srl = $current_module_info->module_srl; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | function deleteSavedDoc($mode = false) |
322 | 322 | { |
323 | 323 | $args = new stdClass(); |
324 | - if(Context::get('is_logged')) |
|
324 | + if (Context::get('is_logged')) |
|
325 | 325 | { |
326 | 326 | $logged_info = Context::get('logged_info'); |
327 | 327 | $args->member_srl = $logged_info->member_srl; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | } |
333 | 333 | $args->module_srl = Context::get('module_srl'); |
334 | 334 | // Get the current module if module_srl doesn't exist |
335 | - if(!$args->module_srl) |
|
335 | + if (!$args->module_srl) |
|
336 | 336 | { |
337 | 337 | $current_module_info = Context::get('current_module_info'); |
338 | 338 | $args->module_srl = $current_module_info->module_srl; |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | // Check if the auto-saved document already exists |
341 | 341 | $output = executeQuery('editor.getSavedDocument', $args); |
342 | 342 | $saved_doc = $output->data; |
343 | - if(!$saved_doc) return; |
|
343 | + if (!$saved_doc) return; |
|
344 | 344 | |
345 | 345 | $oDocumentModel = getModel('document'); |
346 | 346 | $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); |
347 | - if(!$oSaved->isExists()) |
|
347 | + if (!$oSaved->isExists()) |
|
348 | 348 | { |
349 | - if($mode) |
|
349 | + if ($mode) |
|
350 | 350 | { |
351 | 351 | $output = executeQuery('editor.getSavedDocument', $args); |
352 | 352 | $output = ModuleHandler::triggerCall('editor.deleteSavedDoc', 'after', $saved_doc); |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | $oEditorModel = getModel('editor'); |
375 | 375 | $args = new stdClass; |
376 | 376 | |
377 | - if($filter_enabled) $args->enabled = "Y"; |
|
377 | + if ($filter_enabled) $args->enabled = "Y"; |
|
378 | 378 | |
379 | - if($site_srl) |
|
379 | + if ($site_srl) |
|
380 | 380 | { |
381 | 381 | $args->site_srl = $site_srl; |
382 | 382 | $output = executeQuery('editor.getSiteComponentList', $args); |
@@ -389,10 +389,10 @@ discard block |
||
389 | 389 | |
390 | 390 | // Get information about log-in status and its group |
391 | 391 | $is_logged = Context::get('is_logged'); |
392 | - if($is_logged) |
|
392 | + if ($is_logged) |
|
393 | 393 | { |
394 | 394 | $logged_info = Context::get('logged_info'); |
395 | - if($logged_info->group_list && is_array($logged_info->group_list)) |
|
395 | + if ($logged_info->group_list && is_array($logged_info->group_list)) |
|
396 | 396 | { |
397 | 397 | $group_list = array_keys($logged_info->group_list); |
398 | 398 | } |
@@ -400,30 +400,30 @@ discard block |
||
400 | 400 | } |
401 | 401 | |
402 | 402 | // Get xml information for looping DB list |
403 | - if(!is_array($db_list)) $db_list = array($db_list); |
|
403 | + if (!is_array($db_list)) $db_list = array($db_list); |
|
404 | 404 | $component_list = new stdClass(); |
405 | - foreach($db_list as $component) |
|
405 | + foreach ($db_list as $component) |
|
406 | 406 | { |
407 | - if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue; |
|
407 | + if (in_array($component->component_name, array('colorpicker_text', 'colorpicker_bg'))) continue; |
|
408 | 408 | |
409 | 409 | $component_name = $component->component_name; |
410 | - if(!$component_name) continue; |
|
410 | + if (!$component_name) continue; |
|
411 | 411 | |
412 | - if(!in_array($component_name, $downloaded_list)) continue; |
|
412 | + if (!in_array($component_name, $downloaded_list)) continue; |
|
413 | 413 | |
414 | 414 | unset($xml_info); |
415 | 415 | $xml_info = $oEditorModel->getComponentXmlInfo($component_name); |
416 | 416 | $xml_info->enabled = $component->enabled; |
417 | 417 | |
418 | - if($component->extra_vars) |
|
418 | + if ($component->extra_vars) |
|
419 | 419 | { |
420 | 420 | $extra_vars = unserialize($component->extra_vars); |
421 | - if($extra_vars->target_group) |
|
421 | + if ($extra_vars->target_group) |
|
422 | 422 | { |
423 | 423 | $xml_info->target_group = $extra_vars->target_group; |
424 | 424 | } |
425 | 425 | |
426 | - if($extra_vars->mid_list && count($extra_vars->mid_list)) |
|
426 | + if ($extra_vars->mid_list && count($extra_vars->mid_list)) |
|
427 | 427 | { |
428 | 428 | $xml_info->mid_list = $extra_vars->mid_list; |
429 | 429 | } |
@@ -450,9 +450,9 @@ discard block |
||
450 | 450 | if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue; |
451 | 451 | }*/ |
452 | 452 | // Check the configuration of the editor component |
453 | - if($xml_info->extra_vars) |
|
453 | + if ($xml_info->extra_vars) |
|
454 | 454 | { |
455 | - foreach($xml_info->extra_vars as $key => $val) |
|
455 | + foreach ($xml_info->extra_vars as $key => $val) |
|
456 | 456 | { |
457 | 457 | $xml_info->extra_vars->{$key}->value = $extra_vars->{$key}; |
458 | 458 | } |
@@ -463,25 +463,25 @@ discard block |
||
463 | 463 | // Get buttons, icons, images |
464 | 464 | $icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/icon.gif'; |
465 | 465 | $component_icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/component_icon.gif'; |
466 | - if(file_exists($icon_file)) $component_list->{$component_name}->icon = true; |
|
467 | - if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; |
|
466 | + if (file_exists($icon_file)) $component_list->{$component_name}->icon = true; |
|
467 | + if (file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | // Return if it checks enabled only |
471 | - if($filter_enabled) |
|
471 | + if ($filter_enabled) |
|
472 | 472 | { |
473 | 473 | $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); |
474 | - $buff = sprintf('<?php if(!defined("__XE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"','\\"',serialize($component_list))); |
|
474 | + $buff = sprintf('<?php if(!defined("__XE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"', '\\"', serialize($component_list))); |
|
475 | 475 | FileHandler::writeFile($cache_file, $buff); |
476 | 476 | return $component_list; |
477 | 477 | } |
478 | 478 | |
479 | 479 | // Get xml_info of downloaded list |
480 | - foreach($downloaded_list as $component_name) |
|
480 | + foreach ($downloaded_list as $component_name) |
|
481 | 481 | { |
482 | - if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue; |
|
482 | + if (in_array($component_name, array('colorpicker_text', 'colorpicker_bg'))) continue; |
|
483 | 483 | // Pass if configured |
484 | - if($component_list->{$component_name}) continue; |
|
484 | + if ($component_list->{$component_name}) continue; |
|
485 | 485 | // Insert data into the DB |
486 | 486 | $oEditorController = getAdminController('editor'); |
487 | 487 | $oEditorController->insertComponent($component_name, false, $site_srl); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | } |
495 | 495 | |
496 | 496 | $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); |
497 | - $buff = sprintf('<?php if(!defined("__XE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"','\\"',serialize($component_list))); |
|
497 | + $buff = sprintf('<?php if(!defined("__XE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"', '\\"', serialize($component_list))); |
|
498 | 498 | FileHandler::writeFile($cache_file, $buff); |
499 | 499 | |
500 | 500 | return $component_list; |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | $editorConfig = $oModuleModel->getModulePartConfig('editor', $obj->originModuleSrl); |
517 | 517 | |
518 | 518 | $oModuleController = getController('module'); |
519 | - if(is_array($obj->moduleSrlList)) |
|
519 | + if (is_array($obj->moduleSrlList)) |
|
520 | 520 | { |
521 | - foreach($obj->moduleSrlList AS $key=>$moduleSrl) |
|
521 | + foreach ($obj->moduleSrlList AS $key=>$moduleSrl) |
|
522 | 522 | { |
523 | 523 | $oModuleController->insertModulePartConfig('editor', $moduleSrl, $editorConfig); |
524 | 524 | } |
@@ -47,20 +47,31 @@ discard block |
||
47 | 47 | { |
48 | 48 | $component = Context::get('component'); |
49 | 49 | $method = Context::get('method'); |
50 | - if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
50 | + if(!$component) { |
|
51 | + return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
52 | + } |
|
51 | 53 | |
52 | 54 | $oEditorModel = getModel('editor'); |
53 | 55 | $oComponent = &$oEditorModel->getComponentObject($component); |
54 | - if(!$oComponent->toBool()) return $oComponent; |
|
56 | + if(!$oComponent->toBool()) { |
|
57 | + return $oComponent; |
|
58 | + } |
|
55 | 59 | |
56 | - if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
60 | + if(!method_exists($oComponent, $method)) { |
|
61 | + return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); |
|
62 | + } |
|
57 | 63 | |
58 | 64 | //$output = call_user_method($method, $oComponent); |
59 | 65 | //$output = call_user_func(array($oComponent, $method)); |
60 | - if(method_exists($oComponent, $method)) $output = $oComponent->{$method}(); |
|
61 | - else return new Object(-1,sprintf('%s method is not exists', $method)); |
|
66 | + if(method_exists($oComponent, $method)) { |
|
67 | + $output = $oComponent->{$method}(); |
|
68 | + } else { |
|
69 | + return new Object(-1,sprintf('%s method is not exists', $method)); |
|
70 | + } |
|
62 | 71 | |
63 | - if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; |
|
72 | + if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) { |
|
73 | + return $output; |
|
74 | + } |
|
64 | 75 | |
65 | 76 | $this->setError($oComponent->getError()); |
66 | 77 | $this->setMessage($oComponent->getMessage()); |
@@ -88,7 +99,9 @@ discard block |
||
88 | 99 | |
89 | 100 | foreach($target_module_srl as $srl) |
90 | 101 | { |
91 | - if(!$srl) continue; |
|
102 | + if(!$srl) { |
|
103 | + continue; |
|
104 | + } |
|
92 | 105 | |
93 | 106 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($srl); |
94 | 107 | if(!$module_info->module_srl) |
@@ -118,10 +131,14 @@ discard block |
||
118 | 131 | for($i=0,$c=count($fonts);$i<$c;$i++) |
119 | 132 | { |
120 | 133 | $font = trim(str_replace(array('"','\''),'',$fonts[$i])); |
121 | - if(!$font) continue; |
|
134 | + if(!$font) { |
|
135 | + continue; |
|
136 | + } |
|
122 | 137 | $font_list[] = $font; |
123 | 138 | } |
124 | - if(count($font_list)) $editor_config->content_font = '"'.implode('","',$font_list).'"'; |
|
139 | + if(count($font_list)) { |
|
140 | + $editor_config->content_font = '"'.implode('","',$font_list).'"'; |
|
141 | + } |
|
125 | 142 | } |
126 | 143 | $editor_config->content_font_size = Context::get('content_font_size'); |
127 | 144 | $editor_config->sel_editor_colorset = Context::get('sel_editor_colorset'); |
@@ -135,12 +152,10 @@ discard block |
||
135 | 152 | if(!$grant) |
136 | 153 | { |
137 | 154 | $editor_config->{$key} = array(); |
138 | - } |
|
139 | - else if(is_array($grant)) |
|
155 | + } else if(is_array($grant)) |
|
140 | 156 | { |
141 | 157 | $editor_config->{$key} = $grant; |
142 | - } |
|
143 | - else |
|
158 | + } else |
|
144 | 159 | { |
145 | 160 | $editor_config->{$key} = explode('|@|', $grant); |
146 | 161 | } |
@@ -149,7 +164,9 @@ discard block |
||
149 | 164 | $editor_config->editor_height = (int)Context::get('editor_height'); |
150 | 165 | $editor_config->comment_editor_height = (int)Context::get('comment_editor_height'); |
151 | 166 | $editor_config->enable_autosave = Context::get('enable_autosave'); |
152 | - if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N'; |
|
167 | + if($editor_config->enable_autosave != 'Y') { |
|
168 | + $editor_config->enable_autosave = 'N'; |
|
169 | + } |
|
153 | 170 | |
154 | 171 | $oModuleController = getController('module'); |
155 | 172 | foreach($module_srl as $srl) |
@@ -169,7 +186,9 @@ discard block |
||
169 | 186 | */ |
170 | 187 | function triggerEditorComponentCompile(&$content) |
171 | 188 | { |
172 | - if(Context::getResponseMethod()!='HTML') return new Object(); |
|
189 | + if(Context::getResponseMethod()!='HTML') { |
|
190 | + return new Object(); |
|
191 | + } |
|
173 | 192 | |
174 | 193 | $module_info = Context::get('module_info'); |
175 | 194 | $module_srl = $module_info->module_srl; |
@@ -187,13 +206,14 @@ discard block |
||
187 | 206 | for($i = 0, $c = count($ini); $i < $c; $i++) |
188 | 207 | { |
189 | 208 | $file = trim($ini[$i]); |
190 | - if(!$file) continue; |
|
209 | + if(!$file) { |
|
210 | + continue; |
|
211 | + } |
|
191 | 212 | |
192 | 213 | if(substr_compare($file, '.css', -4) === 0) |
193 | 214 | { |
194 | 215 | Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false); |
195 | - } |
|
196 | - elseif(substr_compare($file, '.js', -3) === 0) |
|
216 | + } elseif(substr_compare($file, '.js', -3) === 0) |
|
197 | 217 | { |
198 | 218 | Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false); |
199 | 219 | } |
@@ -206,8 +226,12 @@ discard block |
||
206 | 226 | { |
207 | 227 | $buff = array(); |
208 | 228 | $buff[] = '<style> .xe_content { '; |
209 | - if($content_font) $buff[] = 'font-family:'.$content_font.';'; |
|
210 | - if($content_font_size) $buff[] = 'font-size:'.$content_font_size.';'; |
|
229 | + if($content_font) { |
|
230 | + $buff[] = 'font-family:'.$content_font.';'; |
|
231 | + } |
|
232 | + if($content_font_size) { |
|
233 | + $buff[] = 'font-size:'.$content_font_size.';'; |
|
234 | + } |
|
211 | 235 | $buff[] = ' }</style>'; |
212 | 236 | Context::addHtmlHeader(implode('', $buff)); |
213 | 237 | } |
@@ -239,17 +263,23 @@ discard block |
||
239 | 263 | $xml_obj->attrs = new stdClass; |
240 | 264 | for($i=0,$c=count($m[0]);$i<$c;$i++) |
241 | 265 | { |
242 | - if(!isset($xml_obj->attrs)) $xml_obj->attrs = new stdClass; |
|
266 | + if(!isset($xml_obj->attrs)) { |
|
267 | + $xml_obj->attrs = new stdClass; |
|
268 | + } |
|
243 | 269 | $xml_obj->attrs->{$m[1][$i]} = $m[2][$i]; |
244 | 270 | } |
245 | 271 | $xml_obj->body = $match[4]; |
246 | 272 | |
247 | - if(!$xml_obj->attrs->editor_component) return $match[0]; |
|
273 | + if(!$xml_obj->attrs->editor_component) { |
|
274 | + return $match[0]; |
|
275 | + } |
|
248 | 276 | |
249 | 277 | // Get converted codes by using component::transHTML() |
250 | 278 | $oEditorModel = getModel('editor'); |
251 | 279 | $oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0); |
252 | - if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $match[0]; |
|
280 | + if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) { |
|
281 | + return $match[0]; |
|
282 | + } |
|
253 | 283 | |
254 | 284 | return $oComponent->transHTML($xml_obj); |
255 | 285 | } |
@@ -259,13 +289,14 @@ discard block |
||
259 | 289 | */ |
260 | 290 | function doSaveDoc($args) |
261 | 291 | { |
262 | - if(!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
292 | + if(!$args->document_srl) { |
|
293 | + $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; |
|
294 | + } |
|
263 | 295 | if(Context::get('is_logged')) |
264 | 296 | { |
265 | 297 | $logged_info = Context::get('logged_info'); |
266 | 298 | $args->member_srl = $logged_info->member_srl; |
267 | - } |
|
268 | - else |
|
299 | + } else |
|
269 | 300 | { |
270 | 301 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
271 | 302 | } |
@@ -325,8 +356,7 @@ discard block |
||
325 | 356 | { |
326 | 357 | $logged_info = Context::get('logged_info'); |
327 | 358 | $args->member_srl = $logged_info->member_srl; |
328 | - } |
|
329 | - else |
|
359 | + } else |
|
330 | 360 | { |
331 | 361 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
332 | 362 | } |
@@ -340,7 +370,9 @@ discard block |
||
340 | 370 | // Check if the auto-saved document already exists |
341 | 371 | $output = executeQuery('editor.getSavedDocument', $args); |
342 | 372 | $saved_doc = $output->data; |
343 | - if(!$saved_doc) return; |
|
373 | + if(!$saved_doc) { |
|
374 | + return; |
|
375 | + } |
|
344 | 376 | |
345 | 377 | $oDocumentModel = getModel('document'); |
346 | 378 | $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); |
@@ -374,14 +406,17 @@ discard block |
||
374 | 406 | $oEditorModel = getModel('editor'); |
375 | 407 | $args = new stdClass; |
376 | 408 | |
377 | - if($filter_enabled) $args->enabled = "Y"; |
|
409 | + if($filter_enabled) { |
|
410 | + $args->enabled = "Y"; |
|
411 | + } |
|
378 | 412 | |
379 | 413 | if($site_srl) |
380 | 414 | { |
381 | 415 | $args->site_srl = $site_srl; |
382 | 416 | $output = executeQuery('editor.getSiteComponentList', $args); |
417 | + } else { |
|
418 | + $output = executeQuery('editor.getComponentList', $args); |
|
383 | 419 | } |
384 | - else $output = executeQuery('editor.getComponentList', $args); |
|
385 | 420 | $db_list = $output->data; |
386 | 421 | |
387 | 422 | // Get a list of files |
@@ -395,21 +430,30 @@ discard block |
||
395 | 430 | if($logged_info->group_list && is_array($logged_info->group_list)) |
396 | 431 | { |
397 | 432 | $group_list = array_keys($logged_info->group_list); |
433 | + } else { |
|
434 | + $group_list = array(); |
|
398 | 435 | } |
399 | - else $group_list = array(); |
|
400 | 436 | } |
401 | 437 | |
402 | 438 | // Get xml information for looping DB list |
403 | - if(!is_array($db_list)) $db_list = array($db_list); |
|
439 | + if(!is_array($db_list)) { |
|
440 | + $db_list = array($db_list); |
|
441 | + } |
|
404 | 442 | $component_list = new stdClass(); |
405 | 443 | foreach($db_list as $component) |
406 | 444 | { |
407 | - if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue; |
|
445 | + if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) { |
|
446 | + continue; |
|
447 | + } |
|
408 | 448 | |
409 | 449 | $component_name = $component->component_name; |
410 | - if(!$component_name) continue; |
|
450 | + if(!$component_name) { |
|
451 | + continue; |
|
452 | + } |
|
411 | 453 | |
412 | - if(!in_array($component_name, $downloaded_list)) continue; |
|
454 | + if(!in_array($component_name, $downloaded_list)) { |
|
455 | + continue; |
|
456 | + } |
|
413 | 457 | |
414 | 458 | unset($xml_info); |
415 | 459 | $xml_info = $oEditorModel->getComponentXmlInfo($component_name); |
@@ -463,8 +507,12 @@ discard block |
||
463 | 507 | // Get buttons, icons, images |
464 | 508 | $icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/icon.gif'; |
465 | 509 | $component_icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/component_icon.gif'; |
466 | - if(file_exists($icon_file)) $component_list->{$component_name}->icon = true; |
|
467 | - if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; |
|
510 | + if(file_exists($icon_file)) { |
|
511 | + $component_list->{$component_name}->icon = true; |
|
512 | + } |
|
513 | + if(file_exists($component_icon_file)) { |
|
514 | + $component_list->{$component_name}->component_icon = true; |
|
515 | + } |
|
468 | 516 | } |
469 | 517 | |
470 | 518 | // Return if it checks enabled only |
@@ -479,9 +527,13 @@ discard block |
||
479 | 527 | // Get xml_info of downloaded list |
480 | 528 | foreach($downloaded_list as $component_name) |
481 | 529 | { |
482 | - if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue; |
|
530 | + if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) { |
|
531 | + continue; |
|
532 | + } |
|
483 | 533 | // Pass if configured |
484 | - if($component_list->{$component_name}) continue; |
|
534 | + if($component_list->{$component_name}) { |
|
535 | + continue; |
|
536 | + } |
|
485 | 537 | // Insert data into the DB |
486 | 538 | $oEditorController = getAdminController('editor'); |
487 | 539 | $oEditorController->insertComponent($component_name, false, $site_srl); |