@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | if($this->page) |
63 | 63 | { |
64 | 64 | return true; |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | return false; |
69 | 68 | } |
@@ -84,8 +83,7 @@ discard block |
||
84 | 83 | if($this->page) |
85 | 84 | { |
86 | 85 | return $this->start . ' , ' . $this->list_count->getValue(); |
87 | - } |
|
88 | - else |
|
86 | + } else |
|
89 | 87 | { |
90 | 88 | return $this->list_count->getValue(); |
91 | 89 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | function Limit($list_count, $page = NULL, $page_count = NULL) |
44 | 44 | { |
45 | 45 | $this->list_count = $list_count; |
46 | - if($page) |
|
46 | + if ($page) |
|
47 | 47 | { |
48 | 48 | $list_count_value = $list_count->getValue(); |
49 | 49 | $page_value = $page->getValue(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | function isPageHandler() |
61 | 61 | { |
62 | - if($this->page) |
|
62 | + if ($this->page) |
|
63 | 63 | { |
64 | 64 | return true; |
65 | 65 | } |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | function toString() |
83 | 83 | { |
84 | - if($this->page) |
|
84 | + if ($this->page) |
|
85 | 85 | { |
86 | - return $this->start . ' , ' . $this->list_count->getValue(); |
|
86 | + return $this->start.' , '.$this->list_count->getValue(); |
|
87 | 87 | } |
88 | 88 | else |
89 | 89 | { |
@@ -59,11 +59,11 @@ |
||
59 | 59 | function getArguments() |
60 | 60 | { |
61 | 61 | $args = array(); |
62 | - if(is_a($this->column_name, 'Argument')) |
|
62 | + if (is_a($this->column_name, 'Argument')) |
|
63 | 63 | { |
64 | 64 | $args[] = $this->column_name; |
65 | 65 | } |
66 | - if(is_a($this->sort_order, 'Argument')) |
|
66 | + if (is_a($this->sort_order, 'Argument')) |
|
67 | 67 | { |
68 | 68 | $args[] = $this->sort_order; |
69 | 69 | } |
@@ -53,12 +53,10 @@ |
||
53 | 53 | if($index_hint_type == 'USE') |
54 | 54 | { |
55 | 55 | $use_index_hint .= $index_hint->getIndexName() . ', '; |
56 | - } |
|
57 | - else if($index_hint_type == 'FORCE') |
|
56 | + } else if($index_hint_type == 'FORCE') |
|
58 | 57 | { |
59 | 58 | $force_index_hint .= $index_hint->getIndexName() . ', '; |
60 | - } |
|
61 | - else if($index_hint_type == 'IGNORE') |
|
59 | + } else if($index_hint_type == 'IGNORE') |
|
62 | 60 | { |
63 | 61 | $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
64 | 62 | } |
@@ -47,33 +47,33 @@ |
||
47 | 47 | $use_index_hint = ''; |
48 | 48 | $force_index_hint = ''; |
49 | 49 | $ignore_index_hint = ''; |
50 | - foreach($this->index_hints_list as $index_hint) |
|
50 | + foreach ($this->index_hints_list as $index_hint) |
|
51 | 51 | { |
52 | 52 | $index_hint_type = $index_hint->getIndexHintType(); |
53 | - if($index_hint_type == 'USE') |
|
53 | + if ($index_hint_type == 'USE') |
|
54 | 54 | { |
55 | - $use_index_hint .= $index_hint->getIndexName() . ', '; |
|
55 | + $use_index_hint .= $index_hint->getIndexName().', '; |
|
56 | 56 | } |
57 | - else if($index_hint_type == 'FORCE') |
|
57 | + else if ($index_hint_type == 'FORCE') |
|
58 | 58 | { |
59 | - $force_index_hint .= $index_hint->getIndexName() . ', '; |
|
59 | + $force_index_hint .= $index_hint->getIndexName().', '; |
|
60 | 60 | } |
61 | - else if($index_hint_type == 'IGNORE') |
|
61 | + else if ($index_hint_type == 'IGNORE') |
|
62 | 62 | { |
63 | - $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
|
63 | + $ignore_index_hint .= $index_hint->getIndexName().', '; |
|
64 | 64 | } |
65 | 65 | } |
66 | - if($use_index_hint != '') |
|
66 | + if ($use_index_hint != '') |
|
67 | 67 | { |
68 | - $result .= ' USE INDEX (' . substr($use_index_hint, 0, -2) . ') '; |
|
68 | + $result .= ' USE INDEX ('.substr($use_index_hint, 0, -2).') '; |
|
69 | 69 | } |
70 | - if($force_index_hint != '') |
|
70 | + if ($force_index_hint != '') |
|
71 | 71 | { |
72 | - $result .= ' FORCE INDEX (' . substr($force_index_hint, 0, -2) . ') '; |
|
72 | + $result .= ' FORCE INDEX ('.substr($force_index_hint, 0, -2).') '; |
|
73 | 73 | } |
74 | - if($ignore_index_hint != '') |
|
74 | + if ($ignore_index_hint != '') |
|
75 | 75 | { |
76 | - $result .= ' IGNORE INDEX (' . substr($ignore_index_hint, 0, -2) . ') '; |
|
76 | + $result .= ' IGNORE INDEX ('.substr($ignore_index_hint, 0, -2).') '; |
|
77 | 77 | } |
78 | 78 | return $result; |
79 | 79 | } |
@@ -32,13 +32,11 @@ |
||
32 | 32 | if($redirect_url) |
33 | 33 | { |
34 | 34 | $output->url = $redirect_url; |
35 | - } |
|
36 | - else |
|
35 | + } else |
|
37 | 36 | { |
38 | 37 | $output->url = $request_uri; |
39 | 38 | } |
40 | - } |
|
41 | - else |
|
39 | + } else |
|
42 | 40 | { |
43 | 41 | if($message != 'fail') |
44 | 42 | { |
@@ -17,19 +17,19 @@ discard block |
||
17 | 17 | $request_url = Context::getRequestUri(); |
18 | 18 | $output = new stdClass(); |
19 | 19 | |
20 | - if(substr_compare($request_url, '/', -1) !== 0) |
|
20 | + if (substr_compare($request_url, '/', -1) !== 0) |
|
21 | 21 | { |
22 | 22 | $request_url .= '/'; |
23 | 23 | } |
24 | 24 | |
25 | - if($error === 0) |
|
25 | + if ($error === 0) |
|
26 | 26 | { |
27 | - if($message != 'success') |
|
27 | + if ($message != 'success') |
|
28 | 28 | { |
29 | 29 | $output->message = $message; |
30 | 30 | } |
31 | 31 | |
32 | - if($redirect_url) |
|
32 | + if ($redirect_url) |
|
33 | 33 | { |
34 | 34 | $output->url = $redirect_url; |
35 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | else |
42 | 42 | { |
43 | - if($message != 'fail') |
|
43 | + if ($message != 'fail') |
|
44 | 44 | { |
45 | 45 | $output->message = $message; |
46 | 46 | } |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | $html[] = '<script type="text/javascript">'; |
51 | 51 | $html[] = '//<![CDATA['; |
52 | 52 | |
53 | - if($output->message) |
|
53 | + if ($output->message) |
|
54 | 54 | { |
55 | - $html[] = 'alert("' . $output->message . '");'; |
|
55 | + $html[] = 'alert("'.$output->message.'");'; |
|
56 | 56 | } |
57 | 57 | |
58 | - if($output->url) |
|
58 | + if ($output->url) |
|
59 | 59 | { |
60 | 60 | $url = preg_replace('/#(.+)$/i', '', $output->url); |
61 | - $html[] = 'self.location.href = "' . $request_url . 'common/tpl/redirect.html?redirect_url=' . urlencode($url) . '";'; |
|
61 | + $html[] = 'self.location.href = "'.$request_url.'common/tpl/redirect.html?redirect_url='.urlencode($url).'";'; |
|
62 | 62 | } |
63 | 63 | $html[] = '//]]>'; |
64 | 64 | $html[] = '</script>'; |
@@ -31,25 +31,25 @@ |
||
31 | 31 | */ |
32 | 32 | function _makeXmlDoc($obj) |
33 | 33 | { |
34 | - if(!count($obj)) |
|
34 | + if (!count($obj)) |
|
35 | 35 | { |
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | 39 | $xmlDoc = ''; |
40 | 40 | |
41 | - foreach($obj as $key => $val) |
|
41 | + foreach ($obj as $key => $val) |
|
42 | 42 | { |
43 | - if(is_numeric($key)) |
|
43 | + if (is_numeric($key)) |
|
44 | 44 | { |
45 | 45 | $key = 'item'; |
46 | 46 | } |
47 | 47 | |
48 | - if(is_string($val)) |
|
48 | + if (is_string($val)) |
|
49 | 49 | { |
50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
51 | 51 | } |
52 | - else if(!is_array($val) && !is_object($val)) |
|
52 | + else if (!is_array($val) && !is_object($val)) |
|
53 | 53 | { |
54 | 54 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
55 | 55 | } |
@@ -48,12 +48,10 @@ |
||
48 | 48 | if(is_string($val)) |
49 | 49 | { |
50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
51 | - } |
|
52 | - else if(!is_array($val) && !is_object($val)) |
|
51 | + } else if(!is_array($val) && !is_object($val)) |
|
53 | 52 | { |
54 | 53 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
55 | - } |
|
56 | - else |
|
54 | + } else |
|
57 | 55 | { |
58 | 56 | $xmlDoc .= sprintf('<%s>%s%s</%s>%s', $key, "\n", $this->_makeXmlDoc($val), $key, "\n"); |
59 | 57 | } |
@@ -20,12 +20,12 @@ |
||
20 | 20 | { |
21 | 21 | Context::set('component_info', $info); |
22 | 22 | |
23 | - if(!$info->extra_vars) |
|
23 | + if (!$info->extra_vars) |
|
24 | 24 | { |
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | - foreach($info->extra_vars as $key => $val) |
|
28 | + foreach ($info->extra_vars as $key => $val) |
|
29 | 29 | { |
30 | 30 | $this->{$key} = trim($val->value); |
31 | 31 | } |
@@ -215,12 +215,10 @@ discard block |
||
215 | 215 | if(is_array($value)) |
216 | 216 | { |
217 | 217 | $values = $value; |
218 | - } |
|
219 | - elseif(strpos($value, '|@|') !== FALSE) |
|
218 | + } elseif(strpos($value, '|@|') !== FALSE) |
|
220 | 219 | { |
221 | 220 | $values = explode('|@|', $value); |
222 | - } |
|
223 | - elseif(strpos($value, ',') !== FALSE) |
|
221 | + } elseif(strpos($value, ',') !== FALSE) |
|
224 | 222 | { |
225 | 223 | $values = explode(',', $value); |
226 | 224 | } |
@@ -238,16 +236,13 @@ discard block |
||
238 | 236 | if(is_array($value)) |
239 | 237 | { |
240 | 238 | $values = $value; |
241 | - } |
|
242 | - elseif(strpos($value, '|@|') !== FALSE) |
|
239 | + } elseif(strpos($value, '|@|') !== FALSE) |
|
243 | 240 | { |
244 | 241 | $values = explode('|@|', $value); |
245 | - } |
|
246 | - elseif(strpos($value, ',') !== FALSE) |
|
242 | + } elseif(strpos($value, ',') !== FALSE) |
|
247 | 243 | { |
248 | 244 | $values = explode(',', $value); |
249 | - } |
|
250 | - else |
|
245 | + } else |
|
251 | 246 | { |
252 | 247 | $values = array($value); |
253 | 248 | } |
@@ -263,12 +258,10 @@ discard block |
||
263 | 258 | if(is_array($value)) |
264 | 259 | { |
265 | 260 | $values = $value; |
266 | - } |
|
267 | - elseif(strpos($value, '|@|') !== false) |
|
261 | + } elseif(strpos($value, '|@|') !== false) |
|
268 | 262 | { |
269 | 263 | $values = explode('|@|', $value); |
270 | - } |
|
271 | - else |
|
264 | + } else |
|
272 | 265 | { |
273 | 266 | $values = array($value); |
274 | 267 | } |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | function setExtraVarKeys($extra_keys) |
53 | 53 | { |
54 | - if(!is_array($extra_keys) || count($extra_keys) < 1) |
|
54 | + if (!is_array($extra_keys) || count($extra_keys) < 1) |
|
55 | 55 | { |
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | - foreach($extra_keys as $val) |
|
59 | + foreach ($extra_keys as $val) |
|
60 | 60 | { |
61 | 61 | $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid); |
62 | 62 | $this->keys[$val->idx] = $obj; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | function ExtraItem($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') |
161 | 161 | { |
162 | - if(!$idx) |
|
162 | + if (!$idx) |
|
163 | 163 | { |
164 | 164 | return; |
165 | 165 | } |
@@ -197,36 +197,36 @@ discard block |
||
197 | 197 | function _getTypeValue($type, $value) |
198 | 198 | { |
199 | 199 | $value = trim($value); |
200 | - if(!isset($value)) |
|
200 | + if (!isset($value)) |
|
201 | 201 | { |
202 | 202 | return; |
203 | 203 | } |
204 | 204 | |
205 | - switch($type) |
|
205 | + switch ($type) |
|
206 | 206 | { |
207 | 207 | case 'homepage' : |
208 | - if($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
208 | + if ($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
209 | 209 | { |
210 | - $value = 'http://' . $value; |
|
210 | + $value = 'http://'.$value; |
|
211 | 211 | } |
212 | 212 | return htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
213 | 213 | |
214 | 214 | case 'tel' : |
215 | - if(is_array($value)) |
|
215 | + if (is_array($value)) |
|
216 | 216 | { |
217 | 217 | $values = $value; |
218 | 218 | } |
219 | - elseif(strpos($value, '|@|') !== FALSE) |
|
219 | + elseif (strpos($value, '|@|') !== FALSE) |
|
220 | 220 | { |
221 | 221 | $values = explode('|@|', $value); |
222 | 222 | } |
223 | - elseif(strpos($value, ',') !== FALSE) |
|
223 | + elseif (strpos($value, ',') !== FALSE) |
|
224 | 224 | { |
225 | 225 | $values = explode(',', $value); |
226 | 226 | } |
227 | 227 | |
228 | 228 | $values = array_values($values); |
229 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
229 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
230 | 230 | { |
231 | 231 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
232 | 232 | } |
@@ -235,15 +235,15 @@ discard block |
||
235 | 235 | case 'checkbox' : |
236 | 236 | case 'radio' : |
237 | 237 | case 'select' : |
238 | - if(is_array($value)) |
|
238 | + if (is_array($value)) |
|
239 | 239 | { |
240 | 240 | $values = $value; |
241 | 241 | } |
242 | - elseif(strpos($value, '|@|') !== FALSE) |
|
242 | + elseif (strpos($value, '|@|') !== FALSE) |
|
243 | 243 | { |
244 | 244 | $values = explode('|@|', $value); |
245 | 245 | } |
246 | - elseif(strpos($value, ',') !== FALSE) |
|
246 | + elseif (strpos($value, ',') !== FALSE) |
|
247 | 247 | { |
248 | 248 | $values = explode(',', $value); |
249 | 249 | } |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | $values = array_values($values); |
256 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
256 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
257 | 257 | { |
258 | 258 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
259 | 259 | } |
260 | 260 | return $values; |
261 | 261 | |
262 | 262 | case 'kr_zip' : |
263 | - if(is_array($value)) |
|
263 | + if (is_array($value)) |
|
264 | 264 | { |
265 | 265 | $values = $value; |
266 | 266 | } |
267 | - elseif(strpos($value, '|@|') !== false) |
|
267 | + elseif (strpos($value, '|@|') !== false) |
|
268 | 268 | { |
269 | 269 | $values = explode('|@|', $value); |
270 | 270 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | $values = array_values($values); |
277 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
277 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
278 | 278 | { |
279 | 279 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
280 | 280 | } |
@@ -308,10 +308,10 @@ discard block |
||
308 | 308 | { |
309 | 309 | $value = $this->_getTypeValue($this->type, $this->value); |
310 | 310 | |
311 | - switch($this->type) |
|
311 | + switch ($this->type) |
|
312 | 312 | { |
313 | 313 | case 'homepage' : |
314 | - return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : ""; |
|
314 | + return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40).'...'.substr($value, -10) : $value)) : ""; |
|
315 | 315 | |
316 | 316 | case 'email_address' : |
317 | 317 | return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : ""; |
@@ -328,14 +328,14 @@ discard block |
||
328 | 328 | case 'checkbox' : |
329 | 329 | case 'select' : |
330 | 330 | case 'radio' : |
331 | - if(is_array($value)) |
|
331 | + if (is_array($value)) |
|
332 | 332 | { |
333 | 333 | return implode(',', $value); |
334 | 334 | } |
335 | 335 | return $value; |
336 | 336 | |
337 | 337 | case 'kr_zip' : |
338 | - if(is_array($value)) |
|
338 | + if (is_array($value)) |
|
339 | 339 | { |
340 | 340 | return implode(' ', $value); |
341 | 341 | } |
@@ -360,77 +360,77 @@ discard block |
||
360 | 360 | $name = $this->name; |
361 | 361 | $value = $this->_getTypeValue($this->type, $this->value); |
362 | 362 | $default = $this->_getTypeValue($this->type, $this->default); |
363 | - $column_name = 'extra_vars' . $this->idx; |
|
364 | - $tmp_id = $column_name . '-' . $id_num++; |
|
363 | + $column_name = 'extra_vars'.$this->idx; |
|
364 | + $tmp_id = $column_name.'-'.$id_num++; |
|
365 | 365 | |
366 | 366 | $buff = array(); |
367 | - switch($type) |
|
367 | + switch ($type) |
|
368 | 368 | { |
369 | 369 | // Homepage |
370 | 370 | case 'homepage' : |
371 | - $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />'; |
|
371 | + $buff[] = '<input type="text" name="'.$column_name.'" value="'.$value.'" class="homepage" />'; |
|
372 | 372 | break; |
373 | 373 | // Email Address |
374 | 374 | case 'email_address' : |
375 | - $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />'; |
|
375 | + $buff[] = '<input type="text" name="'.$column_name.'" value="'.$value.'" class="email_address" />'; |
|
376 | 376 | break; |
377 | 377 | // Phone Number |
378 | 378 | case 'tel' : |
379 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[0] . '" size="4" maxlength="4" class="tel" />'; |
|
380 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[1] . '" size="4" maxlength="4" class="tel" />'; |
|
381 | - $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[2] . '" size="4" maxlength="4" class="tel" />'; |
|
379 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[0].'" size="4" maxlength="4" class="tel" />'; |
|
380 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[1].'" size="4" maxlength="4" class="tel" />'; |
|
381 | + $buff[] = '<input type="text" name="'.$column_name.'[]" value="'.$value[2].'" size="4" maxlength="4" class="tel" />'; |
|
382 | 382 | break; |
383 | 383 | // textarea |
384 | 384 | case 'textarea' : |
385 | - $buff[] = '<textarea name="' . $column_name . '" rows="8" cols="42">' . $value . '</textarea>'; |
|
385 | + $buff[] = '<textarea name="'.$column_name.'" rows="8" cols="42">'.$value.'</textarea>'; |
|
386 | 386 | break; |
387 | 387 | // multiple choice |
388 | 388 | case 'checkbox' : |
389 | 389 | $buff[] = '<ul>'; |
390 | - foreach($default as $v) |
|
390 | + foreach ($default as $v) |
|
391 | 391 | { |
392 | 392 | $checked = ''; |
393 | - if($value && in_array(trim($v), $value)) |
|
393 | + if ($value && in_array(trim($v), $value)) |
|
394 | 394 | { |
395 | 395 | $checked = ' checked="checked"'; |
396 | 396 | } |
397 | 397 | |
398 | 398 | // Temporary ID for labeling |
399 | - $tmp_id = $column_name . '-' . $id_num++; |
|
399 | + $tmp_id = $column_name.'-'.$id_num++; |
|
400 | 400 | |
401 | - $buff[] =' <li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
401 | + $buff[] = ' <li><input type="checkbox" name="'.$column_name.'[]" id="'.$tmp_id.'" value="'.htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'" '.$checked.' /><label for="'.$tmp_id.'">'.$v.'</label></li>'; |
|
402 | 402 | } |
403 | 403 | $buff[] = '</ul>'; |
404 | 404 | break; |
405 | 405 | // single choice |
406 | 406 | case 'select' : |
407 | - $buff[] = '<select name="' . $column_name . '" class="select">'; |
|
408 | - foreach($default as $v) |
|
407 | + $buff[] = '<select name="'.$column_name.'" class="select">'; |
|
408 | + foreach ($default as $v) |
|
409 | 409 | { |
410 | 410 | $selected = ''; |
411 | - if($value && in_array(trim($v), $value)) |
|
411 | + if ($value && in_array(trim($v), $value)) |
|
412 | 412 | { |
413 | 413 | $selected = ' selected="selected"'; |
414 | 414 | } |
415 | - $buff[] = ' <option value="' . $v . '" ' . $selected . '>' . $v . '</option>'; |
|
415 | + $buff[] = ' <option value="'.$v.'" '.$selected.'>'.$v.'</option>'; |
|
416 | 416 | } |
417 | 417 | $buff[] = '</select>'; |
418 | 418 | break; |
419 | 419 | // radio |
420 | 420 | case 'radio' : |
421 | 421 | $buff[] = '<ul>'; |
422 | - foreach($default as $v) |
|
422 | + foreach ($default as $v) |
|
423 | 423 | { |
424 | 424 | $checked = ''; |
425 | - if($value && in_array(trim($v), $value)) |
|
425 | + if ($value && in_array(trim($v), $value)) |
|
426 | 426 | { |
427 | 427 | $checked = ' checked="checked"'; |
428 | 428 | } |
429 | 429 | |
430 | 430 | // Temporary ID for labeling |
431 | - $tmp_id = $column_name . '-' . $id_num++; |
|
431 | + $tmp_id = $column_name.'-'.$id_num++; |
|
432 | 432 | |
433 | - $buff[] = '<li><input type="radio" name="' . $column_name . '" id="' . $tmp_id . '" ' . $checked . ' value="' . $v . '" class="radio" /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
433 | + $buff[] = '<li><input type="radio" name="'.$column_name.'" id="'.$tmp_id.'" '.$checked.' value="'.$v.'" class="radio" /><label for="'.$tmp_id.'">'.$v.'</label></li>'; |
|
434 | 434 | } |
435 | 435 | $buff[] = '</ul>'; |
436 | 436 | break; |
@@ -439,43 +439,43 @@ discard block |
||
439 | 439 | // datepicker javascript plugin load |
440 | 440 | Context::loadJavascriptPlugin('ui.datepicker'); |
441 | 441 | |
442 | - $buff[] = '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />'; |
|
443 | - $buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" />'; |
|
444 | - $buff[] = '<input type="button" value="' . Context::getLang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />'; |
|
445 | - $buff[] = '<script type="text/javascript">'; |
|
442 | + $buff[] = '<input type="hidden" name="'.$column_name.'" value="'.$value.'" />'; |
|
443 | + $buff[] = '<input type="text" id="date_'.$column_name.'" value="'.zdate($value, 'Y-m-d').'" class="date" />'; |
|
444 | + $buff[] = '<input type="button" value="'.Context::getLang('cmd_delete').'" class="btn" id="dateRemover_'.$column_name.'" />'; |
|
445 | + $buff[] = '<script type="text/javascript">'; |
|
446 | 446 | $buff[] = '//<![CDATA['; |
447 | - $buff[] = '(function($){'; |
|
448 | - $buff[] = '$(function(){'; |
|
449 | - $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
450 | - $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
451 | - $buff[] = ' };'; |
|
452 | - $buff[] = ' $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);'; |
|
453 | - $buff[] = ' $("#date_' . $column_name . '").datepicker(option);'; |
|
454 | - $buff[] = ' $("#dateRemover_' . $column_name . '").click(function(){'; |
|
455 | - $buff[] = ' $(this).siblings("input").val("");'; |
|
456 | - $buff[] = ' return false;'; |
|
457 | - $buff[] = ' })'; |
|
458 | - $buff[] = '});'; |
|
459 | - $buff[] = '})(jQuery);'; |
|
447 | + $buff[] = '(function($){'; |
|
448 | + $buff[] = '$(function(){'; |
|
449 | + $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
450 | + $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
451 | + $buff[] = ' };'; |
|
452 | + $buff[] = ' $.extend(option,$.datepicker.regional[\''.Context::getLangType().'\']);'; |
|
453 | + $buff[] = ' $("#date_'.$column_name.'").datepicker(option);'; |
|
454 | + $buff[] = ' $("#dateRemover_'.$column_name.'").click(function(){'; |
|
455 | + $buff[] = ' $(this).siblings("input").val("");'; |
|
456 | + $buff[] = ' return false;'; |
|
457 | + $buff[] = ' })'; |
|
458 | + $buff[] = '});'; |
|
459 | + $buff[] = '})(jQuery);'; |
|
460 | 460 | $buff[] = '//]]>'; |
461 | 461 | $buff[] = '</script>'; |
462 | 462 | break; |
463 | 463 | // address |
464 | 464 | case "kr_zip" : |
465 | - if(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' )) |
|
465 | + if (($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel, 'getKrzipCodeSearchHtml')) |
|
466 | 466 | { |
467 | - $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
467 | + $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
468 | 468 | } |
469 | 469 | break; |
470 | 470 | // General text |
471 | 471 | default : |
472 | - $buff[] =' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />'; |
|
472 | + $buff[] = ' <input type="text" name="'.$column_name.'" value="'.($value ? $value : $default).'" class="text" />'; |
|
473 | 473 | } |
474 | - if($this->desc) |
|
474 | + if ($this->desc) |
|
475 | 475 | { |
476 | 476 | $oModuleController = getController('module'); |
477 | 477 | $oModuleController->replaceDefinedLangCode($this->desc); |
478 | - $buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>'; |
|
478 | + $buff[] = '<p>'.htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'</p>'; |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | return join(PHP_EOL, $buff); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function FileObject($path, $mode) |
38 | 38 | { |
39 | - if($path != NULL) |
|
39 | + if ($path != NULL) |
|
40 | 40 | { |
41 | 41 | $this->Open($path, $mode); |
42 | 42 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | function append($file_name) |
52 | 52 | { |
53 | 53 | $target = new FileObject($file_name, "r"); |
54 | - while(!$target->feof()) |
|
54 | + while (!$target->feof()) |
|
55 | 55 | { |
56 | 56 | $readstr = $target->read(); |
57 | 57 | $this->write($readstr); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | function write($str) |
90 | 90 | { |
91 | 91 | $len = strlen($str); |
92 | - if(!$str || $len <= 0) |
|
92 | + if (!$str || $len <= 0) |
|
93 | 93 | { |
94 | 94 | return FALSE; |
95 | 95 | } |
96 | - if(!$this->fp) |
|
96 | + if (!$this->fp) |
|
97 | 97 | { |
98 | 98 | return FALSE; |
99 | 99 | } |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | */ |
113 | 113 | function open($path, $mode) |
114 | 114 | { |
115 | - if($this->fp != NULL) |
|
115 | + if ($this->fp != NULL) |
|
116 | 116 | { |
117 | 117 | $this->close(); |
118 | 118 | } |
119 | 119 | $this->fp = fopen($path, $mode); |
120 | - if(!is_resource($this->fp)) |
|
120 | + if (!is_resource($this->fp)) |
|
121 | 121 | { |
122 | 122 | $this->fp = NULL; |
123 | 123 | return FALSE; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | function getPath() |
135 | 135 | { |
136 | - if($this->fp != NULL) |
|
136 | + if ($this->fp != NULL) |
|
137 | 137 | { |
138 | 138 | return $this->path; |
139 | 139 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | function close() |
152 | 152 | { |
153 | - if($this->fp != NULL) |
|
153 | + if ($this->fp != NULL) |
|
154 | 154 | { |
155 | 155 | fclose($this->fp); |
156 | 156 | $this->fp = NULL; |
@@ -136,8 +136,7 @@ |
||
136 | 136 | if($this->fp != NULL) |
137 | 137 | { |
138 | 138 | return $this->path; |
139 | - } |
|
140 | - else |
|
139 | + } else |
|
141 | 140 | { |
142 | 141 | return NULL; |
143 | 142 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function &getInstance() |
24 | 24 | { |
25 | 25 | static $theInstance; |
26 | - if(!isset($theInstance)) |
|
26 | + if (!isset($theInstance)) |
|
27 | 27 | { |
28 | 28 | $theInstance = new Mobile(); |
29 | 29 | } |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function _isFromMobilePhone() |
50 | 50 | { |
51 | - if($this->ismobile !== NULL) |
|
51 | + if ($this->ismobile !== NULL) |
|
52 | 52 | { |
53 | 53 | return $this->ismobile; |
54 | 54 | } |
55 | - if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"]) |
|
55 | + if (Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"]) |
|
56 | 56 | { |
57 | 57 | return ($this->ismobile = false); |
58 | 58 | } |
@@ -63,22 +63,22 @@ discard block |
||
63 | 63 | $this->ismobile = FALSE; |
64 | 64 | |
65 | 65 | $m = Context::get('m'); |
66 | - if(strlen($m) == 1) |
|
66 | + if (strlen($m) == 1) |
|
67 | 67 | { |
68 | - if($m == "1") |
|
68 | + if ($m == "1") |
|
69 | 69 | { |
70 | 70 | $this->ismobile = TRUE; |
71 | 71 | } |
72 | - elseif($m == "0") |
|
72 | + elseif ($m == "0") |
|
73 | 73 | { |
74 | 74 | $this->ismobile = FALSE; |
75 | 75 | } |
76 | 76 | } |
77 | - elseif(isset($_COOKIE['mobile'])) |
|
77 | + elseif (isset($_COOKIE['mobile'])) |
|
78 | 78 | { |
79 | - if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
|
79 | + if ($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
|
80 | 80 | { |
81 | - if($_COOKIE['mobile'] == 'true') |
|
81 | + if ($_COOKIE['mobile'] == 'true') |
|
82 | 82 | { |
83 | 83 | $this->ismobile = TRUE; |
84 | 84 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $this->ismobile = FALSE; |
93 | 93 | setcookie("mobile", FALSE, 0, $xe_web_path); |
94 | 94 | setcookie("user-agent", FALSE, 0, $xe_web_path); |
95 | - if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent()) |
|
95 | + if (!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent()) |
|
96 | 96 | { |
97 | 97 | $this->ismobile = TRUE; |
98 | 98 | } |
@@ -100,36 +100,36 @@ discard block |
||
100 | 100 | } |
101 | 101 | else |
102 | 102 | { |
103 | - if($this->isMobilePadCheckByAgent()) |
|
103 | + if ($this->isMobilePadCheckByAgent()) |
|
104 | 104 | { |
105 | 105 | $this->ismobile = FALSE; |
106 | 106 | } |
107 | 107 | else |
108 | 108 | { |
109 | - if($this->isMobileCheckByAgent()) |
|
109 | + if ($this->isMobileCheckByAgent()) |
|
110 | 110 | { |
111 | 111 | $this->ismobile = TRUE; |
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | - if($this->ismobile !== NULL) |
|
116 | + if ($this->ismobile !== NULL) |
|
117 | 117 | { |
118 | - if($this->ismobile == TRUE) |
|
118 | + if ($this->ismobile == TRUE) |
|
119 | 119 | { |
120 | - if($_COOKIE['mobile'] != 'true') |
|
120 | + if ($_COOKIE['mobile'] != 'true') |
|
121 | 121 | { |
122 | 122 | $_COOKIE['mobile'] = 'true'; |
123 | 123 | setcookie("mobile", 'true', 0, $xe_web_path); |
124 | 124 | } |
125 | 125 | } |
126 | - elseif($_COOKIE['mobile'] != 'false') |
|
126 | + elseif ($_COOKIE['mobile'] != 'false') |
|
127 | 127 | { |
128 | 128 | $_COOKIE['mobile'] = 'false'; |
129 | 129 | setcookie("mobile", 'false', 0, $xe_web_path); |
130 | 130 | } |
131 | 131 | |
132 | - if($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT'])) |
|
132 | + if ($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT'])) |
|
133 | 133 | { |
134 | 134 | setcookie("user-agent", md5($_SERVER['HTTP_USER_AGENT']), 0, $xe_web_path); |
135 | 135 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | function isMobileCheckByAgent() |
147 | 147 | { |
148 | 148 | static $UACheck; |
149 | - if(isset($UACheck)) |
|
149 | + if (isset($UACheck)) |
|
150 | 150 | { |
151 | 151 | return $UACheck; |
152 | 152 | } |
@@ -154,15 +154,15 @@ discard block |
||
154 | 154 | $oMobile = Mobile::getInstance(); |
155 | 155 | $mobileAgent = array('iPod', 'iPhone', 'Android', 'BlackBerry', 'SymbianOS', 'Bada', 'Tizen', 'Kindle', 'Wii', 'SCH-', 'SPH-', 'CANU-', 'Windows Phone', 'Windows CE', 'POLARIS', 'Palm', 'Dorothy Browser', 'Mobile', 'Opera Mobi', 'Opera Mini', 'Minimo', 'AvantGo', 'NetFront', 'Nokia', 'LGPlayer', 'SonyEricsson', 'HTC'); |
156 | 156 | |
157 | - if($oMobile->isMobilePadCheckByAgent()) |
|
157 | + if ($oMobile->isMobilePadCheckByAgent()) |
|
158 | 158 | { |
159 | 159 | $UACheck = TRUE; |
160 | 160 | return TRUE; |
161 | 161 | } |
162 | 162 | |
163 | - foreach($mobileAgent as $agent) |
|
163 | + foreach ($mobileAgent as $agent) |
|
164 | 164 | { |
165 | - if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
165 | + if (stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
166 | 166 | { |
167 | 167 | $UACheck = TRUE; |
168 | 168 | return TRUE; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | function isMobilePadCheckByAgent() |
181 | 181 | { |
182 | 182 | static $UACheck; |
183 | - if(isset($UACheck)) |
|
183 | + if (isset($UACheck)) |
|
184 | 184 | { |
185 | 185 | return $UACheck; |
186 | 186 | } |
@@ -190,21 +190,21 @@ discard block |
||
190 | 190 | // $exceptionAgent[0] contains exception agents for all exceptions. |
191 | 191 | $exceptionAgent = array(0 => array('Opera Mini', 'Opera Mobi'), 'Android' => 'Mobile'); |
192 | 192 | |
193 | - foreach($padAgent as $agent) |
|
193 | + foreach ($padAgent as $agent) |
|
194 | 194 | { |
195 | - if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
195 | + if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
196 | 196 | { |
197 | - if(!isset($exceptionAgent[$agent])) |
|
197 | + if (!isset($exceptionAgent[$agent])) |
|
198 | 198 | { |
199 | 199 | $UACheck = TRUE; |
200 | 200 | return TRUE; |
201 | 201 | } |
202 | - elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
202 | + elseif (strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
203 | 203 | { |
204 | 204 | // If the agent is the Android, that can be either tablet and mobile phone. |
205 | - foreach($exceptionAgent[0] as $val) |
|
205 | + foreach ($exceptionAgent[0] as $val) |
|
206 | 206 | { |
207 | - if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE) |
|
207 | + if (strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE) |
|
208 | 208 | { |
209 | 209 | $UACheck = FALSE; |
210 | 210 | return FALSE; |
@@ -68,26 +68,22 @@ discard block |
||
68 | 68 | if($m == "1") |
69 | 69 | { |
70 | 70 | $this->ismobile = TRUE; |
71 | - } |
|
72 | - elseif($m == "0") |
|
71 | + } elseif($m == "0") |
|
73 | 72 | { |
74 | 73 | $this->ismobile = FALSE; |
75 | 74 | } |
76 | - } |
|
77 | - elseif(isset($_COOKIE['mobile'])) |
|
75 | + } elseif(isset($_COOKIE['mobile'])) |
|
78 | 76 | { |
79 | 77 | if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
80 | 78 | { |
81 | 79 | if($_COOKIE['mobile'] == 'true') |
82 | 80 | { |
83 | 81 | $this->ismobile = TRUE; |
84 | - } |
|
85 | - else |
|
82 | + } else |
|
86 | 83 | { |
87 | 84 | $this->ismobile = FALSE; |
88 | 85 | } |
89 | - } |
|
90 | - else |
|
86 | + } else |
|
91 | 87 | { |
92 | 88 | $this->ismobile = FALSE; |
93 | 89 | setcookie("mobile", FALSE, 0, $xe_web_path); |
@@ -97,14 +93,12 @@ discard block |
||
97 | 93 | $this->ismobile = TRUE; |
98 | 94 | } |
99 | 95 | } |
100 | - } |
|
101 | - else |
|
96 | + } else |
|
102 | 97 | { |
103 | 98 | if($this->isMobilePadCheckByAgent()) |
104 | 99 | { |
105 | 100 | $this->ismobile = FALSE; |
106 | - } |
|
107 | - else |
|
101 | + } else |
|
108 | 102 | { |
109 | 103 | if($this->isMobileCheckByAgent()) |
110 | 104 | { |
@@ -122,8 +116,7 @@ discard block |
||
122 | 116 | $_COOKIE['mobile'] = 'true'; |
123 | 117 | setcookie("mobile", 'true', 0, $xe_web_path); |
124 | 118 | } |
125 | - } |
|
126 | - elseif($_COOKIE['mobile'] != 'false') |
|
119 | + } elseif($_COOKIE['mobile'] != 'false') |
|
127 | 120 | { |
128 | 121 | $_COOKIE['mobile'] = 'false'; |
129 | 122 | setcookie("mobile", 'false', 0, $xe_web_path); |
@@ -198,8 +191,7 @@ discard block |
||
198 | 191 | { |
199 | 192 | $UACheck = TRUE; |
200 | 193 | return TRUE; |
201 | - } |
|
202 | - elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
194 | + } elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
203 | 195 | { |
204 | 196 | // If the agent is the Android, that can be either tablet and mobile phone. |
205 | 197 | foreach($exceptionAgent[0] as $val) |