@@ -64,17 +64,14 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if($id){ |
| 66 | 66 | $this->menuService->updateMenuItem($data, $id); |
| 67 | - } |
|
| 68 | - else{ |
|
| 67 | + } else{ |
|
| 69 | 68 | $this->menuService->addMenuItem($data); |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.menu')); |
| 73 | - } |
|
| 74 | - catch(FilterException $fe){ |
|
| 72 | + } catch(FilterException $fe){ |
|
| 75 | 73 | return $this->edit($fe->getArrayMessages()); |
| 76 | - } |
|
| 77 | - catch(\Exception $e){ |
|
| 74 | + } catch(\Exception $e){ |
|
| 78 | 75 | throw $e; |
| 79 | 76 | } |
| 80 | 77 | } |
@@ -86,8 +83,7 @@ discard block |
||
| 86 | 83 | $this->menuService->delete($id); |
| 87 | 84 | |
| 88 | 85 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.menu')); |
| 89 | - } |
|
| 90 | - catch(\Exception $e){ |
|
| 86 | + } catch(\Exception $e){ |
|
| 91 | 87 | throw $e; |
| 92 | 88 | } |
| 93 | 89 | } |
@@ -75,17 +75,14 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | if($pageId) { |
| 77 | 77 | $this->pageService->updatePage($data, $pageId); |
| 78 | - } |
|
| 79 | - else { |
|
| 78 | + } else { |
|
| 80 | 79 | $this->pageService->createPage($data); |
| 81 | 80 | } |
| 82 | 81 | |
| 83 | 82 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
| 84 | - } |
|
| 85 | - catch(FilterException $fe) { |
|
| 83 | + } catch(FilterException $fe) { |
|
| 86 | 84 | return $this->edit($fe->getArrayMessages()); |
| 87 | - } |
|
| 88 | - catch(\Exception $e) { |
|
| 85 | + } catch(\Exception $e) { |
|
| 89 | 86 | throw $e; |
| 90 | 87 | } |
| 91 | 88 | } |
@@ -97,8 +94,7 @@ discard block |
||
| 97 | 94 | $this->pageService->delete($pageId); |
| 98 | 95 | |
| 99 | 96 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
| 100 | - } |
|
| 101 | - catch(\Exception $e) { |
|
| 97 | + } catch(\Exception $e) { |
|
| 102 | 98 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.pages')); |
| 103 | 99 | } |
| 104 | 100 | } |
@@ -17,13 +17,16 @@ discard block |
||
| 17 | 17 | <span class="glyphicon glyphicon-chevron-left"></span> |
| 18 | 18 | </a> |
| 19 | 19 | </li> |
| 20 | - <?php else: ?> |
|
| 20 | + <?php else { |
|
| 21 | + : ?> |
|
| 21 | 22 | <li class="disabled"> |
| 22 | 23 | <a href="#"> |
| 23 | 24 | <span class="glyphicon glyphicon-chevron-left"></span> |
| 24 | 25 | </a> |
| 25 | 26 | </li> |
| 26 | - <?php endif; ?> |
|
| 27 | + <?php endif; |
|
| 28 | +} |
|
| 29 | +?> |
|
| 27 | 30 | |
| 28 | 31 | <!-- Numbered page links --> |
| 29 | 32 | <?php foreach($this->pagesInRange as $page): ?> |
@@ -33,9 +36,12 @@ discard block |
||
| 33 | 36 | <?php echo $page; ?> |
| 34 | 37 | </a> |
| 35 | 38 | </li> |
| 36 | - <?php else: ?> |
|
| 39 | + <?php else { |
|
| 40 | + : ?> |
|
| 37 | 41 | <li class="active"> |
| 38 | - <a href="#"><?php echo $page; ?></a> |
|
| 42 | + <a href="#"><?php echo $page; |
|
| 43 | +} |
|
| 44 | +?></a> |
|
| 39 | 45 | </li> |
| 40 | 46 | <?php endif; ?> |
| 41 | 47 | <?php endforeach; ?> |
@@ -47,13 +53,16 @@ discard block |
||
| 47 | 53 | <span class="glyphicon glyphicon-chevron-right"></span> |
| 48 | 54 | </a> |
| 49 | 55 | </li> |
| 50 | - <?php else: ?> |
|
| 56 | + <?php else { |
|
| 57 | + : ?> |
|
| 51 | 58 | <li class="disabled"> |
| 52 | 59 | <a href="#"> |
| 53 | 60 | <span class="glyphicon glyphicon-chevron-right"></span> |
| 54 | 61 | </a> |
| 55 | 62 | </li> |
| 56 | - <?php endif; ?> |
|
| 63 | + <?php endif; |
|
| 64 | +} |
|
| 65 | +?> |
|
| 57 | 66 | </ul> |
| 58 | 67 | </div> |
| 59 | 68 | <?php endif; ?> |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | $this->session->getStorage()->user = $this->adminUserService->loginUser($email, $password); |
| 87 | 87 | |
| 88 | 88 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin')); |
| 89 | - } |
|
| 90 | - catch(\Exception $e) { |
|
| 89 | + } catch(\Exception $e) { |
|
| 91 | 90 | return $this->login($e->getMessage()); |
| 92 | 91 | |
| 93 | 92 | //@todo set $e->getMessage() to flash messanger and print messages in next page |
@@ -103,17 +103,14 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | if($userId) { |
| 105 | 105 | $this->adminUserService->updateUser($data, $userId); |
| 106 | - } |
|
| 107 | - else { |
|
| 106 | + } else { |
|
| 108 | 107 | $this->adminUserService->registerNewUser($data); |
| 109 | 108 | } |
| 110 | 109 | |
| 111 | 110 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 112 | - } |
|
| 113 | - catch(FilterException $fe) { |
|
| 111 | + } catch(FilterException $fe) { |
|
| 114 | 112 | return $this->edit($fe->getArrayMessages()); |
| 115 | - } |
|
| 116 | - catch(\Exception $e) { |
|
| 113 | + } catch(\Exception $e) { |
|
| 117 | 114 | throw $e; |
| 118 | 115 | } |
| 119 | 116 | } |
@@ -125,8 +122,7 @@ discard block |
||
| 125 | 122 | $this->adminUserService->delete($userId); |
| 126 | 123 | |
| 127 | 124 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 128 | - } |
|
| 129 | - catch(\Exception $e) { |
|
| 125 | + } catch(\Exception $e) { |
|
| 130 | 126 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.users')); |
| 131 | 127 | } |
| 132 | 128 | } |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | // We don't want to force user to re-upload image on edit |
| 116 | 116 | if (!$data['main_img']) { |
| 117 | 117 | unset($data['main_img']); |
| 118 | - } |
|
| 119 | - else { |
|
| 118 | + } else { |
|
| 120 | 119 | $this->upload->deleteFile($page->getMainImg()); |
| 121 | 120 | } |
| 122 | 121 | |
@@ -167,15 +167,13 @@ |
||
| 167 | 167 | // We don't want to force user to re-upload image on edit |
| 168 | 168 | if(!$data['face_img']) { |
| 169 | 169 | unset($data['face_img']); |
| 170 | - } |
|
| 171 | - else{ |
|
| 170 | + } else{ |
|
| 172 | 171 | $this->upload->deleteFile($user->face_img); |
| 173 | 172 | } |
| 174 | 173 | |
| 175 | 174 | if(!$data['profile_img']) { |
| 176 | 175 | unset($data['profile_img']); |
| 177 | - } |
|
| 178 | - else{ |
|
| 176 | + } else{ |
|
| 179 | 177 | $this->upload->deleteFile($user->profile_img); |
| 180 | 178 | } |
| 181 | 179 | |
@@ -128,8 +128,7 @@ |
||
| 128 | 128 | // We don't want to force user to re-upload image on edit |
| 129 | 129 | if(!$values['main_img']) { |
| 130 | 130 | unset($values['main_img']); |
| 131 | - } |
|
| 132 | - else{ |
|
| 131 | + } else{ |
|
| 133 | 132 | $this->upload->deleteFile($oldCategory->main_img); |
| 134 | 133 | } |
| 135 | 134 | |
@@ -139,15 +139,13 @@ |
||
| 139 | 139 | // We don't want to force user to re-upload image on edit |
| 140 | 140 | if (!$event['featured_img']) { |
| 141 | 141 | unset($event['featured_img']); |
| 142 | - } |
|
| 143 | - else { |
|
| 142 | + } else { |
|
| 144 | 143 | $this->upload->deleteFile($oldArticle->featured_img); |
| 145 | 144 | } |
| 146 | 145 | |
| 147 | 146 | if (!$event['main_img']) { |
| 148 | 147 | unset($event['main_img']); |
| 149 | - } |
|
| 150 | - else { |
|
| 148 | + } else { |
|
| 151 | 149 | $this->upload->deleteFile($oldArticle->main_img); |
| 152 | 150 | } |
| 153 | 151 | |