@@ -167,60 +167,29 @@ function form_actions() {
167167 }
168168
169169 if (cacti_sizeof ($ removal_array )) {
170- if (get_request_var ('drp_action ' ) == '1 ' ) { /* delete */
171- print "<tr>
172- <td class='textArea'>
173- <p> " . __ ('Click \'Continue \' to Delete the following Syslog Removal Rule(s). ' , 'syslog ' ) . "</p>
174- <div class='itemlist'><ul> $ removal_list</ul></div> " ;
175- print "</td></tr>
176- </td>
177- </tr> \n" ;
178-
179- $ title = __esc ('Delete Syslog Removal Rule(s) ' , 'syslog ' );
180- } else if (get_request_var ('drp_action ' ) == '2 ' ) { /* disable */
181- print "<tr>
182- <td class='textArea'>
183- <p> " . __ ('Click \'Continue \' to Disable the following Syslog Removal Rule(s). ' , 'syslog ' ) . "</p>
184- <div class='itemlist'><ul> $ removal_list</ul></div> " ;
185- print "</td></tr>
186- </td>
187- </tr> \n" ;
188-
189- $ title = __esc ('Disable Syslog Removal Rule(s) ' , 'syslog ' );
190- } else if (get_request_var ('drp_action ' ) == '3 ' ) { /* enable */
191- print "<tr>
192- <td class='textArea'>
193- <p> " . __ ('Click \'Continue \' to Enable the following Syslog Removal Rule(s). ' , 'syslog ' ) . "</p>
194- <div class='itemlist'><ul> $ removal_list</ul></div> " ;
195- print "</td></tr>
196- </td>
197- </tr> \n" ;
198-
199- $ title = __esc ('Enable Syslog Removal Rule(s) ' , 'syslog ' );
200- } else if (get_request_var ('drp_action ' ) == '4 ' ) { /* reprocess */
201- print "<tr>
202- <td class='textArea'>
203- <p> " . __ ('Click \'Continue \' to Re-process the following Syslog Removal Rule(s). ' , 'syslog ' ) . "</p>
204- <div class='itemlist'><ul> $ removal_list</ul></div> " ;
205- print "</td></tr>
206- </td>
207- </tr> \n" ;
208-
209- $ title = __esc ('Retroactively Process Syslog Removal Rule(s) ' , 'syslog ' );
210- } elseif (get_request_var ('drp_action ' ) == '5 ' ) { /* export */
211- print "<tr>
212- <td class='textArea'>
213- <p> " . __ ('Click \'Continue \' to Export the following Syslog Removal Rule(s). ' , 'syslog ' ) . "</p>
214- <div class='itemlist'><ul> $ removal_list</ul></div> " ;
215- print "</td></tr>
216- </td>
217- </tr> \n" ;
218-
219- $ title = __esc ('Export Syslog Removal Rule(s) ' , 'syslog ' );
220- }
170+ $ action_verbs = array (
171+ '1 ' => __ ('Delete ' , 'syslog ' ),
172+ '2 ' => __ ('Disable ' , 'syslog ' ),
173+ '3 ' => __ ('Enable ' , 'syslog ' ),
174+ '4 ' => __ ('Re-process ' , 'syslog ' ),
175+ '5 ' => __ ('Export ' , 'syslog ' )
176+ );
221177
222- $ save_html = "<input type='button' value=' " . __esc ('Cancel ' , 'syslog ' ) . "' onClick='cactiReturnTo()'> <input type='submit' value=' " . __esc ('Continue ' , 'syslog ' ) . "' title=' $ title' " ;
178+ syslog_draw_bulk_action_confirm (get_request_var ('drp_action ' ), $ removal_list , __ ('Syslog Removal Rule(s) ' , 'syslog ' ), $ action_verbs );
179+
180+ $ titles = array (
181+ '1 ' => __ ('Delete Syslog Removal Rule(s) ' , 'syslog ' ),
182+ '2 ' => __ ('Disable Syslog Removal Rule(s) ' , 'syslog ' ),
183+ '3 ' => __ ('Enable Syslog Removal Rule(s) ' , 'syslog ' ),
184+ '4 ' => __ ('Retroactively Process Syslog Removal Rule(s) ' , 'syslog ' ),
185+ '5 ' => __ ('Export Syslog Removal Rule(s) ' , 'syslog ' )
186+ );
187+
188+ $ title = $ titles [get_request_var ('drp_action ' )] ?? '' ;
189+
190+ $ save_html = "<input type='button' value=' " . __esc ('Cancel ' , 'syslog ' ) . "' onClick='cactiReturnTo()'> <input type='submit' value=' " . __esc ('Continue ' , 'syslog ' ) . "' title=' $ title'> " ;
223191 } else {
192+
224193 raise_message (40 );
225194 header ('Location: syslog_removal.php?header=false ' );
226195 exit ;
0 commit comments