@@ -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 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | use Core\Constant; |
9 | 9 | use Core\Container; |
10 | 10 | |
11 | -class Category extends AdminController{ |
|
11 | +class Category extends AdminController { |
|
12 | 12 | |
13 | 13 | protected $siteConfig; |
14 | 14 | protected $pagination; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $totalCategories = $this->categoryModel->countCategories(); |
48 | 48 | $pagination = $this->pagination->getPagination($page, $totalCategories, $linesPerPage); |
49 | 49 | |
50 | - if($linesPerPage !== Constant::LIST_PER_PAGE){ |
|
50 | + if ($linesPerPage !== Constant::LIST_PER_PAGE) { |
|
51 | 51 | $this->data['paginationPostsPerPage'] = $linesPerPage; |
52 | 52 | } |
53 | 53 | |
@@ -75,21 +75,21 @@ discard block |
||
75 | 75 | $categorySlug = $category["categories_slug"]; |
76 | 76 | |
77 | 77 | //Sanity check on ID |
78 | - if($categoryId == null ) |
|
78 | + if ($categoryId == null) |
|
79 | 79 | { |
80 | 80 | throw new \ErrorException("invalid category ID"); |
81 | 81 | } |
82 | 82 | |
83 | - $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories","categories_slug"); |
|
83 | + $originalCategorySlug = $this->slugModel->getSlugFromId($categoryId, "categories", "idcategories", "categories_slug"); |
|
84 | 84 | |
85 | 85 | //Error checking |
86 | 86 | $error = false; |
87 | - if($categoryName == "") |
|
87 | + if ($categoryName == "") |
|
88 | 88 | { |
89 | 89 | $error = true; |
90 | 90 | $this->alertBox->setAlert("empty name not allowed", "error"); |
91 | 91 | } |
92 | - if($categorySlug == "") |
|
92 | + if ($categorySlug == "") |
|
93 | 93 | { |
94 | 94 | $error = true; |
95 | 95 | $this->alertBox->setAlert("empty slug not allowed", "error"); |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | |
108 | 108 | //checking result and redirecting |
109 | 109 | if ($categoryUpdate) { |
110 | - $this->alertBox->setAlert("Category " . $categoryName . " updated"); |
|
110 | + $this->alertBox->setAlert("Category ".$categoryName." updated"); |
|
111 | 111 | $this->container->getResponse()->redirect("/admin/category/list/"); |
112 | 112 | } |
113 | - $this->alertBox->setAlert("Error updating " . $categoryName, "error"); |
|
113 | + $this->alertBox->setAlert("Error updating ".$categoryName, "error"); |
|
114 | 114 | $this->container->getResponse()->redirect("/admin/category/list/"); |
115 | 115 | } |
116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $removedCategory = $this->categoryModel->delete($categoryId); |
128 | 128 | |
129 | - if($removedCategory) |
|
129 | + if ($removedCategory) |
|
130 | 130 | { |
131 | 131 | $this->alertBox->setAlert("Category ".$categoryName." deleted"); |
132 | 132 | } |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | |
153 | 153 | //Error checking |
154 | 154 | $error = false; |
155 | - if($categoryName == "") |
|
155 | + if ($categoryName == "") |
|
156 | 156 | { |
157 | 157 | $error = true; |
158 | 158 | $this->alertBox->setAlert("empty name not allowed", "error"); |
159 | 159 | } |
160 | - if($categorySlug == "") |
|
160 | + if ($categorySlug == "") |
|
161 | 161 | { |
162 | 162 | $error = true; |
163 | 163 | $this->alertBox->setAlert("empty slug not allowed", "error"); |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | |
176 | 176 | //checking result and redirecting |
177 | 177 | if ($categoryNew) { |
178 | - $this->alertBox->setAlert("Category " . $categoryName . " created"); |
|
178 | + $this->alertBox->setAlert("Category ".$categoryName." created"); |
|
179 | 179 | $this->container->getResponse()->redirect("/admin/category/list/"); |
180 | 180 | } |
181 | - $this->alertBox->setAlert("Error creating " . $categoryName, "error"); |
|
181 | + $this->alertBox->setAlert("Error creating ".$categoryName, "error"); |
|
182 | 182 | $this->container->getResponse()->redirect("/admin/category/list/"); |
183 | 183 | } |
184 | 184 | } |
185 | 185 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use Core\Constant; |
8 | 8 | use Core\Container; |
9 | 9 | |
10 | -class Tag extends AdminController{ |
|
10 | +class Tag extends AdminController { |
|
11 | 11 | |
12 | 12 | protected $siteConfig; |
13 | 13 | protected $pagination; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $totalCategories = $this->tagModel->countTags(); |
33 | 33 | $pagination = $this->pagination->getPagination($page, $totalCategories, $linesPerPage); |
34 | 34 | |
35 | - if($linesPerPage !== Constant::LIST_PER_PAGE){ |
|
35 | + if ($linesPerPage !== Constant::LIST_PER_PAGE) { |
|
36 | 36 | $this->data['paginationPostsPerPage'] = $linesPerPage; |
37 | 37 | } |
38 | 38 | |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | //Sanity check on ID |
63 | - if($tagId == null ) |
|
63 | + if ($tagId == null) |
|
64 | 64 | { |
65 | 65 | throw new \ErrorException("invalid tag ID"); |
66 | 66 | } |
67 | 67 | |
68 | 68 | //Error checking |
69 | 69 | $error = false; |
70 | - if($tagName == "") |
|
70 | + if ($tagName == "") |
|
71 | 71 | { |
72 | 72 | $error = true; |
73 | 73 | $this->alertBox->setAlert("empty name not allowed", "error"); |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | //checking result and redirecting |
83 | 83 | if ($tagUpdate) { |
84 | - $this->alertBox->setAlert("Tag " . $tagName . " updated"); |
|
84 | + $this->alertBox->setAlert("Tag ".$tagName." updated"); |
|
85 | 85 | $this->response->redirect("/admin/tag/list/"); |
86 | 86 | } |
87 | - $this->alertBox->setAlert("Error updating " . $tagName, "error"); |
|
87 | + $this->alertBox->setAlert("Error updating ".$tagName, "error"); |
|
88 | 88 | $this->response->redirect("/admin/tag/list/"); |
89 | 89 | } |
90 | 90 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $removedTag = $this->tagModel->delete($tagId); |
102 | 102 | |
103 | - if($removedTag) |
|
103 | + if ($removedTag) |
|
104 | 104 | { |
105 | 105 | $this->alertBox->setAlert("Tag ".$tagName." deleted"); |
106 | 106 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | //Error checking |
127 | 127 | $error = false; |
128 | - if($tagName == "") |
|
128 | + if ($tagName == "") |
|
129 | 129 | { |
130 | 130 | $error = true; |
131 | 131 | $this->alertBox->setAlert("empty name not allowed", "error"); |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | |
140 | 140 | //checking result and redirecting |
141 | 141 | if ($tagNew) { |
142 | - $this->alertBox->setAlert("Tag " . $tagName . " created"); |
|
142 | + $this->alertBox->setAlert("Tag ".$tagName." created"); |
|
143 | 143 | $this->response->redirect("/admin/tag/list/"); |
144 | 144 | } |
145 | - $this->alertBox->setAlert("Error creating " . $tagName, "error"); |
|
145 | + $this->alertBox->setAlert("Error creating ".$tagName, "error"); |
|
146 | 146 | $this->response->redirect("/admin/tag/list/"); |
147 | 147 | } |
148 | 148 | } |
149 | 149 | \ No newline at end of file |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use App\Models\TagModel; |
6 | 6 | use Core\AjaxController; |
7 | 7 | |
8 | -class Tag extends AjaxController{ |
|
8 | +class Tag extends AjaxController { |
|
9 | 9 | |
10 | 10 | |
11 | 11 | /** |