@@ -390,10 +390,11 @@ protected function move()
390390 public function approve ()
391391 {
392392 $ public_notes = $ this ->request ->variable ('public_notes ' , '' , true );
393+ $ post_as_robot = $ this ->request ->variable ('post_as_robot ' , 1 );
393394
394395 if ($ this ->validate ('approve ' ))
395396 {
396- $ robot_user_id = $ this ->contrib ->type ->forum_robot ;
397+ $ robot_user_id = $ post_as_robot ? $ this ->contrib ->type ->forum_robot : 0 ;
397398 $ this ->queue ->approve ($ public_notes , $ robot_user_id );
398399
399400 // Reload contribution with new data.
@@ -432,9 +433,11 @@ public function approve()
432433 */
433434 public function deny ()
434435 {
436+ $ post_as_robot = $ this ->request ->variable ('post_as_robot ' , 1 );
437+
435438 if ($ this ->validate ('deny ' ))
436439 {
437- $ robot_user_id = $ this ->contrib ->type ->forum_robot ;
440+ $ robot_user_id = $ post_as_robot ? $ this ->contrib ->type ->forum_robot : 0 ;
438441 $ this ->queue ->deny ($ robot_user_id );
439442 $ this ->contrib ->type ->deny ($ this ->contrib , $ this ->queue , $ this ->request );
440443 redirect ($ this ->queue ->get_url ());
@@ -476,12 +479,19 @@ protected function validate($action)
476479 $ this ->contrib ->type ->display_validation_options ($ action , $ this ->request , $ this ->template );
477480 $ this ->display_topic_review ();
478481
482+ $ post_as_robot = $ this ->request ->variable ('post_as_robot ' , 1 );
483+ $ has_robot = !empty ($ this ->contrib ->type ->forum_robot );
484+
479485 $ this ->template ->assign_vars (array (
480486 'ERROR ' => implode ('<br /> ' , $ error ),
481487 'L_TOPIC_REVIEW ' => $ this ->user ->lang ['QUEUE_REVIEW ' ],
482488 'TOPIC_TITLE ' => $ this ->contrib ->contrib_name ,
483489 'PAGE_TITLE_EXPLAIN ' => $ this ->user ->lang [strtoupper ($ action ) . '_QUEUE_CONFIRM ' ],
484490 'S_CONFIRM_ACTION ' => $ this ->queue ->get_url ($ action ),
491+ 'S_SHOW_POST_AS_OPTION ' => $ has_robot ,
492+ 'POST_AS_ROBOT ' => $ post_as_robot ,
493+ 'POST_AS_LABEL ' => $ this ->user ->lang ['POST_AS_ ' . strtoupper ($ action )],
494+ 'ROBOT_NAME ' => ucfirst ($ this ->contrib ->type ->name ),
485495 ));
486496
487497 return false ;
0 commit comments