@@ -50,15 +50,15 @@ public function edit($req, $res, $args)
5050 {
5151 Container::get ('hooks ' )->fire ('controller.admin.forums.edit ' );
5252
53- if (Request::isPost ()) {
53+ if (Request::isPost ()) {
5454 if (Input::post ('save ' ) && Input::post ('read_forum_old ' )) {
5555
5656 // Forums parameters / TODO : better handling of wrong parameters
5757 $ forum_data = ['forum_name ' => Utils::escape (Input::post ('forum_name ' )),
58- 'forum_desc ' => Input::post ('forum_desc ' ) ? Utils::linebreaks (Utils::trim (Input::post ('forum_desc ' ))) : NULL ,
58+ 'forum_desc ' => Input::post ('forum_desc ' ) ? Utils::linebreaks (Utils::trim (Input::post ('forum_desc ' ))) : null ,
5959 'cat_id ' => (int ) Input::post ('cat_id ' ),
6060 'sort_by ' => (int ) Input::post ('sort_by ' ),
61- 'redirect_url ' => Url::is_valid (Input::post ('redirect_url ' )) ? Utils::escape (Input::post ('redirect_url ' )) : NULL ];
61+ 'redirect_url ' => Url::is_valid (Input::post ('redirect_url ' )) ? Utils::escape (Input::post ('redirect_url ' )) : null ];
6262
6363 if ($ forum_data ['forum_name ' ] == '' ) {
6464 return Router::redirect (Router::pathFor ('editForum ' , ['id ' => $ args ['id ' ]]), __ ('Must enter name message ' ));
@@ -71,13 +71,12 @@ public function edit($req, $res, $args)
7171
7272 // Permissions
7373 $ permissions = $ this ->model ->get_default_group_permissions (false );
74- foreach ($ permissions as $ perm_group ) {
74+ foreach ($ permissions as $ perm_group ) {
7575 $ permissions_data = ['group_id ' => $ perm_group ['g_id ' ],
7676 'forum_id ' => $ args ['id ' ]];
7777 if ($ perm_group ['board.read ' ] == '1 ' && isset (Input::post ('read_forum_new ' )[$ perm_group ['g_id ' ]]) && Input::post ('read_forum_new ' )[$ perm_group ['g_id ' ]] == '1 ' ) {
7878 $ permissions_data ['read_forum ' ] = '1 ' ;
79- }
80- else {
79+ } else {
8180 $ permissions_data ['read_forum ' ] = '0 ' ;
8281 }
8382
@@ -87,11 +86,11 @@ public function edit($req, $res, $args)
8786 if ($ permissions_data ['read_forum ' ] != Input::post ('read_forum_old ' )[$ perm_group ['g_id ' ]] ||
8887 $ permissions_data ['post_replies ' ] != Input::post ('post_replies_old ' )[$ perm_group ['g_id ' ]] ||
8988 $ permissions_data ['post_topics ' ] != Input::post ('post_topics_old ' )[$ perm_group ['g_id ' ]]) {
90- // If there is no group permissions override for this forum
89+ // If there is no group permissions override for this forum
9190 if ($ permissions_data ['read_forum ' ] == '1 ' && $ permissions_data ['post_replies ' ] == $ perm_group ['topic.reply ' ] && $ permissions_data ['post_topics ' ] == $ perm_group ['topic.post ' ]) {
9291 $ this ->model ->delete_permissions ($ args ['id ' ], $ perm_group ['g_id ' ]);
9392 } else {
94- // Run an UPDATE and see if it affected a row, if not, INSERT
93+ // Run an UPDATE and see if it affected a row, if not, INSERT
9594 $ this ->model ->update_permissions ($ permissions_data );
9695 }
9796 }
@@ -101,7 +100,6 @@ public function edit($req, $res, $args)
101100 Container::get ('cache ' )->store ('quickjump ' , Cache::get_quickjump ());
102101
103102 return Router::redirect (Router::pathFor ('editForum ' , ['id ' => $ args ['id ' ]]), __ ('Forum updated redirect ' ));
104-
105103 } elseif (Input::post ('revert_perms ' )) {
106104 $ this ->model ->delete_permissions ($ args ['id ' ]);
107105
@@ -110,7 +108,6 @@ public function edit($req, $res, $args)
110108
111109 return Router::redirect (Router::pathFor ('editForum ' , ['id ' => $ args ['id ' ]]), __ ('Perms reverted redirect ' ));
112110 }
113-
114111 } else {
115112 AdminUtils::generateAdminMenu ('forums ' );
116113
@@ -136,13 +133,12 @@ public function delete($req, $res, $args)
136133 return $ notFoundHandler ($ req , $ res );
137134 }
138135
139- if (Request::isPost ()) {
136+ if (Request::isPost ()) {
140137 $ this ->model ->delete_forum ($ args ['id ' ]);
141138 // Regenerate the quick jump cache
142139 Container::get ('cache ' )->store ('quickjump ' , Cache::get_quickjump ());
143140
144141 return Router::redirect (Router::pathFor ('adminForums ' ), __ ('Forum deleted redirect ' ));
145-
146142 } else { // If the user hasn't confirmed
147143
148144 AdminUtils::generateAdminMenu ('forums ' );
0 commit comments