@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | function getValue($with_values = true) |
33 | 33 | { |
34 | - if($with_values) |
|
34 | + if ($with_values) |
|
35 | 35 | { |
36 | 36 | return $this->argument->getValue(); |
37 | 37 | } |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | function show() |
42 | 42 | { |
43 | - if(!$this->argument) |
|
43 | + if (!$this->argument) |
|
44 | 44 | { |
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | $value = $this->argument->getValue(); |
48 | - if(!isset($value)) |
|
48 | + if (!isset($value)) |
|
49 | 49 | { |
50 | 50 | return false; |
51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | function getArguments() |
61 | 61 | { |
62 | - if($this->argument) |
|
62 | + if ($this->argument) |
|
63 | 63 | { |
64 | 64 | return array($this->argument); |
65 | 65 | } |
@@ -62,8 +62,7 @@ |
||
62 | 62 | if($this->argument) |
63 | 63 | { |
64 | 64 | return array($this->argument); |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | return array(); |
69 | 68 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | // TODO Escape value according to column type instead of variable type |
40 | 40 | $value = $this->argument; |
41 | - if(!is_numeric($value)) |
|
41 | + if (!is_numeric($value)) |
|
42 | 42 | { |
43 | 43 | return "'" . $value . "'"; |
44 | 44 | } |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | |
48 | 48 | function show() |
49 | 49 | { |
50 | - if(!$this->argument) |
|
50 | + if (!$this->argument) |
|
51 | 51 | { |
52 | 52 | return false; |
53 | 53 | } |
54 | 54 | $value = $this->argument; |
55 | - if(!isset($value)) |
|
55 | + if (!isset($value)) |
|
56 | 56 | { |
57 | 57 | return false; |
58 | 58 | } |
@@ -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,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | function toString() |
83 | 83 | { |
84 | - if($this->page) |
|
84 | + if ($this->page) |
|
85 | 85 | { |
86 | 86 | return $this->start . ' , ' . $this->list_count->getValue(); |
87 | 87 | } |
@@ -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 | } |
@@ -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 | } |
@@ -52,10 +52,10 @@ |
||
52 | 52 | $db_info = Context::getDBInfo(); |
53 | 53 | $prefix = $db_info->master_db["db_table_prefix"]; |
54 | 54 | |
55 | - foreach($this->index_hints_list as $index_hint) |
|
55 | + foreach ($this->index_hints_list as $index_hint) |
|
56 | 56 | { |
57 | 57 | $index_hint_type = $index_hint->getIndexHintType(); |
58 | - if($index_hint_type !== 'IGNORE') |
|
58 | + if ($index_hint_type !== 'IGNORE') |
|
59 | 59 | { |
60 | 60 | $result .= $this->alias . '.' |
61 | 61 | . '"' . $prefix . substr($index_hint->getIndexName(), 1) |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $part = $this->join_type . ' ' . $this->name; |
45 | 45 | $part .= $this->alias ? ' as ' . $this->alias : ''; |
46 | 46 | $part .= ' on '; |
47 | - foreach($this->conditions as $conditionGroup) |
|
47 | + foreach ($this->conditions as $conditionGroup) |
|
48 | 48 | { |
49 | 49 | $part .= $conditionGroup->toString($with_value); |
50 | 50 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function getArguments() |
60 | 60 | { |
61 | 61 | $args = array(); |
62 | - foreach($this->conditions as $conditionGroup) |
|
62 | + foreach ($this->conditions as $conditionGroup) |
|
63 | 63 | { |
64 | 64 | $args = array_merge($args, $conditionGroup->getArguments()); |
65 | 65 | } |
@@ -46,15 +46,15 @@ |
||
46 | 46 | |
47 | 47 | $index_hint_string = ''; |
48 | 48 | $indexTypeList = array('USE' => 1, 'FORCE' => 1); |
49 | - foreach($this->index_hints_list as $index_hint) |
|
49 | + foreach ($this->index_hints_list as $index_hint) |
|
50 | 50 | { |
51 | 51 | $index_hint_type = $index_hint->getIndexHintType(); |
52 | - if(isset($indexTypeList[$index_hint_type])) |
|
52 | + if (isset($indexTypeList[$index_hint_type])) |
|
53 | 53 | { |
54 | 54 | $index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), '; |
55 | 55 | } |
56 | 56 | } |
57 | - if($index_hint_string != '') |
|
57 | + if ($index_hint_string != '') |
|
58 | 58 | { |
59 | 59 | $result .= ' WITH(' . substr($index_hint_string, 0, -2) . ') '; |
60 | 60 | } |
@@ -47,31 +47,31 @@ |
||
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 | 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 | 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 | 63 | $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
64 | 64 | } |
65 | 65 | } |
66 | - if($use_index_hint != '') |
|
66 | + if ($use_index_hint != '') |
|
67 | 67 | { |
68 | 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 | 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 | 76 | $result .= ' IGNORE INDEX (' . substr($ignore_index_hint, 0, -2) . ') '; |
77 | 77 | } |
@@ -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 | } |
@@ -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,12 +50,12 @@ 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 | 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 | 61 | $html[] = 'self.location.href = "' . $request_url . 'common/tpl/redirect.html?redirect_url=' . urlencode($url) . '";'; |
@@ -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 | { |