@@ -45,11 +45,10 @@ public function post()
4545 include $ this ->root_path . 'includes/functions_display. ' . $ this ->php_ext ;
4646 }
4747
48- $ mode = $ this ->request ->variable ('mode ' , '' );
4948 $ title = $ this ->request ->variable ('title ' , '' , true );
5049 $ message = $ this ->request ->variable ('message ' , '' , true );
5150
52- if ($ mode === ' submit ' )
51+ if ($ this -> request -> is_set_post ( ' post ' ) )
5352 {
5453 $ submit = $ this ->ideas ->submit ($ title , $ message , $ this ->user ->data ['user_id ' ]);
5554
@@ -71,6 +70,17 @@ public function post()
7170 }
7271 }
7372
73+ if ($ this ->request ->is_set_post ('preview ' ))
74+ {
75+ $ preview_message = $ this ->ideas ->preview ($ message );
76+
77+ $ this ->template ->assign_vars (array (
78+ 'S_DISPLAY_PREVIEW ' => !empty ($ preview_message ),
79+ 'PREVIEW_SUBJECT ' => $ title ,
80+ 'PREVIEW_MESSAGE ' => $ preview_message ,
81+ ));
82+ }
83+
7484 display_custom_bbcodes ();
7585 generate_smilies ('inline ' , 0 );
7686
@@ -83,8 +93,9 @@ public function post()
8393
8494 $ this ->template ->assign_vars (array (
8595 'TITLE ' => $ title ,
96+ 'MESSAGE ' => $ message ,
8697
87- 'S_POST_ACTION ' => $ this ->helper ->route ('phpbb_ideas_post_controller ' , array ( ' mode ' => ' submit ' ) ),
98+ 'S_POST_ACTION ' => $ this ->helper ->route ('phpbb_ideas_post_controller ' ),
8899 'S_BBCODE_ALLOWED ' => $ bbcode_status ,
89100 'S_SMILIES_ALLOWED ' => $ smilies_status ,
90101 'S_LINKS_ALLOWED ' => $ url_status ,
0 commit comments