@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | function init() |
18 | 18 | { |
19 | 19 | // 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음) |
20 | - $template_path = sprintf("%stpl/",$this->module_path); |
|
20 | + $template_path = sprintf("%stpl/", $this->module_path); |
|
21 | 21 | $this->setTemplatePath($template_path); |
22 | 22 | } |
23 | 23 | |
@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | $oModuleModel = getModel('module'); |
52 | 52 | $module_list = array(); |
53 | 53 | $mod_srls = array(); |
54 | - foreach($output->data as $oTrashVO) |
|
54 | + foreach ($output->data as $oTrashVO) |
|
55 | 55 | { |
56 | 56 | $mod_srls[] = $oTrashVO->unserializedObject['module_srl']; |
57 | 57 | } |
58 | 58 | $mod_srls = array_unique($mod_srls); |
59 | 59 | // Module List |
60 | 60 | $mod_srls_count = count($mod_srls); |
61 | - if($mod_srls_count) |
|
61 | + if ($mod_srls_count) |
|
62 | 62 | { |
63 | 63 | $columnList = array('module_srl', 'mid', 'browser_title'); |
64 | 64 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
65 | - if($module_output && is_array($module_output)) |
|
65 | + if ($module_output && is_array($module_output)) |
|
66 | 66 | { |
67 | - foreach($module_output as $module) |
|
67 | + foreach ($module_output as $module) |
|
68 | 68 | { |
69 | 69 | $module_list[$module->module_srl] = $module; |
70 | 70 | } |
@@ -86,13 +86,13 @@ discard block |
||
86 | 86 | |
87 | 87 | $oTrashModel = getModel('trash'); |
88 | 88 | $output = $oTrashModel->getTrash($trash_srl); |
89 | - if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
89 | + if (!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
90 | 90 | |
91 | 91 | $originObject = unserialize($output->data->getSerializedObject()); |
92 | - if(is_array($originObject)) $originObject = (object)$originObject; |
|
92 | + if (is_array($originObject)) $originObject = (object) $originObject; |
|
93 | 93 | |
94 | - Context::set('oTrashVO',$output->data); |
|
95 | - Context::set('oOrigin',$originObject); |
|
94 | + Context::set('oTrashVO', $output->data); |
|
95 | + Context::set('oOrigin', $originObject); |
|
96 | 96 | |
97 | 97 | $oMemberModel = &getModel('member'); |
98 | 98 | $remover_info = $oMemberModel->getMemberInfoByMemberSrl($output->data->getRemoverSrl()); |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($originObject->module_srl); |
103 | 103 | Context::set('module_info', $module_info); |
104 | 104 | |
105 | - if($originObject) { |
|
105 | + if ($originObject) { |
|
106 | 106 | $args_extra->module_srl = $originObject->module_srl; |
107 | 107 | $args_extra->document_srl = $originObject->document_srl; |
108 | 108 | $output_extra = executeQueryArray('trash.getDocumentExtraVars', $args_extra); |
109 | - Context::set('oOriginExtraVars',$output_extra->data); |
|
109 | + Context::set('oOriginExtraVars', $output_extra->data); |
|
110 | 110 | } |
111 | 111 | $this->setTemplateFile('trash_view'); |
112 | 112 | } |
@@ -86,10 +86,14 @@ |
||
86 | 86 | |
87 | 87 | $oTrashModel = getModel('trash'); |
88 | 88 | $output = $oTrashModel->getTrash($trash_srl); |
89 | - if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request'); |
|
89 | + if(!$output->data->getTrashSrl()) { |
|
90 | + return new Object(-1, 'msg_invalid_request'); |
|
91 | + } |
|
90 | 92 | |
91 | 93 | $originObject = unserialize($output->data->getSerializedObject()); |
92 | - if(is_array($originObject)) $originObject = (object)$originObject; |
|
94 | + if(is_array($originObject)) { |
|
95 | + $originObject = (object)$originObject; |
|
96 | + } |
|
93 | 97 | |
94 | 98 | Context::set('oTrashVO',$output->data); |
95 | 99 | Context::set('oOrigin',$originObject); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | function getTrash($trashSrl, $columnList = array()) |
20 | 20 | { |
21 | 21 | $oTrashVO = new TrashVO(); |
22 | - if(!$trashSrl) return $oTrashVO; |
|
22 | + if (!$trashSrl) return $oTrashVO; |
|
23 | 23 | |
24 | 24 | $args = new stdClass(); |
25 | 25 | $args->trashSrl = $trashSrl; |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | { |
42 | 42 | $output = executeQueryArray('trash.getTrashList', $args, $columnList); |
43 | 43 | |
44 | - if(is_array($output->data)) |
|
44 | + if (is_array($output->data)) |
|
45 | 45 | { |
46 | - foreach($output->data AS $key=>$value) |
|
46 | + foreach ($output->data AS $key=>$value) |
|
47 | 47 | { |
48 | 48 | $oTrashVO = new TrashVO(); |
49 | 49 | $this->_setTrashObject($oTrashVO, $value); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | { |
64 | 64 | $output = executeQueryArray('trash.getTrashAllList', $args, $columnList); |
65 | 65 | |
66 | - if(is_array($output->data)) |
|
66 | + if (is_array($output->data)) |
|
67 | 67 | { |
68 | - foreach($output->data AS $key=>$value) |
|
68 | + foreach ($output->data AS $key=>$value) |
|
69 | 69 | { |
70 | 70 | $oTrashVO = new TrashVO(); |
71 | 71 | $this->_setTrashObject($oTrashVO, $value); |
@@ -19,7 +19,9 @@ |
||
19 | 19 | function getTrash($trashSrl, $columnList = array()) |
20 | 20 | { |
21 | 21 | $oTrashVO = new TrashVO(); |
22 | - if(!$trashSrl) return $oTrashVO; |
|
22 | + if(!$trashSrl) { |
|
23 | + return $oTrashVO; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $args = new stdClass(); |
25 | 27 | $args->trashSrl = $trashSrl; |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | if($widget->widget) |
33 | 33 | { |
34 | 34 | $widget_list[$no]->description = nl2br(trim($widget->description)); |
35 | - } |
|
36 | - else |
|
35 | + } else |
|
37 | 36 | { |
38 | 37 | unset($widget_list[$no]); |
39 | 38 | } |
@@ -59,7 +58,9 @@ discard block |
||
59 | 58 | function dispWidgetAdminAddContent() |
60 | 59 | { |
61 | 60 | $module_srl = Context::get('module_srl'); |
62 | - if(!$module_srl) return $this->stop("msg_invalid_request"); |
|
61 | + if(!$module_srl) { |
|
62 | + return $this->stop("msg_invalid_request"); |
|
63 | + } |
|
63 | 64 | |
64 | 65 | $document_srl = Context::get('document_srl'); |
65 | 66 | $oDocumentModel = getModel('document'); |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | $security = new Security($widget_list); |
28 | 28 | $widget_list = $security->encodeHTML('..', '..author..'); |
29 | 29 | |
30 | - foreach($widget_list as $no => $widget) |
|
30 | + foreach ($widget_list as $no => $widget) |
|
31 | 31 | { |
32 | - if($widget->widget) |
|
32 | + if ($widget->widget) |
|
33 | 33 | { |
34 | 34 | $widget_list[$no]->description = nl2br(trim($widget->description)); |
35 | 35 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function dispWidgetAdminAddContent() |
60 | 60 | { |
61 | 61 | $module_srl = Context::get('module_srl'); |
62 | - if(!$module_srl) return $this->stop("msg_invalid_request"); |
|
62 | + if (!$module_srl) return $this->stop("msg_invalid_request"); |
|
63 | 63 | |
64 | 64 | $document_srl = Context::get('document_srl'); |
65 | 65 | $oDocumentModel = getModel('document'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | Context::set('module_info', $module_info); |
73 | 73 | // Editors settings of the module by calling getEditor |
74 | 74 | $oEditorModel = getModel('editor'); |
75 | - $editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content'); |
|
75 | + $editor = $oEditorModel->getModuleEditor('document', $module_srl, $module_srl, 'module_srl', 'content'); |
|
76 | 76 | Context::set('editor', $editor); |
77 | 77 | |
78 | 78 | $security = new Security(); |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | function getWidgetPath($widget_name) |
22 | 22 | { |
23 | 23 | $path = sprintf('./widgets/%s/', $widget_name); |
24 | - if(is_dir($path)) return $path; |
|
24 | + if(is_dir($path)) { |
|
25 | + return $path; |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return ""; |
27 | 29 | } |
@@ -32,7 +34,9 @@ discard block |
||
32 | 34 | function getWidgetStylePath($widgetStyle_name) |
33 | 35 | { |
34 | 36 | $path = sprintf('./widgetstyles/%s/', $widgetStyle_name); |
35 | - if(is_dir($path)) return $path; |
|
37 | + if(is_dir($path)) { |
|
38 | + return $path; |
|
39 | + } |
|
36 | 40 | |
37 | 41 | return ""; |
38 | 42 | } |
@@ -58,7 +62,9 @@ discard block |
||
58 | 62 | // 've Downloaded the widget and the widget's list of installed Wanted |
59 | 63 | $searched_list = FileHandler::readDir('./widgets'); |
60 | 64 | $searched_count = count($searched_list); |
61 | - if(!$searched_count) return; |
|
65 | + if(!$searched_count) { |
|
66 | + return; |
|
67 | + } |
|
62 | 68 | sort($searched_list); |
63 | 69 | // D which pertain to the list of widgets loop spins return statement review the information you need |
64 | 70 | for($i=0;$i<$searched_count;$i++) |
@@ -101,7 +107,9 @@ discard block |
||
101 | 107 | // 've Downloaded the widget and the widget's list of installed Wanted |
102 | 108 | $searched_list = FileHandler::readDir('./widgetstyles'); |
103 | 109 | $searched_count = count($searched_list); |
104 | - if(!$searched_count) return; |
|
110 | + if(!$searched_count) { |
|
111 | + return; |
|
112 | + } |
|
105 | 113 | sort($searched_list); |
106 | 114 | // D which pertain to the list of widgets loop spins return statement review the information you need |
107 | 115 | for($i=0;$i<$searched_count;$i++) |
@@ -124,10 +132,14 @@ discard block |
||
124 | 132 | { |
125 | 133 | // Get a path of the requested module. Return if not exists. |
126 | 134 | $widget_path = $this->getWidgetPath($widget); |
127 | - if(!$widget_path) return; |
|
135 | + if(!$widget_path) { |
|
136 | + return; |
|
137 | + } |
|
128 | 138 | // Read the xml file for module skin information |
129 | 139 | $xml_file = sprintf("%sconf/info.xml", $widget_path); |
130 | - if(!file_exists($xml_file)) return; |
|
140 | + if(!file_exists($xml_file)) { |
|
141 | + return; |
|
142 | + } |
|
131 | 143 | // If the problem by comparing the cache file and include the return variable $widget_info |
132 | 144 | $cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType()); |
133 | 145 | |
@@ -140,7 +152,9 @@ discard block |
||
140 | 152 | $oXmlParser = new XmlParser(); |
141 | 153 | $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); |
142 | 154 | $xml_obj = $tmp_xml_obj->widget; |
143 | - if(!$xml_obj) return; |
|
155 | + if(!$xml_obj) { |
|
156 | + return; |
|
157 | + } |
|
144 | 158 | |
145 | 159 | $buff = '$widget_info = new stdClass;'; |
146 | 160 | |
@@ -161,8 +175,11 @@ discard block |
||
161 | 175 | $buff .= sprintf('$widget_info->widget_srl = $widget_srl;'); |
162 | 176 | $buff .= sprintf('$widget_info->widget_title = $widget_title;'); |
163 | 177 | // Author information |
164 | - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
165 | - else $author_list = $xml_obj->author; |
|
178 | + if(!is_array($xml_obj->author)) { |
|
179 | + $author_list[] = $xml_obj->author; |
|
180 | + } else { |
|
181 | + $author_list = $xml_obj->author; |
|
182 | + } |
|
166 | 183 | |
167 | 184 | for($i=0; $i < count($author_list); $i++) |
168 | 185 | { |
@@ -171,8 +188,7 @@ discard block |
||
171 | 188 | $buff .= sprintf('$widget_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address); |
172 | 189 | $buff .= sprintf('$widget_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link); |
173 | 190 | } |
174 | - } |
|
175 | - else |
|
191 | + } else |
|
176 | 192 | { |
177 | 193 | // Title of the widget, version |
178 | 194 | $buff .= sprintf('$widget_info->widget = "%s";', $widget); |
@@ -193,12 +209,18 @@ discard block |
||
193 | 209 | } |
194 | 210 | // Extra vars (user defined variables to use in a template) |
195 | 211 | $extra_var_groups = $xml_obj->extra_vars->group; |
196 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
197 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
212 | + if(!$extra_var_groups) { |
|
213 | + $extra_var_groups = $xml_obj->extra_vars; |
|
214 | + } |
|
215 | + if(!is_array($extra_var_groups)) { |
|
216 | + $extra_var_groups = array($extra_var_groups); |
|
217 | + } |
|
198 | 218 | foreach($extra_var_groups as $group) |
199 | 219 | { |
200 | 220 | $extra_vars = $group->var; |
201 | - if(!is_array($group->var)) $extra_vars = array($group->var); |
|
221 | + if(!is_array($group->var)) { |
|
222 | + $extra_vars = array($group->var); |
|
223 | + } |
|
202 | 224 | |
203 | 225 | if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) |
204 | 226 | { |
@@ -228,9 +250,13 @@ discard block |
||
228 | 250 | $buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body)); |
229 | 251 | |
230 | 252 | $options = $var->options; |
231 | - if(!$options) continue; |
|
253 | + if(!$options) { |
|
254 | + continue; |
|
255 | + } |
|
232 | 256 | |
233 | - if(!is_array($options)) $options = array($options); |
|
257 | + if(!is_array($options)) { |
|
258 | + $options = array($options); |
|
259 | + } |
|
234 | 260 | $options_count = count($options); |
235 | 261 | for($j=0;$j<$options_count;$j++) |
236 | 262 | { |
@@ -253,7 +279,9 @@ discard block |
||
253 | 279 | $buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>'; |
254 | 280 | FileHandler::writeFile($cache_file, $buff); |
255 | 281 | |
256 | - if(file_exists($cache_file)) @include($cache_file); |
|
282 | + if(file_exists($cache_file)) { |
|
283 | + @include($cache_file); |
|
284 | + } |
|
257 | 285 | return $widget_info; |
258 | 286 | } |
259 | 287 | |
@@ -264,9 +292,13 @@ discard block |
||
264 | 292 | function getWidgetStyleInfo($widgetStyle) |
265 | 293 | { |
266 | 294 | $widgetStyle_path = $this->getWidgetStylePath($widgetStyle); |
267 | - if(!$widgetStyle_path) return; |
|
295 | + if(!$widgetStyle_path) { |
|
296 | + return; |
|
297 | + } |
|
268 | 298 | $xml_file = sprintf("%sskin.xml", $widgetStyle_path); |
269 | - if(!file_exists($xml_file)) return; |
|
299 | + if(!file_exists($xml_file)) { |
|
300 | + return; |
|
301 | + } |
|
270 | 302 | // If the problem by comparing the cache file and include the return variable $widgetStyle_info |
271 | 303 | $cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType()); |
272 | 304 | |
@@ -279,7 +311,9 @@ discard block |
||
279 | 311 | $oXmlParser = new XmlParser(); |
280 | 312 | $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); |
281 | 313 | $xml_obj = $tmp_xml_obj->widgetstyle; |
282 | - if(!$xml_obj) return; |
|
314 | + if(!$xml_obj) { |
|
315 | + return; |
|
316 | + } |
|
283 | 317 | |
284 | 318 | $buff = array(); |
285 | 319 | $buff[] = '<?php if(!defined("__XE__")) exit();'; |
@@ -299,13 +333,20 @@ discard block |
||
299 | 333 | $buff[] = sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link); |
300 | 334 | |
301 | 335 | // preview |
302 | - if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg'; |
|
336 | + if(!$xml_obj->preview->body) { |
|
337 | + $xml_obj->preview->body = 'preview.jpg'; |
|
338 | + } |
|
303 | 339 | $preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body); |
304 | - if(file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file); |
|
340 | + if(file_exists($preview_file)) { |
|
341 | + $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file); |
|
342 | + } |
|
305 | 343 | |
306 | 344 | // Author information |
307 | - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
308 | - else $author_list = $xml_obj->author; |
|
345 | + if(!is_array($xml_obj->author)) { |
|
346 | + $author_list[] = $xml_obj->author; |
|
347 | + } else { |
|
348 | + $author_list = $xml_obj->author; |
|
349 | + } |
|
309 | 350 | |
310 | 351 | foreach($author_list as $idx => $author) |
311 | 352 | { |
@@ -317,8 +358,12 @@ discard block |
||
317 | 358 | |
318 | 359 | // Extra vars (user defined variables to use in a template) |
319 | 360 | $extra_var_groups = $xml_obj->extra_vars->group; |
320 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
321 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
361 | + if(!$extra_var_groups) { |
|
362 | + $extra_var_groups = $xml_obj->extra_vars; |
|
363 | + } |
|
364 | + if(!is_array($extra_var_groups)) { |
|
365 | + $extra_var_groups = array($extra_var_groups); |
|
366 | + } |
|
322 | 367 | |
323 | 368 | $extra_var_count = 0; |
324 | 369 | $buff[] = sprintf('$widgetStyle_info->extra_var = new stdClass();', $extra_var_count); |
@@ -362,7 +407,9 @@ discard block |
||
362 | 407 | |
363 | 408 | FileHandler::writeFile($cache_file, implode(PHP_EOL, $buff)); |
364 | 409 | |
365 | - if(file_exists($cache_file)) @include($cache_file); |
|
410 | + if(file_exists($cache_file)) { |
|
411 | + @include($cache_file); |
|
412 | + } |
|
366 | 413 | |
367 | 414 | return $widgetStyle_info; |
368 | 415 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | function getWidgetPath($widget_name) |
22 | 22 | { |
23 | 23 | $path = sprintf('./widgets/%s/', $widget_name); |
24 | - if(is_dir($path)) return $path; |
|
24 | + if (is_dir($path)) return $path; |
|
25 | 25 | |
26 | 26 | return ""; |
27 | 27 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | function getWidgetStylePath($widgetStyle_name) |
33 | 33 | { |
34 | 34 | $path = sprintf('./widgetstyles/%s/', $widgetStyle_name); |
35 | - if(is_dir($path)) return $path; |
|
35 | + if (is_dir($path)) return $path; |
|
36 | 36 | |
37 | 37 | return ""; |
38 | 38 | } |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | // 've Downloaded the widget and the widget's list of installed Wanted |
59 | 59 | $searched_list = FileHandler::readDir('./widgets'); |
60 | 60 | $searched_count = count($searched_list); |
61 | - if(!$searched_count) return; |
|
61 | + if (!$searched_count) return; |
|
62 | 62 | sort($searched_list); |
63 | 63 | // D which pertain to the list of widgets loop spins return statement review the information you need |
64 | - for($i=0;$i<$searched_count;$i++) |
|
64 | + for ($i = 0; $i < $searched_count; $i++) |
|
65 | 65 | { |
66 | 66 | // The name of the widget |
67 | 67 | $widget = $searched_list[$i]; |
68 | 68 | // Wanted information on the Widget |
69 | 69 | $widget_info = $this->getWidgetInfo($widget); |
70 | 70 | |
71 | - if(!$widget_info) |
|
71 | + if (!$widget_info) |
|
72 | 72 | { |
73 | 73 | $widget_info = new stdClass(); |
74 | 74 | } |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | // 've Downloaded the widget and the widget's list of installed Wanted |
102 | 102 | $searched_list = FileHandler::readDir('./widgetstyles'); |
103 | 103 | $searched_count = count($searched_list); |
104 | - if(!$searched_count) return; |
|
104 | + if (!$searched_count) return; |
|
105 | 105 | sort($searched_list); |
106 | 106 | // D which pertain to the list of widgets loop spins return statement review the information you need |
107 | - for($i=0;$i<$searched_count;$i++) |
|
107 | + for ($i = 0; $i < $searched_count; $i++) |
|
108 | 108 | { |
109 | 109 | // The name of the widget |
110 | 110 | $widgetStyle = $searched_list[$i]; |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | { |
125 | 125 | // Get a path of the requested module. Return if not exists. |
126 | 126 | $widget_path = $this->getWidgetPath($widget); |
127 | - if(!$widget_path) return; |
|
127 | + if (!$widget_path) return; |
|
128 | 128 | // Read the xml file for module skin information |
129 | 129 | $xml_file = sprintf("%sconf/info.xml", $widget_path); |
130 | - if(!file_exists($xml_file)) return; |
|
130 | + if (!file_exists($xml_file)) return; |
|
131 | 131 | // If the problem by comparing the cache file and include the return variable $widget_info |
132 | - $cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType()); |
|
132 | + $cache_file = sprintf(_XE_PATH_.'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType()); |
|
133 | 133 | |
134 | - if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) |
|
134 | + if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file)) |
|
135 | 135 | { |
136 | 136 | @include($cache_file); |
137 | 137 | return $widget_info; |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | $oXmlParser = new XmlParser(); |
141 | 141 | $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); |
142 | 142 | $xml_obj = $tmp_xml_obj->widget; |
143 | - if(!$xml_obj) return; |
|
143 | + if (!$xml_obj) return; |
|
144 | 144 | |
145 | 145 | $buff = '$widget_info = new stdClass;'; |
146 | 146 | |
147 | - if($xml_obj->version && $xml_obj->attrs->version == '0.2') |
|
147 | + if ($xml_obj->version && $xml_obj->attrs->version == '0.2') |
|
148 | 148 | { |
149 | 149 | // Title of the widget, version |
150 | 150 | $buff .= sprintf('$widget_info->widget = "%s";', $widget); |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | $buff .= sprintf('$widget_info->widget_srl = $widget_srl;'); |
162 | 162 | $buff .= sprintf('$widget_info->widget_title = $widget_title;'); |
163 | 163 | // Author information |
164 | - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
164 | + if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
165 | 165 | else $author_list = $xml_obj->author; |
166 | 166 | |
167 | - for($i=0; $i < count($author_list); $i++) |
|
167 | + for ($i = 0; $i < count($author_list); $i++) |
|
168 | 168 | { |
169 | 169 | $buff .= '$widget_info->author['.$i.'] = new stdClass;'; |
170 | 170 | $buff .= sprintf('$widget_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); |
@@ -193,29 +193,29 @@ discard block |
||
193 | 193 | } |
194 | 194 | // Extra vars (user defined variables to use in a template) |
195 | 195 | $extra_var_groups = $xml_obj->extra_vars->group; |
196 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
197 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
198 | - foreach($extra_var_groups as $group) |
|
196 | + if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
197 | + if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
198 | + foreach ($extra_var_groups as $group) |
|
199 | 199 | { |
200 | 200 | $extra_vars = $group->var; |
201 | - if(!is_array($group->var)) $extra_vars = array($group->var); |
|
201 | + if (!is_array($group->var)) $extra_vars = array($group->var); |
|
202 | 202 | |
203 | - if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) |
|
203 | + if ($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) |
|
204 | 204 | { |
205 | 205 | $extra_var_count = count($extra_vars); |
206 | 206 | |
207 | 207 | $buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count); |
208 | - for($i=0;$i<$extra_var_count;$i++) |
|
208 | + for ($i = 0; $i < $extra_var_count; $i++) |
|
209 | 209 | { |
210 | 210 | unset($var); |
211 | 211 | unset($options); |
212 | 212 | $var = $extra_vars[$i]; |
213 | 213 | |
214 | - $id = $var->attrs->id?$var->attrs->id:$var->attrs->name; |
|
215 | - $name = $var->name->body?$var->name->body:$var->title->body; |
|
216 | - $type = $var->attrs->type?$var->attrs->type:$var->type->body; |
|
214 | + $id = $var->attrs->id ? $var->attrs->id : $var->attrs->name; |
|
215 | + $name = $var->name->body ? $var->name->body : $var->title->body; |
|
216 | + $type = $var->attrs->type ? $var->attrs->type : $var->type->body; |
|
217 | 217 | $buff .= sprintf('$widget_info->extra_var->%s = new stdClass;', $id); |
218 | - if($type =='filebox') |
|
218 | + if ($type == 'filebox') |
|
219 | 219 | { |
220 | 220 | $buff .= sprintf('$widget_info->extra_var->%s->filter = "%s";', $id, $var->type->attrs->filter); |
221 | 221 | $buff .= sprintf('$widget_info->extra_var->%s->allow_multiple = "%s";', $id, $var->type->attrs->allow_multiple); |
@@ -225,23 +225,23 @@ discard block |
||
225 | 225 | $buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name); |
226 | 226 | $buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type); |
227 | 227 | $buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id); |
228 | - $buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body)); |
|
228 | + $buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"', '\"', $var->description->body)); |
|
229 | 229 | |
230 | 230 | $options = $var->options; |
231 | - if(!$options) continue; |
|
231 | + if (!$options) continue; |
|
232 | 232 | |
233 | - if(!is_array($options)) $options = array($options); |
|
233 | + if (!is_array($options)) $options = array($options); |
|
234 | 234 | $options_count = count($options); |
235 | - for($j=0;$j<$options_count;$j++) |
|
235 | + for ($j = 0; $j < $options_count; $j++) |
|
236 | 236 | { |
237 | 237 | $buff .= sprintf('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body); |
238 | 238 | |
239 | - if($options[$j]->attrs->default && $options[$j]->attrs->default=='true') |
|
239 | + if ($options[$j]->attrs->default && $options[$j]->attrs->default == 'true') |
|
240 | 240 | { |
241 | 241 | $buff .= sprintf('$widget_info->extra_var->%s->default_options["%s"] = true;', $id, $options[$j]->value->body); |
242 | 242 | } |
243 | 243 | |
244 | - if($options[$j]->attrs->init && $options[$j]->attrs->init=='true') |
|
244 | + if ($options[$j]->attrs->init && $options[$j]->attrs->init == 'true') |
|
245 | 245 | { |
246 | 246 | $buff .= sprintf('$widget_info->extra_var->%s->init_options["%s"] = true;', $id, $options[$j]->value->body); |
247 | 247 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>'; |
254 | 254 | FileHandler::writeFile($cache_file, $buff); |
255 | 255 | |
256 | - if(file_exists($cache_file)) @include($cache_file); |
|
256 | + if (file_exists($cache_file)) @include($cache_file); |
|
257 | 257 | return $widget_info; |
258 | 258 | } |
259 | 259 | |
@@ -264,13 +264,13 @@ discard block |
||
264 | 264 | function getWidgetStyleInfo($widgetStyle) |
265 | 265 | { |
266 | 266 | $widgetStyle_path = $this->getWidgetStylePath($widgetStyle); |
267 | - if(!$widgetStyle_path) return; |
|
267 | + if (!$widgetStyle_path) return; |
|
268 | 268 | $xml_file = sprintf("%sskin.xml", $widgetStyle_path); |
269 | - if(!file_exists($xml_file)) return; |
|
269 | + if (!file_exists($xml_file)) return; |
|
270 | 270 | // If the problem by comparing the cache file and include the return variable $widgetStyle_info |
271 | - $cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType()); |
|
271 | + $cache_file = sprintf(_XE_PATH_.'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType()); |
|
272 | 272 | |
273 | - if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) |
|
273 | + if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file)) |
|
274 | 274 | { |
275 | 275 | @include($cache_file); |
276 | 276 | return $widgetStyle_info; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $oXmlParser = new XmlParser(); |
280 | 280 | $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); |
281 | 281 | $xml_obj = $tmp_xml_obj->widgetstyle; |
282 | - if(!$xml_obj) return; |
|
282 | + if (!$xml_obj) return; |
|
283 | 283 | |
284 | 284 | $buff = array(); |
285 | 285 | $buff[] = '<?php if(!defined("__XE__")) exit();'; |
@@ -299,15 +299,15 @@ discard block |
||
299 | 299 | $buff[] = sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link); |
300 | 300 | |
301 | 301 | // preview |
302 | - if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg'; |
|
303 | - $preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body); |
|
304 | - if(file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file); |
|
302 | + if (!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg'; |
|
303 | + $preview_file = sprintf("%s%s", $widgetStyle_path, $xml_obj->preview->body); |
|
304 | + if (file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file); |
|
305 | 305 | |
306 | 306 | // Author information |
307 | - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
307 | + if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
308 | 308 | else $author_list = $xml_obj->author; |
309 | 309 | |
310 | - foreach($author_list as $idx => $author) |
|
310 | + foreach ($author_list as $idx => $author) |
|
311 | 311 | { |
312 | 312 | $buff[] = sprintf('$widgetStyle_info->author[%d] = new stdClass();', $idx); |
313 | 313 | $buff[] = sprintf('$widgetStyle_info->author[%d]->name = "%s";', $idx, $author->name->body); |
@@ -317,18 +317,18 @@ discard block |
||
317 | 317 | |
318 | 318 | // Extra vars (user defined variables to use in a template) |
319 | 319 | $extra_var_groups = $xml_obj->extra_vars->group; |
320 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
321 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
320 | + if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
321 | + if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
322 | 322 | |
323 | 323 | $extra_var_count = 0; |
324 | 324 | $buff[] = sprintf('$widgetStyle_info->extra_var = new stdClass();', $extra_var_count); |
325 | - foreach($extra_var_groups as $group) |
|
325 | + foreach ($extra_var_groups as $group) |
|
326 | 326 | { |
327 | 327 | $extra_vars = (!is_array($group->var)) ? array($group->var) : $group->var; |
328 | 328 | |
329 | - if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) |
|
329 | + if ($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) |
|
330 | 330 | { |
331 | - foreach($extra_vars as $var) |
|
331 | + foreach ($extra_vars as $var) |
|
332 | 332 | { |
333 | 333 | $extra_var_count++; |
334 | 334 | $id = ($var->attrs->id) ? $var->attrs->id : $var->attrs->name; |
@@ -339,18 +339,18 @@ discard block |
||
339 | 339 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->group = "%s";', $id, $group->title->body); |
340 | 340 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->name = "%s";', $id, $name); |
341 | 341 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->type = "%s";', $id, $type); |
342 | - if($type =='filebox') |
|
342 | + if ($type == 'filebox') |
|
343 | 343 | { |
344 | 344 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->filter = "%s";', $id, $var->attrs->filter); |
345 | 345 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->allow_multiple = "%s";', $id, $var->attrs->allow_multiple); |
346 | 346 | } |
347 | 347 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->value = $vars->%s;', $id, $id); |
348 | - $buff[] = sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body)); |
|
348 | + $buff[] = sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"', '\"', $var->description->body)); |
|
349 | 349 | |
350 | - if($var->options) |
|
350 | + if ($var->options) |
|
351 | 351 | { |
352 | 352 | $var_options = (!is_array($var->options)) ? array($var->options) : $var->options; |
353 | - foreach($var_options as $option_item) |
|
353 | + foreach ($var_options as $option_item) |
|
354 | 354 | { |
355 | 355 | $buff[] = sprintf('$widgetStyle_info->extra_var->%s->options["%s"] = "%s";', $id, $option_item->value->body, $option_item->name->body); |
356 | 356 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | |
363 | 363 | FileHandler::writeFile($cache_file, implode(PHP_EOL, $buff)); |
364 | 364 | |
365 | - if(file_exists($cache_file)) @include($cache_file); |
|
365 | + if (file_exists($cache_file)) @include($cache_file); |
|
366 | 366 | |
367 | 367 | return $widgetStyle_info; |
368 | 368 | } |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | function dispWidgetInfo() |
22 | 22 | { |
23 | 23 | // If people have skin widget widget output as a function of the skin More Details |
24 | - if(Context::get('skin')) return $this->dispWidgetSkinInfo(); |
|
24 | + if(Context::get('skin')) { |
|
25 | + return $this->dispWidgetSkinInfo(); |
|
26 | + } |
|
25 | 27 | // Wanted widget is selected information |
26 | 28 | $oWidgetModel = getModel('widget'); |
27 | 29 | $widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget')); |
@@ -62,7 +64,9 @@ discard block |
||
62 | 64 | |
63 | 65 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
64 | 66 | $selected_widget = Context::get('selected_widget'); |
65 | - if(!$selected_widget) $selected_widget = $widget_list[0]->widget; |
|
67 | + if(!$selected_widget) { |
|
68 | + $selected_widget = $widget_list[0]->widget; |
|
69 | + } |
|
66 | 70 | |
67 | 71 | $widget_info = $oWidgetModel->getWidgetInfo($selected_widget); |
68 | 72 | Context::set('widget_info', $widget_info); |
@@ -89,8 +93,7 @@ discard block |
||
89 | 93 | foreach($mid_list as $module_srl => $module) { |
90 | 94 | $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
91 | 95 | } |
92 | - } |
|
93 | - else |
|
96 | + } else |
|
94 | 97 | { |
95 | 98 | $module_categories[0] = new stdClass(); |
96 | 99 | $module_categories[0]->list = $mid_list; |
@@ -118,7 +121,9 @@ discard block |
||
118 | 121 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
119 | 122 | Context::set('widget_list',$widget_list); |
120 | 123 | // When there is no widget is selected in the first widget |
121 | - if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget); |
|
124 | + if(!Context::get('selected_widget')) { |
|
125 | + Context::set('selected_widget',$widget_list[0]->widget); |
|
126 | + } |
|
122 | 127 | |
123 | 128 | $this->dispWidgetGenerateCode(); |
124 | 129 | $this->setLayoutFile('default_layout'); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | function dispWidgetInfo() |
22 | 22 | { |
23 | 23 | // If people have skin widget widget output as a function of the skin More Details |
24 | - if(Context::get('skin')) return $this->dispWidgetSkinInfo(); |
|
24 | + if (Context::get('skin')) return $this->dispWidgetSkinInfo(); |
|
25 | 25 | // Wanted widget is selected information |
26 | 26 | $oWidgetModel = getModel('widget'); |
27 | 27 | $widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget')); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $oModuleModel = getModel('module'); |
46 | 46 | $skin_info = $oModuleModel->loadSkinInfo($path, $skin); |
47 | 47 | |
48 | - Context::set('skin_info',$skin_info); |
|
48 | + Context::set('skin_info', $skin_info); |
|
49 | 49 | // Specifies the widget to pop up |
50 | 50 | $this->setLayoutFile('popup_layout'); |
51 | 51 | // Set a template file |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
64 | 64 | $selected_widget = Context::get('selected_widget'); |
65 | - if(!$selected_widget) $selected_widget = $widget_list[0]->widget; |
|
65 | + if (!$selected_widget) $selected_widget = $widget_list[0]->widget; |
|
66 | 66 | |
67 | 67 | $widget_info = $oWidgetModel->getWidgetInfo($selected_widget); |
68 | 68 | Context::set('widget_info', $widget_info); |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $group_list = $oMemberModel->getGroups($site_module_info->site_srl); |
85 | 85 | Context::set('group_list', $group_list); |
86 | 86 | // module_category and module combination |
87 | - if($module_categories) |
|
87 | + if ($module_categories) |
|
88 | 88 | { |
89 | - foreach($mid_list as $module_srl => $module) { |
|
89 | + foreach ($mid_list as $module_srl => $module) { |
|
90 | 90 | $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
91 | 91 | } |
92 | 92 | } |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | $module_categories[0]->list = $mid_list; |
97 | 97 | } |
98 | 98 | |
99 | - Context::set('mid_list',$module_categories); |
|
99 | + Context::set('mid_list', $module_categories); |
|
100 | 100 | // Menu Get a list |
101 | 101 | $output = executeQueryArray('menu.getMenus'); |
102 | - Context::set('menu_list',$output->data); |
|
102 | + Context::set('menu_list', $output->data); |
|
103 | 103 | // Wanted information on skin |
104 | 104 | $skin_list = $oModuleModel->getSkins($widget_info->path); |
105 | 105 | Context::set('skin_list', $skin_list); |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | { |
117 | 117 | $oWidgetModel = getModel('widget'); |
118 | 118 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
119 | - Context::set('widget_list',$widget_list); |
|
119 | + Context::set('widget_list', $widget_list); |
|
120 | 120 | // When there is no widget is selected in the first widget |
121 | - if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget); |
|
121 | + if (!Context::get('selected_widget')) Context::set('selected_widget', $widget_list[0]->widget); |
|
122 | 122 | |
123 | 123 | $this->dispWidgetGenerateCode(); |
124 | 124 | $this->setLayoutFile('default_layout'); |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | // Widget-style list |
134 | 134 | $oWidgetModel = getModel('widget'); |
135 | 135 | $widgetStyle_list = $oWidgetModel->getDownloadedWidgetStyleList(); |
136 | - Context::set('widgetStyle_list',$widgetStyle_list); |
|
136 | + Context::set('widgetStyle_list', $widgetStyle_list); |
|
137 | 137 | // Selected list of widget styles |
138 | 138 | $widgetstyle = Context::get('widgetstyle'); |
139 | 139 | $widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetstyle); |
140 | - if($widgetstyle && $widgetstyle_info) |
|
140 | + if ($widgetstyle && $widgetstyle_info) |
|
141 | 141 | { |
142 | - Context::set('widgetstyle_info',$widgetstyle_info); |
|
142 | + Context::set('widgetstyle_info', $widgetstyle_info); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | $this->dispWidgetGenerateCode(); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | /** |
13 | 13 | @brief |
14 | 14 | @developer |
15 | - */ |
|
15 | + */ |
|
16 | 16 | class DBMysqlConnectWrapper extends DBMysql |
17 | 17 | { |
18 | 18 | public $queries = ''; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | @developer |
23 | 23 | @return |
24 | 24 | @access |
25 | - */ |
|
25 | + */ |
|
26 | 26 | public function __construct() |
27 | 27 | { |
28 | 28 | $this->db_type = 'mysql'; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | @developer |
35 | 35 | @return |
36 | 36 | @access |
37 | - */ |
|
37 | + */ |
|
38 | 38 | public function create() |
39 | 39 | { |
40 | 40 | return new DBMysqlConnectWrapper(); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | @developer |
46 | 46 | @return |
47 | 47 | @access |
48 | - */ |
|
48 | + */ |
|
49 | 49 | public function actDBClassStart() |
50 | 50 | { |
51 | 51 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | @return |
57 | 57 | @access |
58 | 58 | @param $query |
59 | - */ |
|
59 | + */ |
|
60 | 60 | public function actStart($query) |
61 | 61 | { |
62 | 62 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | @developer |
67 | 67 | @return |
68 | 68 | @access |
69 | - */ |
|
69 | + */ |
|
70 | 70 | public function actFinish() |
71 | 71 | { |
72 | 72 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | @developer |
77 | 77 | @return |
78 | 78 | @access |
79 | - */ |
|
79 | + */ |
|
80 | 80 | public function actDBClassFinish() |
81 | 81 | { |
82 | 82 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | @developer |
87 | 87 | @return |
88 | 88 | @access |
89 | - */ |
|
89 | + */ |
|
90 | 90 | public function isSupported() |
91 | 91 | { |
92 | 92 | // No need to actually check for 'mysql_connect' function |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | @return |
100 | 100 | @access |
101 | 101 | @param $connection |
102 | - */ |
|
102 | + */ |
|
103 | 103 | public function __connect($connection) |
104 | 104 | { |
105 | 105 | return TRUE; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | @return |
112 | 112 | @access |
113 | 113 | @param $connection |
114 | - */ |
|
114 | + */ |
|
115 | 115 | public function _afterConnect($connection) |
116 | 116 | { |
117 | 117 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | @return |
123 | 123 | @access |
124 | 124 | @param $connection |
125 | - */ |
|
125 | + */ |
|
126 | 126 | public function _close($connection) |
127 | 127 | { |
128 | 128 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | @access |
135 | 135 | @param $type |
136 | 136 | @param $indx |
137 | - */ |
|
137 | + */ |
|
138 | 138 | public function close($type = 'master', $indx = NULL) |
139 | 139 | { |
140 | 140 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | @developer |
145 | 145 | @return |
146 | 146 | @access |
147 | - */ |
|
147 | + */ |
|
148 | 148 | public function _begin() |
149 | 149 | { |
150 | 150 | return TRUE; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | @developer |
156 | 156 | @return |
157 | 157 | @access |
158 | - */ |
|
158 | + */ |
|
159 | 159 | public function _rollback() |
160 | 160 | { |
161 | 161 | return TRUE; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | @developer |
167 | 167 | @return |
168 | 168 | @access |
169 | - */ |
|
169 | + */ |
|
170 | 170 | public function _commit() |
171 | 171 | { |
172 | 172 | return TRUE; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | @access |
180 | 180 | @param $query |
181 | 181 | @param $connection |
182 | - */ |
|
182 | + */ |
|
183 | 183 | public function __query($query, $connection) |
184 | 184 | { |
185 | 185 | $this->queries .= "\n" . $query; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | @access |
195 | 195 | @param $result |
196 | 196 | @param $arrayIndexEndValue |
197 | - */ |
|
197 | + */ |
|
198 | 198 | public function _fetch($result, $arrayIndexEndValue = NULL) |
199 | 199 | { |
200 | 200 | return new Any_prop_obj_base(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | @return |
207 | 207 | @access |
208 | 208 | @param $target_name |
209 | - */ |
|
209 | + */ |
|
210 | 210 | public function isTableExists($target_name) |
211 | 211 | { |
212 | 212 | parent::isTableExists($target_name); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | @developer |
220 | 220 | @return |
221 | 221 | @access |
222 | - */ |
|
222 | + */ |
|
223 | 223 | public function db_insert_id() |
224 | 224 | { |
225 | 225 | return NULL; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | @return |
232 | 232 | @access |
233 | 233 | @param $result |
234 | - */ |
|
234 | + */ |
|
235 | 235 | public function db_fetch_object(&$result) |
236 | 236 | { |
237 | 237 | return new Any_prop_obj_base(); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | /** |
242 | 242 | @brief |
243 | 243 | @developer |
244 | - */ |
|
244 | + */ |
|
245 | 245 | class DBMysqliConnectWrapper extends DBMysqli |
246 | 246 | { |
247 | 247 | public $queries = ''; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | @developer |
252 | 252 | @return |
253 | 253 | @access |
254 | - */ |
|
254 | + */ |
|
255 | 255 | public function __construct() |
256 | 256 | { |
257 | 257 | $this->db_type = 'mysqli'; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | @developer |
264 | 264 | @return |
265 | 265 | @access |
266 | - */ |
|
266 | + */ |
|
267 | 267 | public function create() |
268 | 268 | { |
269 | 269 | return new DBMysqlConnectWrapper(); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | @developer |
275 | 275 | @return |
276 | 276 | @access |
277 | - */ |
|
277 | + */ |
|
278 | 278 | public function actDBClassStart() |
279 | 279 | { |
280 | 280 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | @return |
286 | 286 | @access |
287 | 287 | @param $query |
288 | - */ |
|
288 | + */ |
|
289 | 289 | public function actStart($query) |
290 | 290 | { |
291 | 291 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | @developer |
296 | 296 | @return |
297 | 297 | @access |
298 | - */ |
|
298 | + */ |
|
299 | 299 | public function actFinish() |
300 | 300 | { |
301 | 301 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | @developer |
306 | 306 | @return |
307 | 307 | @access |
308 | - */ |
|
308 | + */ |
|
309 | 309 | public function actDBClassFinish() |
310 | 310 | { |
311 | 311 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | @developer |
316 | 316 | @return |
317 | 317 | @access |
318 | - */ |
|
318 | + */ |
|
319 | 319 | public function isSupported() |
320 | 320 | { |
321 | 321 | // No need to actually check for 'mysql_connect' function |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | @return |
329 | 329 | @access |
330 | 330 | @param $target_name |
331 | - */ |
|
331 | + */ |
|
332 | 332 | public function isTableExists($target_name) |
333 | 333 | { |
334 | 334 | parent::isTableExists($target_name); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | @return |
345 | 345 | @access |
346 | 346 | @param $string |
347 | - */ |
|
347 | + */ |
|
348 | 348 | public function addQuotes($string) |
349 | 349 | { |
350 | 350 | if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | @return |
367 | 367 | @access |
368 | 368 | @param $connection |
369 | - */ |
|
369 | + */ |
|
370 | 370 | public function __connect($connection) |
371 | 371 | { |
372 | 372 | return TRUE; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | @return |
379 | 379 | @access |
380 | 380 | @param $connection |
381 | - */ |
|
381 | + */ |
|
382 | 382 | public function _afterConnect($connection) |
383 | 383 | { |
384 | 384 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | @return |
390 | 390 | @access |
391 | 391 | @param $connection |
392 | - */ |
|
392 | + */ |
|
393 | 393 | public function _close($connection) |
394 | 394 | { |
395 | 395 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | @access |
402 | 402 | @param $type |
403 | 403 | @param $indx |
404 | - */ |
|
404 | + */ |
|
405 | 405 | public function close($type = 'master', $indx = NULL) |
406 | 406 | { |
407 | 407 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | @developer |
412 | 412 | @return |
413 | 413 | @access |
414 | - */ |
|
414 | + */ |
|
415 | 415 | public function _begin() |
416 | 416 | { |
417 | 417 | return TRUE; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | @developer |
423 | 423 | @return |
424 | 424 | @access |
425 | - */ |
|
425 | + */ |
|
426 | 426 | public function _rollback() |
427 | 427 | { |
428 | 428 | return TRUE; |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | @developer |
434 | 434 | @return |
435 | 435 | @access |
436 | - */ |
|
436 | + */ |
|
437 | 437 | public function _commit() |
438 | 438 | { |
439 | 439 | return TRUE; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | @access |
447 | 447 | @param $query |
448 | 448 | @param $connection |
449 | - */ |
|
449 | + */ |
|
450 | 450 | public function __query($query, $connection) |
451 | 451 | { |
452 | 452 | $this->queries .= "\n" . $query; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | @access |
462 | 462 | @param $result |
463 | 463 | @param $arrayIndexEndValue |
464 | - */ |
|
464 | + */ |
|
465 | 465 | public function _fetch($result, $arrayIndexEndValue = NULL) |
466 | 466 | { |
467 | 467 | return new Any_prop_obj_base(); |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | @developer |
473 | 473 | @return |
474 | 474 | @access |
475 | - */ |
|
475 | + */ |
|
476 | 476 | public function db_insert_id() |
477 | 477 | { |
478 | 478 | return NULL; |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | @return |
485 | 485 | @access |
486 | 486 | @param $result |
487 | - */ |
|
487 | + */ |
|
488 | 488 | public function db_fetch_object(&$result) |
489 | 489 | { |
490 | 490 | return new Any_prop_obj_base(); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | /** |
495 | 495 | @brief |
496 | 496 | @developer |
497 | - */ |
|
497 | + */ |
|
498 | 498 | class DBCubridConnectWrapper extends DBCubrid |
499 | 499 | { |
500 | 500 | public $queries = ''; |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | @developer |
505 | 505 | @return |
506 | 506 | @access |
507 | - */ |
|
507 | + */ |
|
508 | 508 | public function __construct() |
509 | 509 | { |
510 | 510 | $this->db_type = 'cubrid'; |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | @developer |
517 | 517 | @return |
518 | 518 | @access |
519 | - */ |
|
519 | + */ |
|
520 | 520 | public function create() |
521 | 521 | { |
522 | 522 | return new DBMysqlConnectWrapper(); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | @developer |
528 | 528 | @return |
529 | 529 | @access |
530 | - */ |
|
530 | + */ |
|
531 | 531 | public function actDBClassStart() |
532 | 532 | { |
533 | 533 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | @return |
539 | 539 | @access |
540 | 540 | @param $query |
541 | - */ |
|
541 | + */ |
|
542 | 542 | public function actStart($query) |
543 | 543 | { |
544 | 544 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | @developer |
549 | 549 | @return |
550 | 550 | @access |
551 | - */ |
|
551 | + */ |
|
552 | 552 | public function _makeSequence() |
553 | 553 | { |
554 | 554 | return TRUE; |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | @developer |
560 | 560 | @return |
561 | 561 | @access |
562 | - */ |
|
562 | + */ |
|
563 | 563 | public function actFinish() |
564 | 564 | { |
565 | 565 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | @developer |
570 | 570 | @return |
571 | 571 | @access |
572 | - */ |
|
572 | + */ |
|
573 | 573 | public function actDBClassFinish() |
574 | 574 | { |
575 | 575 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | @developer |
580 | 580 | @return |
581 | 581 | @access |
582 | - */ |
|
582 | + */ |
|
583 | 583 | public function isSupported() |
584 | 584 | { |
585 | 585 | // No need to actually check for 'cubrid_connect' function |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | @return |
593 | 593 | @access |
594 | 594 | @param $target_name |
595 | - */ |
|
595 | + */ |
|
596 | 596 | public function isTableExists($target_name) |
597 | 597 | { |
598 | 598 | try |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | @return |
613 | 613 | @access |
614 | 614 | @param $connection |
615 | - */ |
|
615 | + */ |
|
616 | 616 | public function __connect($connection) |
617 | 617 | { |
618 | 618 | return TRUE; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | @return |
625 | 625 | @access |
626 | 626 | @param $connection |
627 | - */ |
|
627 | + */ |
|
628 | 628 | public function _afterConnect($connection) |
629 | 629 | { |
630 | 630 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | @return |
636 | 636 | @access |
637 | 637 | @param $connection |
638 | - */ |
|
638 | + */ |
|
639 | 639 | public function _close($connection) |
640 | 640 | { |
641 | 641 | } |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | @access |
648 | 648 | @param $type |
649 | 649 | @param $indx |
650 | - */ |
|
650 | + */ |
|
651 | 651 | public function close($type = 'master', $indx = NULL) |
652 | 652 | { |
653 | 653 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | @developer |
658 | 658 | @return |
659 | 659 | @access |
660 | - */ |
|
660 | + */ |
|
661 | 661 | public function _begin() |
662 | 662 | { |
663 | 663 | return TRUE; |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | @developer |
669 | 669 | @return |
670 | 670 | @access |
671 | - */ |
|
671 | + */ |
|
672 | 672 | public function _rollback() |
673 | 673 | { |
674 | 674 | return TRUE; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | @developer |
680 | 680 | @return |
681 | 681 | @access |
682 | - */ |
|
682 | + */ |
|
683 | 683 | public function _commit() |
684 | 684 | { |
685 | 685 | return TRUE; |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | @access |
693 | 693 | @param $query |
694 | 694 | @param $connection |
695 | - */ |
|
695 | + */ |
|
696 | 696 | public function __query($query, $connection) |
697 | 697 | { |
698 | 698 | $this->queries .= "\n" . $query; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | @access |
708 | 708 | @param $result |
709 | 709 | @param $arrayIndexEndValue |
710 | - */ |
|
710 | + */ |
|
711 | 711 | public function _fetch($result, $arrayIndexEndValue = NULL) |
712 | 712 | { |
713 | 713 | return new Any_prop_obj_base(); |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | @developer |
719 | 719 | @return |
720 | 720 | @access |
721 | - */ |
|
721 | + */ |
|
722 | 722 | public function db_insert_id() |
723 | 723 | { |
724 | 724 | return NULL; |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | @developer |
730 | 730 | @return |
731 | 731 | @access |
732 | - */ |
|
732 | + */ |
|
733 | 733 | public function &db_fetch_object() |
734 | 734 | { |
735 | 735 | return new Any_prop_obj_base(); |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | /** |
740 | 740 | @brief |
741 | 741 | @developer |
742 | - */ |
|
742 | + */ |
|
743 | 743 | class DBMssqlConnectWrapper extends DBMssql |
744 | 744 | { |
745 | 745 | public $queries = ''; |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | @developer |
750 | 750 | @return |
751 | 751 | @access |
752 | - */ |
|
752 | + */ |
|
753 | 753 | public function __construct() |
754 | 754 | { |
755 | 755 | $this->db_type = 'mssql'; |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | @developer |
762 | 762 | @return |
763 | 763 | @access |
764 | - */ |
|
764 | + */ |
|
765 | 765 | public function create() |
766 | 766 | { |
767 | 767 | return new DBMssqlConnectWrapper(); |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | @developer |
773 | 773 | @return |
774 | 774 | @access |
775 | - */ |
|
775 | + */ |
|
776 | 776 | public function actDBClassStart() |
777 | 777 | { |
778 | 778 | } |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | @return |
784 | 784 | @access |
785 | 785 | @param $query |
786 | - */ |
|
786 | + */ |
|
787 | 787 | public function actStart($query) |
788 | 788 | { |
789 | 789 | } |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | @developer |
794 | 794 | @return |
795 | 795 | @access |
796 | - */ |
|
796 | + */ |
|
797 | 797 | public function actFinish() |
798 | 798 | { |
799 | 799 | } |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | @developer |
804 | 804 | @return |
805 | 805 | @access |
806 | - */ |
|
806 | + */ |
|
807 | 807 | public function actDBClassFinish() |
808 | 808 | { |
809 | 809 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | @developer |
814 | 814 | @return |
815 | 815 | @access |
816 | - */ |
|
816 | + */ |
|
817 | 817 | public function isSupported() |
818 | 818 | { |
819 | 819 | // No need to actually check for 'mssql_connect' function |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | @return |
827 | 827 | @access |
828 | 828 | @param $target_name |
829 | - */ |
|
829 | + */ |
|
830 | 830 | public function isTableExists($target_name) |
831 | 831 | { |
832 | 832 | parent::isTableExists($target_name); |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | @return |
841 | 841 | @access |
842 | 842 | @param $connection |
843 | - */ |
|
843 | + */ |
|
844 | 844 | public function __connect($connection) |
845 | 845 | { |
846 | 846 | return TRUE; |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | @return |
853 | 853 | @access |
854 | 854 | @param $connection |
855 | - */ |
|
855 | + */ |
|
856 | 856 | public function _afterConnect($connection) |
857 | 857 | { |
858 | 858 | } |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | @return |
864 | 864 | @access |
865 | 865 | @param $connection |
866 | - */ |
|
866 | + */ |
|
867 | 867 | public function _close($connection) |
868 | 868 | { |
869 | 869 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | @access |
876 | 876 | @param $type |
877 | 877 | @param $indx |
878 | - */ |
|
878 | + */ |
|
879 | 879 | public function close($type = 'master', $indx = NULL) |
880 | 880 | { |
881 | 881 | } |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | @developer |
886 | 886 | @return |
887 | 887 | @access |
888 | - */ |
|
888 | + */ |
|
889 | 889 | public function _begin() |
890 | 890 | { |
891 | 891 | return TRUE; |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | @developer |
897 | 897 | @return |
898 | 898 | @access |
899 | - */ |
|
899 | + */ |
|
900 | 900 | public function _rollback() |
901 | 901 | { |
902 | 902 | return TRUE; |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | @developer |
908 | 908 | @return |
909 | 909 | @access |
910 | - */ |
|
910 | + */ |
|
911 | 911 | public function _commit() |
912 | 912 | { |
913 | 913 | return TRUE; |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | @access |
921 | 921 | @param $query |
922 | 922 | @param $connection |
923 | - */ |
|
923 | + */ |
|
924 | 924 | public function __query($query, $connection) |
925 | 925 | { |
926 | 926 | if($this->queries) |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | @access |
941 | 941 | @param $result |
942 | 942 | @param $arrayIndexEndValue |
943 | - */ |
|
943 | + */ |
|
944 | 944 | public function _fetch($result, $arrayIndexEndValue = NULL) |
945 | 945 | { |
946 | 946 | return new Any_prop_obj_base(); |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | @developer |
952 | 952 | @return |
953 | 953 | @access |
954 | - */ |
|
954 | + */ |
|
955 | 955 | public function db_insert_id() |
956 | 956 | { |
957 | 957 | return NULL; |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | @developer |
963 | 963 | @return |
964 | 964 | @access |
965 | - */ |
|
965 | + */ |
|
966 | 966 | public function &db_fetch_object() |
967 | 967 | { |
968 | 968 | return new Any_prop_obj_base(); |
@@ -598,8 +598,7 @@ |
||
598 | 598 | try |
599 | 599 | { |
600 | 600 | parent::isTableExists($target_name); |
601 | - } |
|
602 | - catch (Exception $ex) |
|
601 | + } catch (Exception $ex) |
|
603 | 602 | { |
604 | 603 | } |
605 | 604 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function __construct() |
27 | 27 | { |
28 | 28 | $this->db_type = 'mysql'; |
29 | - $this->_setDBInfo(); // Context::get() should indicate a mysql db |
|
29 | + $this->_setDBInfo(); // Context::get() should indicate a mysql db |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function __query($query, $connection) |
184 | 184 | { |
185 | - $this->queries .= "\n" . $query; |
|
185 | + $this->queries .= "\n".$query; |
|
186 | 186 | |
187 | 187 | return TRUE; |
188 | 188 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | public function __construct() |
256 | 256 | { |
257 | 257 | $this->db_type = 'mysqli'; |
258 | - $this->_setDBInfo(); // Context::get() should indicate a mysqli db |
|
258 | + $this->_setDBInfo(); // Context::get() should indicate a mysqli db |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -347,12 +347,12 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function addQuotes($string) |
349 | 349 | { |
350 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
350 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
351 | 351 | { |
352 | 352 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
353 | 353 | } |
354 | 354 | |
355 | - if(!is_numeric($string)) |
|
355 | + if (!is_numeric($string)) |
|
356 | 356 | { |
357 | 357 | $string = @mysql_real_escape_string($string); |
358 | 358 | } |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function __query($query, $connection) |
451 | 451 | { |
452 | - $this->queries .= "\n" . $query; |
|
452 | + $this->queries .= "\n".$query; |
|
453 | 453 | |
454 | 454 | return TRUE; |
455 | 455 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | public function __construct() |
509 | 509 | { |
510 | 510 | $this->db_type = 'cubrid'; |
511 | - $this->_setDBInfo(); // Context::get() should indicate a CUBRID db |
|
511 | + $this->_setDBInfo(); // Context::get() should indicate a CUBRID db |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | /** |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function __query($query, $connection) |
697 | 697 | { |
698 | - $this->queries .= "\n" . $query; |
|
698 | + $this->queries .= "\n".$query; |
|
699 | 699 | |
700 | 700 | return TRUE; |
701 | 701 | } |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | public function __construct() |
754 | 754 | { |
755 | 755 | $this->db_type = 'mssql'; |
756 | - $this->_setDBInfo(); // Context::get() should indicate a MS Sql db |
|
756 | + $this->_setDBInfo(); // Context::get() should indicate a MS Sql db |
|
757 | 757 | } |
758 | 758 | |
759 | 759 | /** |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | */ |
924 | 924 | public function __query($query, $connection) |
925 | 925 | { |
926 | - if($this->queries) |
|
926 | + if ($this->queries) |
|
927 | 927 | { |
928 | 928 | $this->queries .= ";\n"; |
929 | 929 | } |
@@ -19,13 +19,13 @@ |
||
19 | 19 | $oCounterModel = getModel('counter'); |
20 | 20 | |
21 | 21 | $site_module_info = Context::get('site_module_info'); |
22 | - $output = $oCounterModel->getStatus(array('00000000', date('Ymd', $_SERVER['REQUEST_TIME']-60*60*24), date('Ymd')), $site_module_info->site_srl); |
|
23 | - if(count($output)) |
|
22 | + $output = $oCounterModel->getStatus(array('00000000', date('Ymd', $_SERVER['REQUEST_TIME'] - 60 * 60 * 24), date('Ymd')), $site_module_info->site_srl); |
|
23 | + if (count($output)) |
|
24 | 24 | { |
25 | - foreach($output as $key => $val) |
|
25 | + foreach ($output as $key => $val) |
|
26 | 26 | { |
27 | - if(!$key) Context::set('total_counter', $val); |
|
28 | - elseif($key == date("Ymd")) Context::set('today_counter', $val); |
|
27 | + if (!$key) Context::set('total_counter', $val); |
|
28 | + elseif ($key == date("Ymd")) Context::set('today_counter', $val); |
|
29 | 29 | else Context::set('yesterday_counter', $val); |
30 | 30 | } |
31 | 31 | } |
@@ -24,9 +24,13 @@ |
||
24 | 24 | { |
25 | 25 | foreach($output as $key => $val) |
26 | 26 | { |
27 | - if(!$key) Context::set('total_counter', $val); |
|
28 | - elseif($key == date("Ymd")) Context::set('today_counter', $val); |
|
29 | - else Context::set('yesterday_counter', $val); |
|
27 | + if(!$key) { |
|
28 | + Context::set('total_counter', $val); |
|
29 | + } elseif($key == date("Ymd")) { |
|
30 | + Context::set('today_counter', $val); |
|
31 | + } else { |
|
32 | + Context::set('yesterday_counter', $val); |
|
33 | + } |
|
30 | 34 | } |
31 | 35 | } |
32 | 36 | // Set a path of the template skin (values of skin, colorset settings) |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin); |
22 | 22 | Context::set('colorset', $args->colorset); |
23 | 23 | // Specify a template file |
24 | - if(Context::get('is_logged')) $tpl_file = 'login_info'; |
|
24 | + if (Context::get('is_logged')) $tpl_file = 'login_info'; |
|
25 | 25 | else $tpl_file = 'login_form'; |
26 | 26 | // Get the member configuration |
27 | 27 | $oModuleModel = getModel('module'); |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | // Set a flag to check if the https connection is made when using SSL and create https url |
32 | 32 | $ssl_mode = false; |
33 | 33 | $useSsl = Context::getSslStatus(); |
34 | - if($useSsl != 'none') |
|
34 | + if ($useSsl != 'none') |
|
35 | 35 | { |
36 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
36 | + if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
37 | 37 | } |
38 | - Context::set('ssl_mode',$ssl_mode); |
|
38 | + Context::set('ssl_mode', $ssl_mode); |
|
39 | 39 | |
40 | 40 | // Compile a template |
41 | 41 | $oTemplate = &TemplateHandler::getInstance(); |
@@ -21,8 +21,11 @@ discard block |
||
21 | 21 | $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin); |
22 | 22 | Context::set('colorset', $args->colorset); |
23 | 23 | // Specify a template file |
24 | - if(Context::get('is_logged')) $tpl_file = 'login_info'; |
|
25 | - else $tpl_file = 'login_form'; |
|
24 | + if(Context::get('is_logged')) { |
|
25 | + $tpl_file = 'login_info'; |
|
26 | + } else { |
|
27 | + $tpl_file = 'login_form'; |
|
28 | + } |
|
26 | 29 | // Get the member configuration |
27 | 30 | $oModuleModel = getModel('module'); |
28 | 31 | $this->member_config = $oModuleModel->getModuleConfig('member'); |
@@ -33,7 +36,9 @@ discard block |
||
33 | 36 | $useSsl = Context::getSslStatus(); |
34 | 37 | if($useSsl != 'none') |
35 | 38 | { |
36 | - if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true; |
|
39 | + if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) { |
|
40 | + $ssl_mode = true; |
|
41 | + } |
|
37 | 42 | } |
38 | 43 | Context::set('ssl_mode',$ssl_mode); |
39 | 44 |
@@ -18,20 +18,32 @@ discard block |
||
18 | 18 | function proc($args) |
19 | 19 | { |
20 | 20 | // Targets to sort |
21 | - if(!in_array($args->order_target, array('list_order','update_order'))) $args->order_target = 'list_order'; |
|
21 | + if(!in_array($args->order_target, array('list_order','update_order'))) { |
|
22 | + $args->order_target = 'list_order'; |
|
23 | + } |
|
22 | 24 | // Sort order |
23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
25 | + if(!in_array($args->order_type, array('asc','desc'))) { |
|
26 | + $args->order_type = 'asc'; |
|
27 | + } |
|
24 | 28 | // The number of displayed lists |
25 | 29 | $args->list_count = (int)$args->list_count; |
26 | - if(!$args->list_count) $args->list_count = 5; |
|
30 | + if(!$args->list_count) { |
|
31 | + $args->list_count = 5; |
|
32 | + } |
|
27 | 33 | // Cut the length of the title |
28 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
34 | + if(!$args->subject_cut_size) { |
|
35 | + $args->subject_cut_size = 0; |
|
36 | + } |
|
29 | 37 | // Cut the length of contents |
30 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
38 | + if(!$args->content_cut_size) { |
|
39 | + $args->content_cut_size = 100; |
|
40 | + } |
|
31 | 41 | // Viewing options |
32 | 42 | $args->option_view_arr = explode(',',$args->option_view); |
33 | 43 | // markup options |
34 | - if(!$args->markup_type) $args->markup_type = 'list'; |
|
44 | + if(!$args->markup_type) { |
|
45 | + $args->markup_type = 'list'; |
|
46 | + } |
|
35 | 47 | // Set variables for internal use |
36 | 48 | $oModuleModel = getModel('module'); |
37 | 49 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
@@ -43,11 +55,12 @@ discard block |
||
43 | 55 | $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
44 | 56 | for($i=0,$c=count($rss_urls);$i<$c;$i++) |
45 | 57 | { |
46 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
58 | + if($rss_urls[$i]) { |
|
59 | + $args->rss_urls[] = $rss_urls[$i]; |
|
60 | + } |
|
47 | 61 | } |
48 | 62 | // Get module information after listing module_srls if the module is not RSS |
49 | - } |
|
50 | - else |
|
63 | + } else |
|
51 | 64 | { |
52 | 65 | $obj = new stdClass(); |
53 | 66 | // Apply to all modules in the site if a target module is not specified |
@@ -68,8 +81,7 @@ discard block |
||
68 | 81 | |
69 | 82 | $args->modules_info = $oModuleModel->getMidList($obj); |
70 | 83 | // Apply to the module only if a target module is specified |
71 | - } |
|
72 | - else |
|
84 | + } else |
|
73 | 85 | { |
74 | 86 | $obj->module_srls = $args->module_srls; |
75 | 87 | $output = executeQueryArray('widgets.content.getMids', $obj); |
@@ -85,13 +97,17 @@ discard block |
||
85 | 97 | for($i=0,$c=count($idx);$i<$c;$i++) |
86 | 98 | { |
87 | 99 | $srl = $idx[$i]; |
88 | - if(!$args->module_srls_info[$srl]) continue; |
|
100 | + if(!$args->module_srls_info[$srl]) { |
|
101 | + continue; |
|
102 | + } |
|
89 | 103 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
90 | 104 | } |
91 | 105 | } |
92 | 106 | } |
93 | 107 | // Exit if no module is found |
94 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
108 | + if(!count($args->modules_info)) { |
|
109 | + return Context::get('msg_not_founded'); |
|
110 | + } |
|
95 | 111 | $args->module_srl = implode(',',$module_srls); |
96 | 112 | } |
97 | 113 | |
@@ -120,8 +136,7 @@ discard block |
||
120 | 136 | break; |
121 | 137 | } |
122 | 138 | // If not a tab type |
123 | - } |
|
124 | - else |
|
139 | + } else |
|
125 | 140 | { |
126 | 141 | $content_items = array(); |
127 | 142 | |
@@ -180,7 +195,9 @@ discard block |
||
180 | 195 | |
181 | 196 | $content_items = array(); |
182 | 197 | |
183 | - if(!count($output)) return; |
|
198 | + if(!count($output)) { |
|
199 | + return; |
|
200 | + } |
|
184 | 201 | |
185 | 202 | foreach($output as $key => $oComment) |
186 | 203 | { |
@@ -227,7 +244,9 @@ discard block |
||
227 | 244 | $obj->list_count = $args->list_count; |
228 | 245 | $obj->statusList = array('PUBLIC'); |
229 | 246 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
230 | - if(!$output->toBool() || !$output->data) return; |
|
247 | + if(!$output->toBool() || !$output->data) { |
|
248 | + return; |
|
249 | + } |
|
231 | 250 | // If the result exists, make each document as an object |
232 | 251 | $content_items = array(); |
233 | 252 | $first_thumbnail_idx = -1; |
@@ -258,7 +277,9 @@ discard block |
||
258 | 277 | $content_item->setLink( getSiteUrl($domain,'','document_srl',$document_srl) ); |
259 | 278 | $content_item->setThumbnail($thumbnail); |
260 | 279 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
261 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
280 | + if($first_thumbnail_idx==-1 && $thumbnail) { |
|
281 | + $first_thumbnail_idx = $i; |
|
282 | + } |
|
262 | 283 | $content_items[] = $content_item; |
263 | 284 | } |
264 | 285 | |
@@ -288,15 +309,21 @@ discard block |
||
288 | 309 | $obj->list_count = $args->list_count; |
289 | 310 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
290 | 311 | $files_count = count($files_output->data); |
291 | - if(!$files_count) return; |
|
312 | + if(!$files_count) { |
|
313 | + return; |
|
314 | + } |
|
292 | 315 | |
293 | 316 | $content_items = array(); |
294 | 317 | |
295 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
318 | + for($i=0;$i<$files_count;$i++) { |
|
319 | + $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
320 | + } |
|
296 | 321 | |
297 | 322 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
298 | 323 | |
299 | - if(!count($tmp_document_list)) return; |
|
324 | + if(!count($tmp_document_list)) { |
|
325 | + return; |
|
326 | + } |
|
300 | 327 | |
301 | 328 | foreach($tmp_document_list as $oDocument) |
302 | 329 | { |
@@ -348,22 +375,33 @@ discard block |
||
348 | 375 | { |
349 | 376 | $date = $v->get('regdate'); |
350 | 377 | $i=0; |
351 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
378 | + while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) { |
|
379 | + $i++; |
|
380 | + } |
|
352 | 381 | $items[sprintf('%s%02d',$date,$i)] = $v; |
353 | 382 | } |
354 | 383 | } |
355 | - if($args->order_type =='asc') ksort($items); |
|
356 | - else krsort($items); |
|
384 | + if($args->order_type =='asc') { |
|
385 | + ksort($items); |
|
386 | + } else { |
|
387 | + krsort($items); |
|
388 | + } |
|
357 | 389 | $content_items = array_slice(array_values($items),0,$args->list_count); |
358 | 390 | } return $content_items; |
359 | 391 | } |
360 | 392 | |
361 | 393 | function _getRssBody($value) |
362 | 394 | { |
363 | - if(!$value || is_string($value)) return $value; |
|
364 | - if(is_object($value)) $value = get_object_vars($value); |
|
395 | + if(!$value || is_string($value)) { |
|
396 | + return $value; |
|
397 | + } |
|
398 | + if(is_object($value)) { |
|
399 | + $value = get_object_vars($value); |
|
400 | + } |
|
365 | 401 | $body = null; |
366 | - if(!count($value)) return; |
|
402 | + if(!count($value)) { |
|
403 | + return; |
|
404 | + } |
|
367 | 405 | foreach($value as $key => $val) |
368 | 406 | { |
369 | 407 | if($key == 'body') |
@@ -371,8 +409,12 @@ discard block |
||
371 | 409 | $body = $val; |
372 | 410 | continue; |
373 | 411 | } |
374 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
375 | - if($body !== null) return $body; |
|
412 | + if(is_object($val)||is_array($val)) { |
|
413 | + $body = $this->_getRssBody($val); |
|
414 | + } |
|
415 | + if($body !== null) { |
|
416 | + return $body; |
|
417 | + } |
|
376 | 418 | } |
377 | 419 | return $body; |
378 | 420 | } |
@@ -416,7 +458,9 @@ discard block |
||
416 | 458 | $buff = $this->requestFeedContents($args->rss_url); |
417 | 459 | |
418 | 460 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
419 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
461 | + if($encoding && stripos($matches[1], "UTF-8") === FALSE) { |
|
462 | + $buff = Context::convertEncodingStr($buff); |
|
463 | + } |
|
420 | 464 | |
421 | 465 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
422 | 466 | |
@@ -430,20 +474,28 @@ discard block |
||
430 | 474 | |
431 | 475 | $items = $xml_doc->rss->channel->item; |
432 | 476 | |
433 | - if(!$items) return; |
|
434 | - if($items && !is_array($items)) $items = array($items); |
|
477 | + if(!$items) { |
|
478 | + return; |
|
479 | + } |
|
480 | + if($items && !is_array($items)) { |
|
481 | + $items = array($items); |
|
482 | + } |
|
435 | 483 | |
436 | 484 | $content_items = array(); |
437 | 485 | |
438 | 486 | foreach ($items as $key => $value) |
439 | 487 | { |
440 | - if($key >= $args->list_count) break; |
|
488 | + if($key >= $args->list_count) { |
|
489 | + break; |
|
490 | + } |
|
441 | 491 | unset($item); |
442 | 492 | $item = new stdClass(); |
443 | 493 | |
444 | 494 | foreach($value as $key2 => $value2) |
445 | 495 | { |
446 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
496 | + if(is_array($value2)) { |
|
497 | + $value2 = array_shift($value2); |
|
498 | + } |
|
447 | 499 | $item->{$key2} = $this->_getRssBody($value2); |
448 | 500 | } |
449 | 501 | |
@@ -460,8 +512,7 @@ discard block |
||
460 | 512 | |
461 | 513 | $content_items[] = $content_item; |
462 | 514 | } |
463 | - } |
|
464 | - else if($xml_doc->{'rdf:rdf'}) |
|
515 | + } else if($xml_doc->{'rdf:rdf'}) |
|
465 | 516 | { |
466 | 517 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters) Fixed by misol |
467 | 518 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -469,20 +520,28 @@ discard block |
||
469 | 520 | |
470 | 521 | $items = $xml_doc->{'rdf:rdf'}->item; |
471 | 522 | |
472 | - if(!$items) return; |
|
473 | - if($items && !is_array($items)) $items = array($items); |
|
523 | + if(!$items) { |
|
524 | + return; |
|
525 | + } |
|
526 | + if($items && !is_array($items)) { |
|
527 | + $items = array($items); |
|
528 | + } |
|
474 | 529 | |
475 | 530 | $content_items = array(); |
476 | 531 | |
477 | 532 | foreach ($items as $key => $value) |
478 | 533 | { |
479 | - if($key >= $args->list_count) break; |
|
534 | + if($key >= $args->list_count) { |
|
535 | + break; |
|
536 | + } |
|
480 | 537 | unset($item); |
481 | 538 | $item = new stdClass(); |
482 | 539 | |
483 | 540 | foreach($value as $key2 => $value2) |
484 | 541 | { |
485 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
542 | + if(is_array($value2)) { |
|
543 | + $value2 = array_shift($value2); |
|
544 | + } |
|
486 | 545 | $item->{$key2} = $this->_getRssBody($value2); |
487 | 546 | } |
488 | 547 | |
@@ -499,8 +558,7 @@ discard block |
||
499 | 558 | |
500 | 559 | $content_items[] = $content_item; |
501 | 560 | } |
502 | - } |
|
503 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
561 | + } else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
504 | 562 | { |
505 | 563 | // Atom 1.0 spec supported by misol |
506 | 564 | $rss->title = $xml_doc->feed->title->body; |
@@ -515,24 +573,33 @@ discard block |
||
515 | 573 | break; |
516 | 574 | } |
517 | 575 | } |
576 | + } else if($links->attrs->rel == 'alternate') { |
|
577 | + $rss->link = $links->attrs->href; |
|
518 | 578 | } |
519 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
520 | 579 | |
521 | 580 | $items = $xml_doc->feed->entry; |
522 | 581 | |
523 | - if(!$items) return; |
|
524 | - if($items && !is_array($items)) $items = array($items); |
|
582 | + if(!$items) { |
|
583 | + return; |
|
584 | + } |
|
585 | + if($items && !is_array($items)) { |
|
586 | + $items = array($items); |
|
587 | + } |
|
525 | 588 | |
526 | 589 | $content_items = array(); |
527 | 590 | |
528 | 591 | foreach ($items as $key => $value) |
529 | 592 | { |
530 | - if($key >= $args->list_count) break; |
|
593 | + if($key >= $args->list_count) { |
|
594 | + break; |
|
595 | + } |
|
531 | 596 | unset($item); |
532 | 597 | |
533 | 598 | foreach($value as $key2 => $value2) |
534 | 599 | { |
535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
600 | + if(is_array($value2)) { |
|
601 | + $value2 = array_shift($value2); |
|
602 | + } |
|
536 | 603 | $item->{$key2} = $this->_getRssBody($value2); |
537 | 604 | } |
538 | 605 | |
@@ -548,13 +615,16 @@ discard block |
||
548 | 615 | break; |
549 | 616 | } |
550 | 617 | } |
618 | + } else if($links->attrs->rel == 'alternate') { |
|
619 | + $item->link = $links->attrs->href; |
|
551 | 620 | } |
552 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
553 | 621 | |
554 | 622 | $content_item->setContentsLink($rss->link); |
555 | 623 | if($item->title) |
556 | 624 | { |
557 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
625 | + if(stripos($value->title->attrs->type, "html") === FALSE) { |
|
626 | + $item->title = $value->title->body; |
|
627 | + } |
|
558 | 628 | } |
559 | 629 | $content_item->setTitle($item->title); |
560 | 630 | $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
@@ -598,7 +668,9 @@ discard block |
||
598 | 668 | $oTrackbackModel = getModel('trackback'); |
599 | 669 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
600 | 670 | // If an error occurs, just ignore it. |
601 | - if(!$output->toBool() || !$output->data) return; |
|
671 | + if(!$output->toBool() || !$output->data) { |
|
672 | + return; |
|
673 | + } |
|
602 | 674 | // If the result exists, make each document as an object |
603 | 675 | $content_items = array(); |
604 | 676 | foreach($output->data as $key => $item) |
@@ -695,7 +767,9 @@ discard block |
||
695 | 767 | static $default_domain = null; |
696 | 768 | if(!$domain) |
697 | 769 | { |
698 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
770 | + if(is_null($default_domain)) { |
|
771 | + $default_domain = Context::getDefaultUrl(); |
|
772 | + } |
|
699 | 773 | $domain = $default_domain; |
700 | 774 | } |
701 | 775 | $this->domain = $domain; |
@@ -764,13 +838,21 @@ discard block |
||
764 | 838 | { |
765 | 839 | $title = strip_tags($this->get('title')); |
766 | 840 | |
767 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
841 | + if($cut_size) { |
|
842 | + $title = cut_str($title, $cut_size, $tail); |
|
843 | + } |
|
768 | 844 | |
769 | 845 | $attrs = array(); |
770 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
771 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
846 | + if($this->get('title_bold') == 'Y') { |
|
847 | + $attrs[] = 'font-weight:bold'; |
|
848 | + } |
|
849 | + if($this->get('title_color') && $this->get('title_color') != 'N') { |
|
850 | + $attrs[] = 'color:#'.$this->get('title_color'); |
|
851 | + } |
|
772 | 852 | |
773 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
853 | + if(count($attrs)) { |
|
854 | + $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
855 | + } |
|
774 | 856 | |
775 | 857 | return $title; |
776 | 858 | } |
@@ -18,32 +18,32 @@ discard block |
||
18 | 18 | function proc($args) |
19 | 19 | { |
20 | 20 | // Targets to sort |
21 | - if(!in_array($args->order_target, array('list_order','update_order'))) $args->order_target = 'list_order'; |
|
21 | + if (!in_array($args->order_target, array('list_order', 'update_order'))) $args->order_target = 'list_order'; |
|
22 | 22 | // Sort order |
23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
23 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
24 | 24 | // The number of displayed lists |
25 | - $args->list_count = (int)$args->list_count; |
|
26 | - if(!$args->list_count) $args->list_count = 5; |
|
25 | + $args->list_count = (int) $args->list_count; |
|
26 | + if (!$args->list_count) $args->list_count = 5; |
|
27 | 27 | // Cut the length of the title |
28 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
28 | + if (!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
29 | 29 | // Cut the length of contents |
30 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
30 | + if (!$args->content_cut_size) $args->content_cut_size = 100; |
|
31 | 31 | // Viewing options |
32 | - $args->option_view_arr = explode(',',$args->option_view); |
|
32 | + $args->option_view_arr = explode(',', $args->option_view); |
|
33 | 33 | // markup options |
34 | - if(!$args->markup_type) $args->markup_type = 'list'; |
|
34 | + if (!$args->markup_type) $args->markup_type = 'list'; |
|
35 | 35 | // Set variables for internal use |
36 | 36 | $oModuleModel = getModel('module'); |
37 | 37 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
38 | 38 | $site_module_info = Context::get('site_module_info'); |
39 | 39 | // List URLs if a type is RSS |
40 | - if($args->content_type == 'rss') |
|
40 | + if ($args->content_type == 'rss') |
|
41 | 41 | { |
42 | 42 | $args->rss_urls = array(); |
43 | - $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
|
44 | - for($i=0,$c=count($rss_urls);$i<$c;$i++) |
|
43 | + $rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4)); |
|
44 | + for ($i = 0, $c = count($rss_urls); $i < $c; $i++) |
|
45 | 45 | { |
46 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
46 | + if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
47 | 47 | } |
48 | 48 | // Get module information after listing module_srls if the module is not RSS |
49 | 49 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | { |
52 | 52 | $obj = new stdClass(); |
53 | 53 | // Apply to all modules in the site if a target module is not specified |
54 | - if(!$args->module_srls) |
|
54 | + if (!$args->module_srls) |
|
55 | 55 | { |
56 | - $obj->site_srl = (int)$site_module_info->site_srl; |
|
56 | + $obj->site_srl = (int) $site_module_info->site_srl; |
|
57 | 57 | $output = executeQueryArray('widgets.content.getMids', $obj); |
58 | - if($output->data) |
|
58 | + if ($output->data) |
|
59 | 59 | { |
60 | - foreach($output->data as $key => $val) |
|
60 | + foreach ($output->data as $key => $val) |
|
61 | 61 | { |
62 | 62 | $args->modules_info[$val->mid] = $val; |
63 | 63 | $args->module_srls_info[$val->module_srl] = $val; |
@@ -73,35 +73,35 @@ discard block |
||
73 | 73 | { |
74 | 74 | $obj->module_srls = $args->module_srls; |
75 | 75 | $output = executeQueryArray('widgets.content.getMids', $obj); |
76 | - if($output->data) |
|
76 | + if ($output->data) |
|
77 | 77 | { |
78 | - foreach($output->data as $key => $val) |
|
78 | + foreach ($output->data as $key => $val) |
|
79 | 79 | { |
80 | 80 | $args->modules_info[$val->mid] = $val; |
81 | 81 | $args->module_srls_info[$val->module_srl] = $val; |
82 | 82 | $module_srls[] = $val->module_srl; |
83 | 83 | } |
84 | - $idx = explode(',',$args->module_srls); |
|
85 | - for($i=0,$c=count($idx);$i<$c;$i++) |
|
84 | + $idx = explode(',', $args->module_srls); |
|
85 | + for ($i = 0, $c = count($idx); $i < $c; $i++) |
|
86 | 86 | { |
87 | 87 | $srl = $idx[$i]; |
88 | - if(!$args->module_srls_info[$srl]) continue; |
|
88 | + if (!$args->module_srls_info[$srl]) continue; |
|
89 | 89 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
93 | 93 | // Exit if no module is found |
94 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
95 | - $args->module_srl = implode(',',$module_srls); |
|
94 | + if (!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
95 | + $args->module_srl = implode(',', $module_srls); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |
100 | 100 | */ |
101 | 101 | // tab mode |
102 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
102 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
103 | 103 | { |
104 | - switch($args->content_type) |
|
104 | + switch ($args->content_type) |
|
105 | 105 | { |
106 | 106 | case 'comment': |
107 | 107 | $content_items = $this->_getCommentItems($args); |
@@ -125,17 +125,17 @@ discard block |
||
125 | 125 | { |
126 | 126 | $content_items = array(); |
127 | 127 | |
128 | - switch($args->content_type) |
|
128 | + switch ($args->content_type) |
|
129 | 129 | { |
130 | 130 | case 'comment': |
131 | - foreach($args->mid_lists as $module_srl => $mid) |
|
131 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
132 | 132 | { |
133 | 133 | $args->module_srl = $module_srl; |
134 | 134 | $content_items[$module_srl] = $this->_getCommentItems($args); |
135 | 135 | } |
136 | 136 | break; |
137 | 137 | case 'image': |
138 | - foreach($args->mid_lists as $module_srl => $mid) |
|
138 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
139 | 139 | { |
140 | 140 | $args->module_srl = $module_srl; |
141 | 141 | $content_items[$module_srl] = $this->_getImageItems($args); |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | $content_items = $this->getRssItems($args); |
146 | 146 | break; |
147 | 147 | case 'trackback': |
148 | - foreach($args->mid_lists as $module_srl => $mid){ |
|
148 | + foreach ($args->mid_lists as $module_srl => $mid) { |
|
149 | 149 | $args->module_srl = $module_srl; |
150 | 150 | $content_items[$module_srl] = $this->_getTrackbackItems($args); |
151 | 151 | } |
152 | 152 | break; |
153 | 153 | default: |
154 | - foreach($args->mid_lists as $module_srl => $mid) |
|
154 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
155 | 155 | { |
156 | 156 | $args->module_srl = $module_srl; |
157 | 157 | $content_items[$module_srl] = $this->_getDocumentItems($args); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | - $output = $this->_compile($args,$content_items); |
|
163 | + $output = $this->_compile($args, $content_items); |
|
164 | 164 | return $output; |
165 | 165 | } |
166 | 166 | |
@@ -180,14 +180,14 @@ discard block |
||
180 | 180 | |
181 | 181 | $content_items = array(); |
182 | 182 | |
183 | - if(!count($output)) return; |
|
183 | + if (!count($output)) return; |
|
184 | 184 | |
185 | - foreach($output as $key => $oComment) |
|
185 | + foreach ($output as $key => $oComment) |
|
186 | 186 | { |
187 | 187 | $attribute = $oComment->getObjectVars(); |
188 | 188 | $title = $oComment->getSummary($args->content_cut_size); |
189 | 189 | $thumbnail = $oComment->getThumbnail(); |
190 | - $url = sprintf("%s#comment_%s",getUrl('','document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl')); |
|
190 | + $url = sprintf("%s#comment_%s", getUrl('', 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl')); |
|
191 | 191 | |
192 | 192 | $attribute->mid = $args->mid_lists[$attribute->module_srl]; |
193 | 193 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | // Get categories |
213 | 213 | $obj = new stdClass(); |
214 | 214 | $obj->module_srl = $args->module_srl; |
215 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
216 | - if($output->toBool() && $output->data) |
|
215 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
216 | + if ($output->toBool() && $output->data) |
|
217 | 217 | { |
218 | - foreach($output->data as $key => $val) |
|
218 | + foreach ($output->data as $key => $val) |
|
219 | 219 | { |
220 | 220 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
221 | 221 | } |
@@ -223,17 +223,17 @@ discard block |
||
223 | 223 | // Get a list of documents |
224 | 224 | $obj->module_srl = $args->module_srl; |
225 | 225 | $obj->sort_index = $args->order_target; |
226 | - $obj->order_type = $args->order_type=="desc"?"asc":"desc"; |
|
226 | + $obj->order_type = $args->order_type == "desc" ? "asc" : "desc"; |
|
227 | 227 | $obj->list_count = $args->list_count; |
228 | 228 | $obj->statusList = array('PUBLIC'); |
229 | 229 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
230 | - if(!$output->toBool() || !$output->data) return; |
|
230 | + if (!$output->toBool() || !$output->data) return; |
|
231 | 231 | // If the result exists, make each document as an object |
232 | 232 | $content_items = array(); |
233 | 233 | $first_thumbnail_idx = -1; |
234 | - if(count($output->data)) |
|
234 | + if (count($output->data)) |
|
235 | 235 | { |
236 | - foreach($output->data as $key => $attribute) |
|
236 | + foreach ($output->data as $key => $attribute) |
|
237 | 237 | { |
238 | 238 | $oDocument = new documentItem(); |
239 | 239 | $oDocument->setAttribute($attribute, false); |
@@ -242,23 +242,23 @@ discard block |
||
242 | 242 | } |
243 | 243 | $oDocumentModel->setToAllDocumentExtraVars(); |
244 | 244 | |
245 | - for($i=0,$c=count($document_srls);$i<$c;$i++) |
|
245 | + for ($i = 0, $c = count($document_srls); $i < $c; $i++) |
|
246 | 246 | { |
247 | 247 | $oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]]; |
248 | 248 | $document_srl = $oDocument->document_srl; |
249 | 249 | $module_srl = $oDocument->get('module_srl'); |
250 | 250 | $category_srl = $oDocument->get('category_srl'); |
251 | 251 | $thumbnail = $oDocument->getThumbnail(); |
252 | - $content_item = new mcontentItem( $args->module_srls_info[$module_srl]->browser_title ); |
|
252 | + $content_item = new mcontentItem($args->module_srls_info[$module_srl]->browser_title); |
|
253 | 253 | $content_item->adds($oDocument->getObjectVars()); |
254 | 254 | $content_item->setTitle($oDocument->getTitleText()); |
255 | - $content_item->setCategory( $category_lists[$module_srl][$category_srl]->title ); |
|
256 | - $content_item->setDomain( $args->module_srls_info[$module_srl]->domain ); |
|
255 | + $content_item->setCategory($category_lists[$module_srl][$category_srl]->title); |
|
256 | + $content_item->setDomain($args->module_srls_info[$module_srl]->domain); |
|
257 | 257 | $content_item->setContent($oDocument->getSummary($args->content_cut_size)); |
258 | - $content_item->setLink( getSiteUrl($domain,'','document_srl',$document_srl) ); |
|
258 | + $content_item->setLink(getSiteUrl($domain, '', 'document_srl', $document_srl)); |
|
259 | 259 | $content_item->setThumbnail($thumbnail); |
260 | 260 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
261 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
261 | + if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i; |
|
262 | 262 | $content_items[] = $content_item; |
263 | 263 | } |
264 | 264 | |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | $obj->direct_download = 'Y'; |
277 | 277 | $obj->isvalid = 'Y'; |
278 | 278 | // Get categories |
279 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
280 | - if($output->toBool() && $output->data) |
|
279 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
280 | + if ($output->toBool() && $output->data) |
|
281 | 281 | { |
282 | - foreach($output->data as $key => $val) |
|
282 | + foreach ($output->data as $key => $val) |
|
283 | 283 | { |
284 | 284 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
285 | 285 | } |
@@ -288,24 +288,24 @@ discard block |
||
288 | 288 | $obj->list_count = $args->list_count; |
289 | 289 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
290 | 290 | $files_count = count($files_output->data); |
291 | - if(!$files_count) return; |
|
291 | + if (!$files_count) return; |
|
292 | 292 | |
293 | 293 | $content_items = array(); |
294 | 294 | |
295 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
295 | + for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
296 | 296 | |
297 | 297 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
298 | 298 | |
299 | - if(!count($tmp_document_list)) return; |
|
299 | + if (!count($tmp_document_list)) return; |
|
300 | 300 | |
301 | - foreach($tmp_document_list as $oDocument) |
|
301 | + foreach ($tmp_document_list as $oDocument) |
|
302 | 302 | { |
303 | 303 | $attribute = $oDocument->getObjectVars(); |
304 | 304 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
305 | 305 | $domain = $args->module_srls_info[$attribute->module_srl]->domain; |
306 | 306 | $category = $category_lists[$attribute->module_srl]->text; |
307 | 307 | $content = $oDocument->getSummary($args->content_cut_size); |
308 | - $url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount()); |
|
308 | + $url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount()); |
|
309 | 309 | $thumbnail = $oDocument->getThumbnail(); |
310 | 310 | $content_item = new mcontentItem($browser_title); |
311 | 311 | $content_item->adds($attribute); |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | $content_items = array(); |
328 | 328 | $args->mid_lists = array(); |
329 | 329 | |
330 | - foreach($args->rss_urls as $key => $rss) |
|
330 | + foreach ($args->rss_urls as $key => $rss) |
|
331 | 331 | { |
332 | 332 | $args->rss_url = $rss; |
333 | 333 | $content_item = $this->_getRssItems($args); |
334 | - if(count($content_item) > 0) |
|
334 | + if (count($content_item) > 0) |
|
335 | 335 | { |
336 | 336 | $browser_title = $content_item[0]->getBrowserTitle(); |
337 | 337 | $args->mid_lists[] = $browser_title; |
@@ -339,40 +339,40 @@ discard block |
||
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
342 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
343 | 343 | { |
344 | 344 | $items = array(); |
345 | - foreach($content_items as $key => $val) |
|
345 | + foreach ($content_items as $key => $val) |
|
346 | 346 | { |
347 | - foreach($val as $k => $v) |
|
347 | + foreach ($val as $k => $v) |
|
348 | 348 | { |
349 | 349 | $date = $v->get('regdate'); |
350 | - $i=0; |
|
351 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
352 | - $items[sprintf('%s%02d',$date,$i)] = $v; |
|
350 | + $i = 0; |
|
351 | + while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++; |
|
352 | + $items[sprintf('%s%02d', $date, $i)] = $v; |
|
353 | 353 | } |
354 | 354 | } |
355 | - if($args->order_type =='asc') ksort($items); |
|
355 | + if ($args->order_type == 'asc') ksort($items); |
|
356 | 356 | else krsort($items); |
357 | - $content_items = array_slice(array_values($items),0,$args->list_count); |
|
357 | + $content_items = array_slice(array_values($items), 0, $args->list_count); |
|
358 | 358 | } return $content_items; |
359 | 359 | } |
360 | 360 | |
361 | 361 | function _getRssBody($value) |
362 | 362 | { |
363 | - if(!$value || is_string($value)) return $value; |
|
364 | - if(is_object($value)) $value = get_object_vars($value); |
|
363 | + if (!$value || is_string($value)) return $value; |
|
364 | + if (is_object($value)) $value = get_object_vars($value); |
|
365 | 365 | $body = null; |
366 | - if(!count($value)) return; |
|
367 | - foreach($value as $key => $val) |
|
366 | + if (!count($value)) return; |
|
367 | + foreach ($value as $key => $val) |
|
368 | 368 | { |
369 | - if($key == 'body') |
|
369 | + if ($key == 'body') |
|
370 | 370 | { |
371 | 371 | $body = $val; |
372 | 372 | continue; |
373 | 373 | } |
374 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
375 | - if($body !== null) return $body; |
|
374 | + if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val); |
|
375 | + if ($body !== null) return $body; |
|
376 | 376 | } |
377 | 377 | return $body; |
378 | 378 | } |
@@ -383,17 +383,17 @@ discard block |
||
383 | 383 | // Replace tags such as </p> , </div> , </li> and others to a whitespace |
384 | 384 | $content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content); |
385 | 385 | // Remove Tag |
386 | - $content = preg_replace('!<([^>]*?)>!is','', $content); |
|
386 | + $content = preg_replace('!<([^>]*?)>!is', '', $content); |
|
387 | 387 | // Replace tags to < , > , " |
388 | - $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); |
|
388 | + $content = str_replace(array('<', '>', '"', ' '), array('<', '>', '"', ' '), $content); |
|
389 | 389 | // Delete a series of whitespaces |
390 | 390 | $content = preg_replace('/ ( +)/is', ' ', $content); |
391 | 391 | // Truncate string |
392 | 392 | $content = trim(cut_str($content, $str_size, $tail)); |
393 | 393 | // Replace back < , > , " to theoriginal tags |
394 | - $content = str_replace(array('<','>','"'),array('<','>','"'), $content); |
|
394 | + $content = str_replace(array('<', '>', '"'), array('<', '>', '"'), $content); |
|
395 | 395 | // Fixed a newline bug on a set of consecutive English letters |
396 | - $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content); |
|
396 | + $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content); |
|
397 | 397 | return $content; |
398 | 398 | } |
399 | 399 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | */ |
405 | 405 | function requestFeedContents($rss_url) |
406 | 406 | { |
407 | - $rss_url = str_replace('&','&',Context::convertEncodingStr($rss_url)); |
|
407 | + $rss_url = str_replace('&', '&', Context::convertEncodingStr($rss_url)); |
|
408 | 408 | return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml'); |
409 | 409 | } |
410 | 410 | |
@@ -416,52 +416,52 @@ discard block |
||
416 | 416 | $buff = $this->requestFeedContents($args->rss_url); |
417 | 417 | |
418 | 418 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
419 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
419 | + if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
420 | 420 | |
421 | 421 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
422 | 422 | |
423 | 423 | $oXmlParser = new XmlParser(); |
424 | 424 | $xml_doc = $oXmlParser->parse($buff); |
425 | 425 | $rss = new stdClass(); |
426 | - if($xml_doc->rss) |
|
426 | + if ($xml_doc->rss) |
|
427 | 427 | { |
428 | 428 | $rss->title = $xml_doc->rss->channel->title->body; |
429 | 429 | $rss->link = $xml_doc->rss->channel->link->body; |
430 | 430 | |
431 | 431 | $items = $xml_doc->rss->channel->item; |
432 | 432 | |
433 | - if(!$items) return; |
|
434 | - if($items && !is_array($items)) $items = array($items); |
|
433 | + if (!$items) return; |
|
434 | + if ($items && !is_array($items)) $items = array($items); |
|
435 | 435 | |
436 | 436 | $content_items = array(); |
437 | 437 | |
438 | 438 | foreach ($items as $key => $value) |
439 | 439 | { |
440 | - if($key >= $args->list_count) break; |
|
440 | + if ($key >= $args->list_count) break; |
|
441 | 441 | unset($item); |
442 | 442 | $item = new stdClass(); |
443 | 443 | |
444 | - foreach($value as $key2 => $value2) |
|
444 | + foreach ($value as $key2 => $value2) |
|
445 | 445 | { |
446 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
446 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
447 | 447 | $item->{$key2} = $this->_getRssBody($value2); |
448 | 448 | } |
449 | 449 | |
450 | 450 | $content_item = new mcontentItem($rss->title); |
451 | 451 | $content_item->setContentsLink($rss->link); |
452 | 452 | $content_item->setTitle($item->title); |
453 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
453 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
454 | 454 | //$content_item->setCategory($item->category); |
455 | - $item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description); |
|
455 | + $item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description); |
|
456 | 456 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
457 | 457 | $content_item->setLink($item->link); |
458 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
458 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
459 | 459 | $content_item->setRegdate($date); |
460 | 460 | |
461 | 461 | $content_items[] = $content_item; |
462 | 462 | } |
463 | 463 | } |
464 | - else if($xml_doc->{'rdf:rdf'}) |
|
464 | + else if ($xml_doc->{'rdf:rdf'}) |
|
465 | 465 | { |
466 | 466 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters) Fixed by misol |
467 | 467 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -469,102 +469,102 @@ discard block |
||
469 | 469 | |
470 | 470 | $items = $xml_doc->{'rdf:rdf'}->item; |
471 | 471 | |
472 | - if(!$items) return; |
|
473 | - if($items && !is_array($items)) $items = array($items); |
|
472 | + if (!$items) return; |
|
473 | + if ($items && !is_array($items)) $items = array($items); |
|
474 | 474 | |
475 | 475 | $content_items = array(); |
476 | 476 | |
477 | 477 | foreach ($items as $key => $value) |
478 | 478 | { |
479 | - if($key >= $args->list_count) break; |
|
479 | + if ($key >= $args->list_count) break; |
|
480 | 480 | unset($item); |
481 | 481 | $item = new stdClass(); |
482 | 482 | |
483 | - foreach($value as $key2 => $value2) |
|
483 | + foreach ($value as $key2 => $value2) |
|
484 | 484 | { |
485 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
485 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
486 | 486 | $item->{$key2} = $this->_getRssBody($value2); |
487 | 487 | } |
488 | 488 | |
489 | 489 | $content_item = new mcontentItem($rss->title); |
490 | 490 | $content_item->setContentsLink($rss->link); |
491 | 491 | $content_item->setTitle($item->title); |
492 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
492 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
493 | 493 | //$content_item->setCategory($item->category); |
494 | - $item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description); |
|
494 | + $item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description); |
|
495 | 495 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
496 | 496 | $content_item->setLink($item->link); |
497 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
497 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
498 | 498 | $content_item->setRegdate($date); |
499 | 499 | |
500 | 500 | $content_items[] = $content_item; |
501 | 501 | } |
502 | 502 | } |
503 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
503 | + else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
504 | 504 | { |
505 | 505 | // Atom 1.0 spec supported by misol |
506 | 506 | $rss->title = $xml_doc->feed->title->body; |
507 | 507 | $links = $xml_doc->feed->link; |
508 | - if(is_array($links)) |
|
508 | + if (is_array($links)) |
|
509 | 509 | { |
510 | 510 | foreach ($links as $value) |
511 | 511 | { |
512 | - if($value->attrs->rel == 'alternate') |
|
512 | + if ($value->attrs->rel == 'alternate') |
|
513 | 513 | { |
514 | 514 | $rss->link = $value->attrs->href; |
515 | 515 | break; |
516 | 516 | } |
517 | 517 | } |
518 | 518 | } |
519 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
519 | + else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
520 | 520 | |
521 | 521 | $items = $xml_doc->feed->entry; |
522 | 522 | |
523 | - if(!$items) return; |
|
524 | - if($items && !is_array($items)) $items = array($items); |
|
523 | + if (!$items) return; |
|
524 | + if ($items && !is_array($items)) $items = array($items); |
|
525 | 525 | |
526 | 526 | $content_items = array(); |
527 | 527 | |
528 | 528 | foreach ($items as $key => $value) |
529 | 529 | { |
530 | - if($key >= $args->list_count) break; |
|
530 | + if ($key >= $args->list_count) break; |
|
531 | 531 | unset($item); |
532 | 532 | |
533 | - foreach($value as $key2 => $value2) |
|
533 | + foreach ($value as $key2 => $value2) |
|
534 | 534 | { |
535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
535 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
536 | 536 | $item->{$key2} = $this->_getRssBody($value2); |
537 | 537 | } |
538 | 538 | |
539 | 539 | $content_item = new mcontentItem($rss->title); |
540 | 540 | $links = $value->link; |
541 | - if(is_array($links)) |
|
541 | + if (is_array($links)) |
|
542 | 542 | { |
543 | 543 | foreach ($links as $val) |
544 | 544 | { |
545 | - if($val->attrs->rel == 'alternate') |
|
545 | + if ($val->attrs->rel == 'alternate') |
|
546 | 546 | { |
547 | 547 | $item->link = $val->attrs->href; |
548 | 548 | break; |
549 | 549 | } |
550 | 550 | } |
551 | 551 | } |
552 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
552 | + else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
553 | 553 | |
554 | 554 | $content_item->setContentsLink($rss->link); |
555 | - if($item->title) |
|
555 | + if ($item->title) |
|
556 | 556 | { |
557 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
557 | + if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
558 | 558 | } |
559 | 559 | $content_item->setTitle($item->title); |
560 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
560 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
561 | 561 | $content_item->setAuthorSite($value->author->uri->body); |
562 | 562 | |
563 | 563 | //$content_item->setCategory($item->category); |
564 | 564 | $item->description = ($item->content) ? $item->content : $item->description = $item->summary; |
565 | - $item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description); |
|
565 | + $item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description); |
|
566 | 566 | |
567 | - if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
567 | + if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
568 | 568 | { |
569 | 569 | $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
570 | 570 | |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | |
573 | 573 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
574 | 574 | $content_item->setLink($item->link); |
575 | - $date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'}))); |
|
575 | + $date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'}))); |
|
576 | 576 | $content_item->setRegdate($date); |
577 | 577 | |
578 | 578 | $content_items[] = $content_item; |
@@ -581,12 +581,12 @@ discard block |
||
581 | 581 | return $content_items; |
582 | 582 | } |
583 | 583 | |
584 | - function _getTrackbackItems($args){ |
|
584 | + function _getTrackbackItems($args) { |
|
585 | 585 | // Get categories |
586 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
587 | - if($output->toBool() && $output->data) |
|
586 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
587 | + if ($output->toBool() && $output->data) |
|
588 | 588 | { |
589 | - foreach($output->data as $key => $val) { |
|
589 | + foreach ($output->data as $key => $val) { |
|
590 | 590 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
591 | 591 | } |
592 | 592 | } |
@@ -598,14 +598,14 @@ discard block |
||
598 | 598 | $oTrackbackModel = getModel('trackback'); |
599 | 599 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
600 | 600 | // If an error occurs, just ignore it. |
601 | - if(!$output->toBool() || !$output->data) return; |
|
601 | + if (!$output->toBool() || !$output->data) return; |
|
602 | 602 | // If the result exists, make each document as an object |
603 | 603 | $content_items = array(); |
604 | - foreach($output->data as $key => $item) |
|
604 | + foreach ($output->data as $key => $item) |
|
605 | 605 | { |
606 | 606 | $domain = $args->module_srls_info[$item->module_srl]->domain; |
607 | 607 | $category = $category_lists[$item->module_srl]->text; |
608 | - $url = getSiteUrl($domain,'','document_srl',$item->document_srl); |
|
608 | + $url = getSiteUrl($domain, '', 'document_srl', $item->document_srl); |
|
609 | 609 | $browser_title = $args->module_srls_info[$item->module_srl]->browser_title; |
610 | 610 | |
611 | 611 | $content_item = new mcontentItem($browser_title); |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | $content_item->setTitle($item->title); |
614 | 614 | $content_item->setCategory($category); |
615 | 615 | $content_item->setNickName($item->blog_name); |
616 | - $content_item->setContent($item->excerpt); ///<< |
|
617 | - $content_item->setDomain($domain); ///<< |
|
616 | + $content_item->setContent($item->excerpt); ///<< |
|
617 | + $content_item->setDomain($domain); ///<< |
|
618 | 618 | $content_item->setLink($url); |
619 | 619 | $content_item->add('mid', $args->mid_lists[$item->module_srl]); |
620 | 620 | $content_item->setRegdate($item->regdate); |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | return $content_items; |
624 | 624 | } |
625 | 625 | |
626 | - function _compile($args,$content_items) |
|
626 | + function _compile($args, $content_items) |
|
627 | 627 | { |
628 | 628 | $oTemplate = &TemplateHandler::getInstance(); |
629 | 629 | // Set variables for widget |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | var $contents_link = null; |
672 | 672 | var $domain = null; |
673 | 673 | |
674 | - function mcontentItem($browser_title='') |
|
674 | + function mcontentItem($browser_title = '') |
|
675 | 675 | { |
676 | 676 | $this->browser_title = $browser_title; |
677 | 677 | } |
@@ -681,58 +681,58 @@ discard block |
||
681 | 681 | } |
682 | 682 | function setFirstThumbnailIdx($first_thumbnail_idx) |
683 | 683 | { |
684 | - if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1) { |
|
684 | + if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1) { |
|
685 | 685 | $this->has_first_thumbnail_idx = true; |
686 | - $this->first_thumbnail_idx= $first_thumbnail_idx; |
|
686 | + $this->first_thumbnail_idx = $first_thumbnail_idx; |
|
687 | 687 | } |
688 | 688 | } |
689 | 689 | function setExtraImages($extra_images) |
690 | 690 | { |
691 | - $this->add('extra_images',$extra_images); |
|
691 | + $this->add('extra_images', $extra_images); |
|
692 | 692 | } |
693 | 693 | function setDomain($domain) |
694 | 694 | { |
695 | 695 | static $default_domain = null; |
696 | - if(!$domain) |
|
696 | + if (!$domain) |
|
697 | 697 | { |
698 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
698 | + if (is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
699 | 699 | $domain = $default_domain; |
700 | 700 | } |
701 | 701 | $this->domain = $domain; |
702 | 702 | } |
703 | 703 | function setLink($url) |
704 | 704 | { |
705 | - $this->add('url',$url); |
|
705 | + $this->add('url', $url); |
|
706 | 706 | } |
707 | 707 | function setTitle($title) |
708 | 708 | { |
709 | - $this->add('title',$title); |
|
709 | + $this->add('title', $title); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | function setThumbnail($thumbnail) |
713 | 713 | { |
714 | - $this->add('thumbnail',$thumbnail); |
|
714 | + $this->add('thumbnail', $thumbnail); |
|
715 | 715 | } |
716 | 716 | function setContent($content) |
717 | 717 | { |
718 | - $this->add('content',$content); |
|
718 | + $this->add('content', $content); |
|
719 | 719 | } |
720 | 720 | function setRegdate($regdate) |
721 | 721 | { |
722 | - $this->add('regdate',$regdate); |
|
722 | + $this->add('regdate', $regdate); |
|
723 | 723 | } |
724 | 724 | function setNickName($nick_name) |
725 | 725 | { |
726 | - $this->add('nick_name',$nick_name); |
|
726 | + $this->add('nick_name', $nick_name); |
|
727 | 727 | } |
728 | 728 | // Save author's homepage url by misol |
729 | 729 | function setAuthorSite($site_url) |
730 | 730 | { |
731 | - $this->add('author_site',$site_url); |
|
731 | + $this->add('author_site', $site_url); |
|
732 | 732 | } |
733 | 733 | function setCategory($category) |
734 | 734 | { |
735 | - $this->add('category',$category); |
|
735 | + $this->add('category', $category); |
|
736 | 736 | } |
737 | 737 | function getBrowserTitle() |
738 | 738 | { |
@@ -760,17 +760,17 @@ discard block |
||
760 | 760 | { |
761 | 761 | return $this->get('module_srl'); |
762 | 762 | } |
763 | - function getTitle($cut_size = 0, $tail='...') |
|
763 | + function getTitle($cut_size = 0, $tail = '...') |
|
764 | 764 | { |
765 | 765 | $title = strip_tags($this->get('title')); |
766 | 766 | |
767 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
767 | + if ($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
768 | 768 | |
769 | 769 | $attrs = array(); |
770 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
771 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
770 | + if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
771 | + if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
772 | 772 | |
773 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
773 | + if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
774 | 774 | |
775 | 775 | return $title; |
776 | 776 | } |
@@ -793,12 +793,12 @@ discard block |
||
793 | 793 | function getCommentCount() |
794 | 794 | { |
795 | 795 | $comment_count = $this->get('comment_count'); |
796 | - return $comment_count>0 ? $comment_count : ''; |
|
796 | + return $comment_count > 0 ? $comment_count : ''; |
|
797 | 797 | } |
798 | 798 | function getTrackbackCount() |
799 | 799 | { |
800 | 800 | $trackback_count = $this->get('trackback_count'); |
801 | - return $trackback_count>0 ? $trackback_count : ''; |
|
801 | + return $trackback_count > 0 ? $trackback_count : ''; |
|
802 | 802 | } |
803 | 803 | function getRegdate($format = 'Y.m.d H:i:s') |
804 | 804 | { |