@@ -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 | } |