@@ -126,12 +126,14 @@ discard block |
||
126 | 126 | if (!is_array($order)) { |
127 | 127 | $this->order[] = "{$order} {$type}"; |
128 | 128 | } else { |
129 | - foreach ($order as $item) |
|
130 | - if (!is_array($item)) { |
|
129 | + foreach ($order as $item) { |
|
130 | + if (!is_array($item)) { |
|
131 | 131 | call_user_func_array(array($this, 'order'), $order); |
132 | + } |
|
132 | 133 | break; |
133 | - } else |
|
134 | - $this->order($item); |
|
134 | + } else { |
|
135 | + $this->order($item); |
|
136 | + } |
|
135 | 137 | } |
136 | 138 | } |
137 | 139 | |
@@ -140,8 +142,9 @@ discard block |
||
140 | 142 | $start = intval($start); |
141 | 143 | $len = intval($len); |
142 | 144 | $this->limit = "LIMIT {$start}"; |
143 | - if ($len !== 0) |
|
144 | - $this->limit .= ",{$len}"; |
|
145 | + if ($len !== 0) { |
|
146 | + $this->limit .= ",{$len}"; |
|
147 | + } |
|
145 | 148 | } |
146 | 149 | |
147 | 150 | public function buildJoin($table, $where = false, $type = 'LEFT', $alias = '') |
@@ -154,10 +157,12 @@ discard block |
||
154 | 157 | } |
155 | 158 | } else { |
156 | 159 | $join .= " {$type} JOIN {$this->curInstance->table_prefix}{$table}"; |
157 | - if ($alias) |
|
158 | - $join .= " AS `{$alias}`"; |
|
159 | - if ($where) |
|
160 | - $join .= " ON {$where}"; |
|
160 | + if ($alias) { |
|
161 | + $join .= " AS `{$alias}`"; |
|
162 | + } |
|
163 | + if ($where) { |
|
164 | + $join .= " ON {$where}"; |
|
165 | + } |
|
161 | 166 | } |
162 | 167 | return $join; |
163 | 168 | } |
@@ -177,13 +182,15 @@ discard block |
||
177 | 182 | $operation = '='; |
178 | 183 | } |
179 | 184 | |
180 | - if ($concatenation === false) |
|
181 | - $concatenation = 'AND'; |
|
182 | - elseif ($concatenation === true) |
|
183 | - $concatenation = ''; |
|
185 | + if ($concatenation === false) { |
|
186 | + $concatenation = 'AND'; |
|
187 | + } elseif ($concatenation === true) { |
|
188 | + $concatenation = ''; |
|
189 | + } |
|
184 | 190 | |
185 | - if ($this->whereString == NULL) |
|
186 | - $this->whereString = ' WHERE '; |
|
191 | + if ($this->whereString == NULL) { |
|
192 | + $this->whereString = ' WHERE '; |
|
193 | + } |
|
187 | 194 | |
188 | 195 | if (stristr($operation, 'IN') || stristr($operation, 'NOT IN')) { |
189 | 196 | if (is_array($value)) { |
@@ -209,12 +216,12 @@ discard block |
||
209 | 216 | $value = "?"; |
210 | 217 | } |
211 | 218 | |
212 | - if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ') |
|
213 | - $this->whereString .= " {$where} {$operation} {$value} "; |
|
214 | - else |
|
215 | - $this->whereString .= "{$concatenation} {$where} {$operation} {$value} "; |
|
216 | - } |
|
217 | - else { |
|
219 | + if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ') { |
|
220 | + $this->whereString .= " {$where} {$operation} {$value} "; |
|
221 | + } else { |
|
222 | + $this->whereString .= "{$concatenation} {$where} {$operation} {$value} "; |
|
223 | + } |
|
224 | + } else { |
|
218 | 225 | $i = -1; |
219 | 226 | while (isset($where[++$i])) { |
220 | 227 | $item = $where[$i]; |
@@ -229,10 +236,11 @@ discard block |
||
229 | 236 | $this->whereString .= "{$concatenation} "; |
230 | 237 | } |
231 | 238 | |
232 | - if ($this->whereString != NULL) |
|
233 | - $this->whereString .= '('; |
|
234 | - else |
|
235 | - $this->whereString = 'WHERE ('; |
|
239 | + if ($this->whereString != NULL) { |
|
240 | + $this->whereString .= '('; |
|
241 | + } else { |
|
242 | + $this->whereString = 'WHERE ('; |
|
243 | + } |
|
236 | 244 | } |
237 | 245 | |
238 | 246 | if (!is_array($item)) { |
@@ -32,19 +32,19 @@ discard block |
||
32 | 32 | ?> |
33 | 33 | <div class="item <?= !$i ? 'active' : ''; ?>"> |
34 | 34 | <?php |
35 | - if ($item->link) { |
|
36 | - echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
37 | - } |
|
38 | - ?> |
|
35 | + if ($item->link) { |
|
36 | + echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
37 | + } |
|
38 | + ?> |
|
39 | 39 | <img src="<?= Statics::file($item->image->path); ?>" alt="<?= $item->name; ?>"> |
40 | 40 | <div class="carousel-caption"> |
41 | 41 | <?= $item->description; ?> |
42 | 42 | </div> |
43 | 43 | <?php |
44 | - if ($item->link) { |
|
45 | - echo "</a>"; |
|
46 | - } |
|
47 | - ?> |
|
44 | + if ($item->link) { |
|
45 | + echo "</a>"; |
|
46 | + } |
|
47 | + ?> |
|
48 | 48 | </div> |
49 | 49 | <?php |
50 | 50 | $i++; |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | </div> |
54 | 54 | |
55 | 55 | <?php |
56 | - if (!isset($arrows) || $arrows) { |
|
57 | - ?> |
|
56 | + if (!isset($arrows) || $arrows) { |
|
57 | + ?> |
|
58 | 58 | <!-- Controls --> |
59 | 59 | <a class="left carousel-control" href="#sliderWidget-<?= $slider->id; ?>" role="button" data-slide="prev"> |
60 | 60 | <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | <span class="sr-only">Next</span> |
66 | 66 | </a> |
67 | 67 | <?php |
68 | - } |
|
69 | - ?> |
|
68 | + } |
|
69 | + ?> |
|
70 | 70 | </div> |
71 | 71 | \ No newline at end of file |