Ticket #7957: 7957.diff
| File 7957.diff, 18.9 KB (added by , 18 years ago) |
|---|
-
wp-admin/categories.php
183 183 ?> 184 184 185 185 <div class="alignleft actions"> 186 <select name="action"> 187 <option value="" selected="selected"><?php _e('Actions'); ?></option> 188 <option value="delete"><?php _e('Delete'); ?></option> 189 </select> 190 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 186 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'categories'); ?> 191 187 <?php wp_nonce_field('bulk-categories'); ?> 192 188 </div> 193 189 … … 223 219 ?> 224 220 225 221 <div class="alignleft actions"> 226 <select name="action2"> 227 <option value="" selected="selected"><?php _e('Actions'); ?></option> 228 <option value="delete"><?php _e('Delete'); ?></option> 229 </select> 230 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 222 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'categories'); ?> 231 223 <?php wp_nonce_field('bulk-categories'); ?> 232 224 </div> 233 225 -
wp-admin/edit-comments.php
198 198 ?> 199 199 200 200 <div class="alignleft actions"> 201 <select name="action"> 202 <option value="-1" selected="selected"><?php _e('Actions') ?></option> 203 <?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> 204 <option value="unapprove"><?php _e('Unapprove'); ?></option> 205 <?php endif; ?> 206 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 207 <option value="approve"><?php _e('Approve'); ?></option> 208 <?php endif; ?> 209 <?php if ( 'spam' != $comment_status ): ?> 210 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 211 <?php endif; ?> 212 <option value="delete"><?php _e('Delete'); ?></option> 213 </select> 214 <input type="submit" name="doaction" id="doaction" value="<?php _e('Apply'); ?>" class="button-secondary apply" /> 201 <?php 202 $actions = array('-1' => __('Actions') ); 203 if ( empty($comment_status) || 'approved' == $comment_status ) 204 $actions['unapprove'] = __('Unapprove'); 205 if ( empty($comment_status) || 'moderated' == $comment_status ) 206 $actions['approve'] = __('Approve'); 207 if ( 'spam' != $comment_status ) 208 $actions['markspam'] = __('Mark as Spam'); 209 $actions['delete'] = __('Delete'); 210 211 print_table_actions( $actions, '-1', 'action', 'doaction', 'doaction', '', 'comments'); 212 ?> 215 213 <?php wp_nonce_field('bulk-comments'); ?> 216 214 217 215 <?php if ( $comment_status ) echo "<input type='hidden' name='comment_status' value='$comment_status' />\n"; ?> … … 284 282 ?> 285 283 286 284 <div class="alignleft actions"> 287 <select name="action2"> 288 <option value="-1" selected="selected"><?php _e('Actions') ?></option> 289 <?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> 290 <option value="unapprove"><?php _e('Unapprove'); ?></option> 291 <?php endif; ?> 292 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 293 <option value="approve"><?php _e('Approve'); ?></option> 294 <?php endif; ?> 295 <?php if ( 'spam' != $comment_status ): ?> 296 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 297 <?php endif; ?> 298 <option value="delete"><?php _e('Delete'); ?></option> 299 </select> 300 <input type="submit" name="doaction2" id="doaction2" value="<?php _e('Apply'); ?>" class="button-secondary apply" /> 301 285 <?php print_table_actions( $actions, '-1', 'action2', 'doaction2', 'doaction2', '', 'comments'); ?> 302 286 <?php if ( 'spam' == $comment_status ) { ?> 303 287 <input type="submit" name="delete_all_spam2" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 304 288 <?php } ?> -
wp-admin/edit-link-categories.php
112 112 ?> 113 113 114 114 <div class="alignleft actions"> 115 <select name="action"> 116 <option value="" selected="selected"><?php _e('Actions'); ?></option> 117 <option value="delete"><?php _e('Delete'); ?></option> 118 </select> 119 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 115 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'link_categories'); ?> 120 116 <?php wp_nonce_field('bulk-link-categories'); ?> 121 117 </div> 122 118 … … 168 164 ?> 169 165 170 166 <div class="alignleft actions"> 171 <select name="action2"> 172 <option value="" selected="selected"><?php _e('Actions'); ?></option> 173 <option value="delete"><?php _e('Delete'); ?></option> 174 </select> 175 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 167 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'link_categories'); ?> 176 168 </div> 177 169 178 170 <br class="clear" /> -
wp-admin/edit-pages.php
202 202 ?> 203 203 204 204 <div class="alignleft actions"> 205 <select name="action"> 206 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 207 <option value="edit"><?php _e('Edit'); ?></option> 208 <option value="delete"><?php _e('Delete'); ?></option> 209 </select> 210 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 205 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '-1', 'action', 'doaction', 'doaction', '', 'pages'); ?> 211 206 <?php wp_nonce_field('bulk-pages'); ?> 212 207 </div> 213 208 … … 247 242 ?> 248 243 249 244 <div class="alignleft actions"> 250 <select name="action2"> 251 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 252 <option value="edit"><?php _e('Edit'); ?></option> 253 <option value="delete"><?php _e('Delete'); ?></option> 254 </select> 255 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 245 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '-1', 'action2', 'doaction2', 'doaction2', '', 'pages'); ?> 256 246 </div> 257 247 258 248 <br class="clear" /> … … 313 303 314 304 </div> 315 305 316 <?php include('admin-footer.php'); ?> 317 No newline at end of file 306 <?php include('admin-footer.php'); ?> -
wp-admin/edit-tags.php
178 178 ?> 179 179 180 180 <div class="alignleft actions"> 181 <select name="action"> 182 <option value="" selected="selected"><?php _e('Actions'); ?></option> 183 <option value="delete"><?php _e('Delete'); ?></option> 184 </select> 185 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 181 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'tags'); ?> 186 182 <?php wp_nonce_field('bulk-tags'); ?> 187 183 </div> 188 184 … … 221 217 ?> 222 218 223 219 <div class="alignleft actions"> 224 <select name="action2"> 225 <option value="" selected="selected"><?php _e('Actions'); ?></option> 226 <option value="delete"><?php _e('Delete'); ?></option> 227 </select> 228 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 220 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'tags'); ?> 229 221 </div> 230 222 231 223 <br class="clear" /> -
wp-admin/edit.php
179 179 ?> 180 180 181 181 <div class="alignleft actions"> 182 <select name="action"> 183 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 184 <option value="edit"><?php _e('Edit'); ?></option> 185 <option value="delete"><?php _e('Delete'); ?></option> 186 </select> 187 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 182 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '-1', 'doaction', 'doaction', '', 'posts'); ?> 188 183 <?php wp_nonce_field('bulk-posts'); ?> 189 184 190 185 <?php // view filters … … 254 249 ?> 255 250 256 251 <div class="alignleft actions"> 257 <select name="action2"> 258 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 259 <option value="edit"><?php _e('Edit'); ?></option> 260 <option value="delete"><?php _e('Delete'); ?></option> 261 </select> 262 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 252 <?php print_table_actions( array('' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '-1', 'action2', 'doaction2', 'doaction2', '', 'posts'); ?> 263 253 <br class="clear" /> 264 254 </div> 265 255 <br class="clear" /> -
wp-admin/includes/template.php
3090 3090 } 3091 3091 } 3092 3092 3093 /** 3094 * Table header dropdown list 3095 * 3096 * @since 2.7.0 3097 * @param array $actions assoc. array of actions for the list 3098 * @param string $current the keyname of the currently selected item 3099 * @param string $selectname the name of the selection field 3100 * @param string $buttonname the name attribute of the submit button 3101 * @param string $buttonid the ID attribute of the submit button 3102 * @param string $buttontext the lable on the submit button 3103 * @param string $table the name of the table the actions apply to, Actions are run through a filter 'table_actions_$table' 3104 * 3105 */ 3106 function print_table_actions($actions, $current, $selectname, $buttonname, $buttonid, $buttontext = '', $table = '') { 3107 if ( empty($buttontext) ) 3108 $buttontext = __('Apply'); 3109 if ( !empty($table) ) 3110 $actions = apply_filters('table_actions-$table', $actions, $current, $selectname, $buttonname, $buttonid, $buttontext, $table); 3111 $actions = apply_filters('table_actions', $actions, $current, $selectname, $buttonname, $buttonid, $buttontext, $table); 3112 if ( count($actions) > 0 ) { 3113 echo "<select name='$selectname' class='select-action'>"; 3114 foreach ( $actions as $value => $text ) { 3115 $selected = ($current == $value) ? ' selected="selected"' : ''; 3116 echo "<option value='$value' $selected>$text</option>"; 3117 } 3118 echo '</select>'; 3119 echo "<input type='submit' name='$buttonname' id='$buttonid' value='$buttontext' class='button-secondary action apply' />"; 3120 } 3121 } 3122 3093 3123 ?> -
wp-admin/link-manager.php
110 110 <div class="tablenav"> 111 111 112 112 <div class="alignleft actions"> 113 <select name="action"> 114 <option value="" selected="selected"><?php _e('Actions'); ?></option> 115 <option value="delete"><?php _e('Delete'); ?></option> 116 </select> 117 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 113 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'links'); ?> 118 114 119 115 <?php 120 116 $categories = get_terms('link_category', "hide_empty=1"); … … 263 259 <div class="tablenav"> 264 260 265 261 <div class="alignleft actions"> 266 <select name="action2"> 267 <option value="" selected="selected"><?php _e('Actions'); ?></option> 268 <option value="delete"><?php _e('Delete'); ?></option> 269 </select> 270 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 262 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'links'); ?> 271 263 </div> 272 264 273 265 <br class="clear" /> -
wp-admin/plugins.php
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('admin.php'); 11 11 12 $action = ''; 13 foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) { 14 if( isset($_POST[$action_key]) ) { 15 $action = $action_key; 16 break; 17 } 18 } 19 20 if( isset($_REQUEST['action']) && !empty($_REQUEST['action']) ) 21 $action = $_REQUEST['action']; 22 12 $action = isset($_REQUEST['action']) && !empty($_REQUEST['action']) ? $_REQUEST['action'] : ''; 23 13 $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 24 14 25 15 if( !empty($action) ) { … … 130 120 <p><?php _e('Are you sure you wish to delete these files?') ?></p> 131 121 <form method="post" action="<?php echo clean_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;"> 132 122 <input type="hidden" name="verify-delete" value="1" /> 133 <input type="hidden" name=" delete-selected" value="1" />123 <input type="hidden" name="action" value="delete-selected" /> 134 124 <?php 135 125 foreach ( (array)$plugins as $plugin ) 136 126 echo '<input type="hidden" name="checked[]" value="' . attribute_escape($plugin) . '" />'; … … 321 311 322 312 <div class="tablenav"> 323 313 <div class="alignleft actions"> 324 <select name="action"> 325 <option value="" selected="selected"><?php _e('Actions'); ?></option> 326 <option value="deactivate-selected"><?php _e('Deactivate'); ?></option> 327 </select> 328 <input type="submit" name="doaction_active" value="<?php _e('Apply'); ?>" class="button-secondary action" /> 314 <?php print_table_actions( array('' => __('Actions'), 'deactivate-selected' => __('Deactivate') ), '', 'action', 'doaction_active', 'doaction_active', '', 'plugins_active') ?> 329 315 </div> 330 316 </div> 331 317 <div class="clear"></div> … … 343 329 344 330 <div class="tablenav"> 345 331 <div class="alignleft actions"> 346 <select name="action"> 347 <option value="" selected="selected"><?php _e('Actions'); ?></option> 348 <option value="activate-selected"><?php _e('Activate'); ?></option> 349 <?php if( current_user_can('delete_plugins') ) : ?> 350 <option value="delete-selected"><?php _e('Delete'); ?></option> 351 <?php endif; ?> 352 </select> 353 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction_recent" class="button-secondary action" /> 354 <input type="submit" name="clear-recent-list" value="<?php _e('Clear List') ?>" class="button-secondary" /> 332 <?php 333 $actions = array('' => __('Actions'), 'activate-selected' => __('Activate') ); 334 if( current_user_can('delete_plugins') ) 335 $actions['delete-selected'] = __('Delete'); 336 $actions['clear-recent-list'] = __('Clear List'); 337 print_table_actions( $actions, '', 'action', 'doaction_recent', 'doaction_recent', '', 'plugins_recent') 338 ?> 355 339 </div> 356 340 </div> 357 341 <div class="clear"></div> … … 366 350 367 351 <div class="tablenav"> 368 352 <div class="alignleft actions"> 369 <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" /> 370 <?php if( current_user_can('delete_plugins') ) : ?> 371 <input type="submit" name="delete-selected" value="<?php _e('Delete') ?>" class="button-secondary" /> 372 <?php endif; ?> 353 <?php 354 $actions = array('' => __('Actions'), 'activate-selected' => __('Activate') ); 355 if( current_user_can('delete_plugins') ) 356 $actions['delete-selected'] = __('Delete'); 357 print_table_actions( $actions, '', 'action', 'doaction_inactive', 'doaction_inactive', '', 'plugins_inactive') 358 ?> 373 359 </div> 374 360 </div> 375 361 <div class="clear"></div> -
wp-admin/upload.php
244 244 ?> 245 245 246 246 <div class="alignleft actions"> 247 <select name="action" class="select-action"> 248 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 249 <option value="delete"><?php _e('Delete'); ?></option> 250 <?php if ( isset($orphans) ) { ?> 251 <option value="attach"><?php _e('Attach to a post'); ?></option> 252 <?php } ?> 253 </select> 254 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 247 <?php 248 $actions = array('-1' => __('Actions'), 'delete' => __('Delete') ); 249 if ( isset($orphans) ) 250 $actions['attach'] = __('Attach to a post'); 251 print_table_actions( $actions, '-1', 'action', 'doaction', 'doaction', '', 'media'); 252 ?> 255 253 <?php wp_nonce_field('bulk-media'); ?> 256 254 257 255 <?php … … 394 392 ?> 395 393 396 394 <div class="alignleft actions"> 397 <select name="action2" class="select-action"> 398 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 399 <option value="delete"><?php _e('Delete'); ?></option> 400 <?php if ( isset($orphans) ) { ?> 401 <option value="attach"><?php _e('Attach to a post'); ?></option> 402 <?php } ?> 403 </select> 404 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 395 <?php 396 $actions = array('-1' => __('Actions'), 'delete' => __('Delete') ); 397 if ( isset($orphans) ) 398 $actions['attach'] = __('Attach to a post'); 399 print_table_actions( $actions, '-1', 'action2', 'doaction2', 'doaction2', '', 'media'); 400 ?> 405 401 </div> 406 402 407 403 <br class="clear" /> -
wp-admin/users.php
324 324 <?php endif; ?> 325 325 326 326 <div class="alignleft actions"> 327 <select name="action"> 328 <option value="" selected="selected"><?php _e('Actions'); ?></option> 329 <option value="delete"><?php _e('Delete'); ?></option> 330 </select> 331 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 327 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'users'); ?> 332 328 <label class="hidden" for="new_role"><?php _e('Change role to…') ?></label><select name="new_role" id="new_role"><option value=''><?php _e('Change role to…') ?></option><?php wp_dropdown_roles(); ?></select> 333 329 <input type="submit" value="<?php _e('Change'); ?>" name="changeit" class="button-secondary" /> 334 330 <?php wp_nonce_field('bulk-users'); ?> … … 390 386 <?php endif; ?> 391 387 392 388 <div class="alignleft actions"> 393 <select name="action2"> 394 <option value="" selected="selected"><?php _e('Actions'); ?></option> 395 <option value="delete"><?php _e('Delete'); ?></option> 396 </select> 397 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 389 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'users'); ?> 398 390 </div> 399 391 400 392 <br class="clear" />