@@ -229,18 +229,23 @@ public function moderate($req, $res, $args)
229229 $ start_from = Container::get ('user ' )->disp_posts * ($ p - 1 );
230230
231231 // Delete one or more posts
232- if (Input::post ('delete_posts ' ) || Input::post ('delete_posts_comply ' )) {
233- $ posts = $ this ->model ->delete_posts ($ args ['id ' ], $ args ['fid ' ]);
234-
235- View::setPageInfo (array (
236- 'title ' => array (Utils::escape (ForumSettings::get ('o_board_title ' )), __ ('Moderate ' )),
237- 'active_page ' => 'moderate ' ,
238- 'posts ' => $ posts ,
239- )
240- )->addTemplate ('moderate/delete_posts.php ' )->display ();
232+ if (Input::post ('delete_posts_comply ' )) {
233+ return $ this ->model ->delete_posts ($ args ['id ' ], $ args ['fid ' ]);
241234 }
242- if (Input::post ('split_posts ' ) || Input::post ('split_posts_comply ' )) {
243-
235+ else if (Input::post ('delete_posts ' )) {
236+ $ posts = $ this ->model ->delete_posts ($ args ['id ' ], $ args ['fid ' ]);
237+
238+ View::setPageInfo (array (
239+ 'title ' => array (Utils::escape (ForumSettings::get ('o_board_title ' )), __ ('Moderate ' )),
240+ 'active_page ' => 'moderate ' ,
241+ 'posts ' => $ posts ,
242+ )
243+ )->addTemplate ('moderate/delete_posts.php ' )->display ();
244+ }
245+ else if (Input::post ('split_posts_comply ' )) {
246+ return $ this ->model ->split_posts ($ args ['id ' ], $ args ['fid ' ], $ p );
247+ }
248+ else if (Input::post ('split_posts ' )) {
244249 View::setPageInfo (array (
245250 'title ' => array (Utils::escape (ForumSettings::get ('o_board_title ' )), __ ('Moderate ' )),
246251 'focus_element ' => array ('subject ' ,'new_subject ' ),
@@ -251,37 +256,37 @@ public function moderate($req, $res, $args)
251256 'list_forums ' => $ this ->model ->get_forum_list_split ($ args ['fid ' ]),
252257 )
253258 )->addTemplate ('moderate/split_posts.php ' )->display ();
254-
255259 }
260+ else {
261+ // Show the moderate posts view
256262
257- // Show the moderate posts view
263+ // Used to disable the Move and Delete buttons if there are no replies to this topic
264+ $ button_status = ($ cur_topic ['num_replies ' ] == 0 ) ? ' disabled="disabled" ' : '' ;
258265
259- // Used to disable the Move and Delete buttons if there are no replies to this topic
260- $ button_status = ($ cur_topic ['num_replies ' ] == 0 ) ? ' disabled="disabled" ' : '' ;
266+ /*if (isset($_GET['action']) && $_GET['action'] == 'all') {
267+ Container::get('user')->disp_posts = $cur_topic['num_replies'] + 1;
268+ }*/
261269
262- /* if (isset($_GET['action']) && $_GET['action'] == 'all ') {
263- Container::get('user')->disp_posts = $cur_topic['num_replies'] + 1 ;
264- }*/
270+ if (ForumSettings:: get ( ' o_censoring ' ) == '1 ' ) {
271+ $ cur_topic [ ' subject ' ] = Utils:: censor ( $ cur_topic ['subject ' ]) ;
272+ }
265273
266- if (ForumSettings::get ('o_censoring ' ) == '1 ' ) {
267- $ cur_topic ['subject ' ] = Utils::censor ($ cur_topic ['subject ' ]);
274+ View::setPageInfo (array (
275+ 'title ' => array (Utils::escape (ForumSettings::get ('o_board_title ' )), Utils::escape ($ cur_topic ['forum_name ' ]), Utils::escape ($ cur_topic ['subject ' ])),
276+ 'page ' => $ p ,
277+ 'active_page ' => 'moderate ' ,
278+ 'cur_topic ' => $ cur_topic ,
279+ 'url_topic ' => Url::url_friendly ($ cur_topic ['subject ' ]),
280+ 'url_forum ' => Url::url_friendly ($ cur_topic ['forum_name ' ]),
281+ 'fid ' => $ args ['fid ' ],
282+ 'id ' => $ args ['id ' ],
283+ 'paging_links ' => '<span class="pages-label"> ' . __ ('Pages ' ) . ' </span> ' . Url::paginate ($ num_pages , $ p , 'moderate/topic/ ' . $ args ['id ' ] . '/forum/ ' . $ args ['fid ' ] . '/action/moderate/# ' ),
284+ 'post_data ' => $ this ->model ->display_posts_moderate ($ args ['id ' ], $ start_from ),
285+ 'button_status ' => $ button_status ,
286+ 'start_from ' => $ start_from ,
287+ )
288+ )->addTemplate ('moderate/posts_view.php ' )->display ();
268289 }
269-
270- View::setPageInfo (array (
271- 'title ' => array (Utils::escape (ForumSettings::get ('o_board_title ' )), Utils::escape ($ cur_topic ['forum_name ' ]), Utils::escape ($ cur_topic ['subject ' ])),
272- 'page ' => $ p ,
273- 'active_page ' => 'moderate ' ,
274- 'cur_topic ' => $ cur_topic ,
275- 'url_topic ' => Url::url_friendly ($ cur_topic ['subject ' ]),
276- 'url_forum ' => Url::url_friendly ($ cur_topic ['forum_name ' ]),
277- 'fid ' => $ args ['fid ' ],
278- 'id ' => $ args ['id ' ],
279- 'paging_links ' => '<span class="pages-label"> ' .__ ('Pages ' ).' </span> ' .Url::paginate ($ num_pages , $ p , 'moderate/topic/ ' .$ args ['id ' ].'/forum/ ' .$ args ['fid ' ].'/action/moderate/# ' ),
280- 'post_data ' => $ this ->model ->display_posts_moderate ($ args ['id ' ], $ start_from ),
281- 'button_status ' => $ button_status ,
282- 'start_from ' => $ start_from ,
283- )
284- )->addTemplate ('moderate/posts_view.php ' )->display ();
285290 }
286291
287292 public function action ($ req , $ res , $ args )
0 commit comments