@@ -20,8 +20,7 @@ |
||
20 | 20 | if($res === false) |
21 | 21 | { |
22 | 22 | $app->response->setStatus(403); |
23 | - } |
|
24 | - else |
|
23 | + } else |
|
25 | 24 | { |
26 | 25 | echo json_encode($res); |
27 | 26 | } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | '; |
23 | -} |
|
24 | -else |
|
23 | +} else |
|
25 | 24 | { |
26 | 25 | $page->body .= ' |
27 | 26 | <div id="content"> |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | if($key == '_id') |
18 | 18 | { |
19 | 19 | $obj['_id'] = (string)$obj['_id']; |
20 | - } |
|
21 | - else if(is_object($value) || is_array($value)) |
|
20 | + } else if(is_object($value) || is_array($value)) |
|
22 | 21 | { |
23 | 22 | unset($obj[$key]); |
24 | 23 | } |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | if(count($params)) |
72 | 71 | { |
73 | 72 | $objs = $db->searchFromCollection('themes', $params, $fields); |
74 | - } |
|
75 | - else |
|
73 | + } else |
|
76 | 74 | { |
77 | 75 | $objs = $db->getAllFromCollection('themes', false, false, $fields); |
78 | 76 | } |
@@ -137,16 +135,14 @@ discard block |
||
137 | 135 | if($obj === FALSE) |
138 | 136 | { |
139 | 137 | throw new Exception('Unable to obtain object!', INTERNAL_ERROR); |
140 | - } |
|
141 | - else |
|
138 | + } else |
|
142 | 139 | { |
143 | 140 | if($app->request->params('full') === null) |
144 | 141 | { |
145 | 142 | if(!validate_user_is_admin($app->user)) |
146 | 143 | { |
147 | 144 | trim_obj($obj); |
148 | - } |
|
149 | - else if($field === false) |
|
145 | + } else if($field === false) |
|
150 | 146 | { |
151 | 147 | trim_obj($obj); |
152 | 148 | } |
@@ -161,15 +157,13 @@ discard block |
||
161 | 157 | $str = strtok("\0"); |
162 | 158 | print(base64_decode($str)); |
163 | 159 | $app->response->headers->set('Content-Type', $type); |
164 | - } |
|
165 | - else |
|
160 | + } else |
|
166 | 161 | { |
167 | 162 | echo json_encode($obj[$field]); |
168 | 163 | } |
169 | 164 | return; |
170 | 165 | } |
171 | - } |
|
172 | - else |
|
166 | + } else |
|
173 | 167 | { |
174 | 168 | if(validate_user_has_access($app->user, $obj) === FALSE) |
175 | 169 | { |
@@ -207,16 +201,14 @@ discard block |
||
207 | 201 | { |
208 | 202 | $app->redirect('themes/'.$obj['_id'], 307); |
209 | 203 | return; |
210 | - } |
|
211 | - else |
|
204 | + } else |
|
212 | 205 | { |
213 | 206 | $res = $db->addObjectToCollection('themes', $obj); |
214 | 207 | } |
215 | 208 | if($res === FALSE) |
216 | 209 | { |
217 | 210 | throw new Exception('Unable to add theme!', INTERNAL_ERROR); |
218 | - } |
|
219 | - else |
|
211 | + } else |
|
220 | 212 | { |
221 | 213 | echo json_encode(array('_id'=>(string)$res, 'url'=>$app->request->getUrl().$app->request->getPath().'/'.(string)$res)); |
222 | 214 | } |
@@ -269,8 +261,7 @@ discard block |
||
269 | 261 | if($res === FALSE) |
270 | 262 | { |
271 | 263 | throw new Exception('Unable to update object!', INTERNAL_ERROR); |
272 | - } |
|
273 | - else |
|
264 | + } else |
|
274 | 265 | { |
275 | 266 | echo json_encode(array('update'=>TRUE)); |
276 | 267 | } |
@@ -293,8 +284,7 @@ discard block |
||
293 | 284 | if($res === false) |
294 | 285 | { |
295 | 286 | throw new Exception('Unable to delete object!', INTERNAL_ERROR); |
296 | - } |
|
297 | - else |
|
287 | + } else |
|
298 | 288 | { |
299 | 289 | echo json_encode(array('delete'=>TRUE)); |
300 | 290 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if(!FlipSession::isLoggedIn()) |
20 | 20 | { |
21 | 21 | $this->add_link('Login', 'http://profiles.burningflipside.com/login.php?return='.$this->current_url()); |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | if($this->user->isInGroupNamed('ThemeAdmins')) |
26 | 25 | { |
@@ -35,12 +35,10 @@ |
||
35 | 35 | if($year !== '*' && $uid !== false) |
36 | 36 | { |
37 | 37 | $filter = new \Data\Filter("year eq $year and registrars eq $uid"); |
38 | - } |
|
39 | - else if($year !== '*') |
|
38 | + } else if($year !== '*') |
|
40 | 39 | { |
41 | 40 | $filter = new \Data\Filter("year eq $year"); |
42 | - } |
|
43 | - else if($uid !== false) |
|
41 | + } else if($uid !== false) |
|
44 | 42 | { |
45 | 43 | $filter = new \Data\Filter("registrars eq $uid"); |
46 | 44 | } |
@@ -17,8 +17,7 @@ |
||
17 | 17 | if($this->secure_root === false || strlen($this->secure_root) === 0) |
18 | 18 | { |
19 | 19 | $this->secure_root = '/'; |
20 | - } |
|
21 | - else if($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
20 | + } else if($this->secure_root[strlen($this->secure_root)-1] !== '/') |
|
22 | 21 | { |
23 | 22 | $this->secure_root.= '/'; |
24 | 23 | } |