@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | use Core\Container; |
9 | 9 | use Twig\Error\Error; |
10 | 10 | |
11 | -class Category extends AdminController{ |
|
11 | +class Category extends AdminController { |
|
12 | 12 | |
13 | 13 | protected $siteConfig; |
14 | 14 | protected $pagination; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $totalCategories = $this->categoryModel->countCategories(); |
49 | 49 | $pagination = $this->pagination->getPagination($page, $totalCategories, $linesPerPage); |
50 | 50 | |
51 | - if($linesPerPage !== $defaultLinesPerPage){ |
|
51 | + if ($linesPerPage !== $defaultLinesPerPage) { |
|
52 | 52 | $this->data['paginationPostsPerPage'] = $linesPerPage; |
53 | 53 | } |
54 | 54 | |
@@ -76,21 +76,21 @@ discard block |
||
76 | 76 | $categorySlug = $category["categories_slug"]; |
77 | 77 | |
78 | 78 | //Sanity check on ID |
79 | - if($categoryId == null ) |
|
79 | + if ($categoryId == null) |
|
80 | 80 | { |
81 | 81 | throw new \ErrorException("invalid category ID"); |
82 | 82 | } |
83 | 83 | |
84 | - $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories","categories_slug"); |
|
84 | + $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories", "categories_slug"); |
|
85 | 85 | |
86 | 86 | //Error checking |
87 | 87 | $error = false; |
88 | - if($categoryName == "") |
|
88 | + if ($categoryName == "") |
|
89 | 89 | { |
90 | 90 | $error = true; |
91 | 91 | $this->alertBox->setAlert("empty name not allowed", "error"); |
92 | 92 | } |
93 | - if($categorySlug == "") |
|
93 | + if ($categorySlug == "") |
|
94 | 94 | { |
95 | 95 | $error = true; |
96 | 96 | $this->alertBox->setAlert("empty slug not allowed", "error"); |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | |
109 | 109 | //checking result and redirecting |
110 | 110 | if ($categoryUpdate) { |
111 | - $this->alertBox->setAlert("Category " . $categoryName . " updated"); |
|
111 | + $this->alertBox->setAlert("Category ".$categoryName." updated"); |
|
112 | 112 | $this->container->getResponse()->redirect("/admin/category/list/"); |
113 | 113 | } |
114 | - $this->alertBox->setAlert("Error updating " . $categoryName, "error"); |
|
114 | + $this->alertBox->setAlert("Error updating ".$categoryName, "error"); |
|
115 | 115 | $this->container->getResponse()->redirect("/admin/category/list/"); |
116 | 116 | } |
117 | 117 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | $removedCategory = $this->categoryModel->delete($categoryId); |
129 | 129 | |
130 | - if($removedCategory) |
|
130 | + if ($removedCategory) |
|
131 | 131 | { |
132 | 132 | $this->alertBox->setAlert("Category ".$categoryName." deleted"); |
133 | 133 | } |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | |
154 | 154 | //Error checking |
155 | 155 | $error = false; |
156 | - if($categoryName == "") |
|
156 | + if ($categoryName == "") |
|
157 | 157 | { |
158 | 158 | $error = true; |
159 | 159 | $this->alertBox->setAlert("empty name not allowed", "error"); |
160 | 160 | } |
161 | - if($categorySlug == "") |
|
161 | + if ($categorySlug == "") |
|
162 | 162 | { |
163 | 163 | $error = true; |
164 | 164 | $this->alertBox->setAlert("empty slug not allowed", "error"); |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | |
177 | 177 | //checking result and redirecting |
178 | 178 | if ($categoryNew) { |
179 | - $this->alertBox->setAlert("Category " . $categoryName . " created"); |
|
179 | + $this->alertBox->setAlert("Category ".$categoryName." created"); |
|
180 | 180 | $this->container->getResponse()->redirect("/admin/category/list/"); |
181 | 181 | } |
182 | - $this->alertBox->setAlert("Error creating " . $categoryName, "error"); |
|
182 | + $this->alertBox->setAlert("Error creating ".$categoryName, "error"); |
|
183 | 183 | $this->container->getResponse()->redirect("/admin/category/list/"); |
184 | 184 | } |
185 | 185 | } |
186 | 186 | \ No newline at end of file |
@@ -23,5 +23,5 @@ |
||
23 | 23 | const POSTS_PER_PAGE = 4; |
24 | 24 | const LIST_PER_PAGE = 10; |
25 | 25 | |
26 | - const EXCERPT_WORD_COUNT =50; |
|
26 | + const EXCERPT_WORD_COUNT = 50; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |