Ticket #7957: print-table-headers.diff
| File print-table-headers.diff, 19.1 KB (added by , 18 years ago) |
|---|
-
wp-admin/categories.php
182 182 ?> 183 183 184 184 <div class="alignleft"> 185 <select name="action"> 186 <option value="" selected="selected"><?php _e('Actions'); ?></option> 187 <option value="delete"><?php _e('Delete'); ?></option> 188 </select> 189 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 185 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'categories'); ?> 190 186 <?php wp_nonce_field('bulk-categories'); ?> 191 187 </div> 192 188 … … 222 218 ?> 223 219 224 220 <div class="alignleft"> 225 <select name="action2"> 226 <option value="" selected="selected"><?php _e('Actions'); ?></option> 227 <option value="delete"><?php _e('Delete'); ?></option> 228 </select> 229 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 221 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'categories'); ?> 230 222 <?php wp_nonce_field('bulk-categories'); ?> 231 223 </div> 232 224 -
wp-admin/edit-comments.php
218 218 ?> 219 219 220 220 <div class="alignleft"> 221 <select name="action"> 222 <option value="-1" selected="selected"><?php _e('Actions') ?></option> 223 <?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> 224 <option value="unapprove"><?php _e('Unapprove'); ?></option> 225 <?php endif; ?> 226 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 227 <option value="approve"><?php _e('Approve'); ?></option> 228 <?php endif; ?> 229 <?php if ( 'spam' != $comment_status ): ?> 230 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 231 <?php endif; ?> 232 <option value="delete"><?php _e('Delete'); ?></option> 233 </select> 234 <input type="submit" name="doaction" id="doaction" value="<?php _e('Apply'); ?>" class="button-secondary apply" /> 221 <?php 222 $actions = array('-1' => __('Actions') ); 223 if ( empty($comment_status) || 'approved' == $comment_status ) 224 $actions['unapprove'] = __('Unapprove'); 225 if ( empty($comment_status) || 'moderated' == $comment_status ) 226 $actions['approve'] = __('Approve'); 227 if ( 'spam' != $comment_status ) 228 $actions['markspam'] = __('Mark as Spam'); 229 $actions['delete'] = __('Delete'); 230 231 print_table_actions( $actions, '', 'action', 'doaction', 'doaction', '', 'comments'); 232 ?> 235 233 <?php wp_nonce_field('bulk-comments'); ?> 236 234 <?php if ( isset($_GET['apage']) ) { ?> 237 235 <input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" /> … … 285 283 ?> 286 284 287 285 <div class="alignleft"> 288 <select name="action2"> 289 <option value="-1" selected="selected"><?php _e('Actions') ?></option> 290 <?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> 291 <option value="unapprove"><?php _e('Unapprove'); ?></option> 292 <?php endif; ?> 293 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 294 <option value="approve"><?php _e('Approve'); ?></option> 295 <?php endif; ?> 296 <?php if ( 'spam' != $comment_status ): ?> 297 <option value="markspam"><?php _e('Mark as Spam'); ?></option> 298 <?php endif; ?> 299 <option value="delete"><?php _e('Delete'); ?></option> 300 </select> 301 <input type="submit" name="doaction2" id="doaction2" value="<?php _e('Apply'); ?>" class="button-secondary apply" /> 302 286 <?php print_table_actions( $actions, '', 'action2', 'doaction2', 'doaction2', '', 'comments'); ?> 303 287 <?php if ( 'spam' == $comment_status ) { ?> 304 288 <input type="submit" name="delete_all_spam2" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 305 289 <?php } ?> -
wp-admin/edit-link-categories.php
110 110 ?> 111 111 112 112 <div class="alignleft"> 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', '', 'link_categories'); ?> 118 114 <?php wp_nonce_field('bulk-link-categories'); ?> 119 115 </div> 120 116 … … 166 162 ?> 167 163 168 164 <div class="alignleft"> 169 <select name="action2"> 170 <option value="" selected="selected"><?php _e('Actions'); ?></option> 171 <option value="delete"><?php _e('Delete'); ?></option> 172 </select> 173 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 165 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'link_categories'); ?> 174 166 </div> 175 167 176 168 <br class="clear" /> -
wp-admin/edit-pages.php
200 200 ?> 201 201 202 202 <div class="alignleft"> 203 <select name="action"> 204 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 205 <option value="edit"><?php _e('Edit'); ?></option> 206 <option value="delete"><?php _e('Delete'); ?></option> 207 </select> 208 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 203 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'pages'); ?> 209 204 <?php wp_nonce_field('bulk-pages'); ?> 210 205 </div> 211 206 … … 245 240 ?> 246 241 247 242 <div class="alignleft"> 248 <select name="action2"> 249 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 250 <option value="edit"><?php _e('Edit'); ?></option> 251 <option value="delete"><?php _e('Delete'); ?></option> 252 </select> 253 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 243 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'pages'); ?> 254 244 </div> 255 245 256 246 <br class="clear" /> … … 311 301 312 302 </div> 313 303 314 <?php include('admin-footer.php'); ?> 315 No newline at end of file 304 <?php include('admin-footer.php'); ?> -
wp-admin/edit-tags.php
177 177 ?> 178 178 179 179 <div class="alignleft"> 180 <select name="action"> 181 <option value="" selected="selected"><?php _e('Actions'); ?></option> 182 <option value="delete"><?php _e('Delete'); ?></option> 183 </select> 184 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 180 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'tags'); ?> 185 181 <?php wp_nonce_field('bulk-tags'); ?> 186 182 </div> 187 183 … … 220 216 ?> 221 217 222 218 <div class="alignleft"> 223 <select name="action2"> 224 <option value="" selected="selected"><?php _e('Actions'); ?></option> 225 <option value="delete"><?php _e('Delete'); ?></option> 226 </select> 227 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 219 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'tags'); ?> 228 220 </div> 229 221 230 222 <br class="clear" /> -
wp-admin/edit.php
226 226 ?> 227 227 228 228 <div class="alignleft"> 229 <select name="action"> 230 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 231 <option value="edit"><?php _e('Edit'); ?></option> 232 <option value="delete"><?php _e('Delete'); ?></option> 233 </select> 234 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 229 <?php print_table_actions( array('-1' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '', 'doaction', 'doaction', '', 'posts'); ?> 235 230 <?php wp_nonce_field('bulk-posts'); ?> 236 231 </div> 237 232 … … 259 254 ?> 260 255 261 256 <div class="alignleft"> 262 <select name="action2"> 263 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 264 <option value="edit"><?php _e('Edit'); ?></option> 265 <option value="delete"><?php _e('Delete'); ?></option> 266 </select> 267 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 257 <?php print_table_actions( array('' => __('Actions'), 'edit' => __('Edit'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'posts'); ?> 268 258 <br class="clear" /> 269 259 </div> 270 260 <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
135 135 <div class="tablenav"> 136 136 137 137 <div class="alignleft"> 138 <select name="action"> 139 <option value="" selected="selected"><?php _e('Actions'); ?></option> 140 <option value="delete"><?php _e('Delete'); ?></option> 141 </select> 142 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 138 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'links'); ?> 143 139 </div> 144 140 145 141 <br class="clear" /> … … 266 262 <div class="tablenav"> 267 263 268 264 <div class="alignleft"> 269 <select name="action2"> 270 <option value="" selected="selected"><?php _e('Actions'); ?></option> 271 <option value="delete"><?php _e('Delete'); ?></option> 272 </select> 273 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 265 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'links'); ?> 274 266 </div> 275 267 276 268 <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"> 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"> 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"> 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
279 279 ?> 280 280 281 281 <div class="alignleft"> 282 <select name="action" class="select-action"> 283 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 284 <option value="delete"><?php _e('Delete'); ?></option> 285 <?php if ( isset($orphans) ) { ?> 286 <option value="attach"><?php _e('Attach to a post'); ?></option> 287 <?php } ?> 288 </select> 289 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 282 <?php 283 $actions = array('-1' => __('Actions'), 'delete' => __('Delete') ); 284 if ( isset($orphans) ) 285 $actions['attach'] = __('Attach to a post'); 286 print_table_actions( $actions, '', 'action', 'doaction', 'doaction', '', 'media'); 287 ?> 290 288 <?php wp_nonce_field('bulk-media'); ?> 291 289 292 290 <?php if ( isset($_GET['detached']) ) { ?> … … 395 393 ?> 396 394 397 395 <div class="alignleft"> 398 <select name="action2" class="select-action"> 399 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 400 <option value="delete"><?php _e('Delete'); ?></option> 401 <?php if ( isset($orphans) ) { ?> 402 <option value="attach"><?php _e('Attach to a post'); ?></option> 403 <?php } ?> 404 </select> 405 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 396 <?php 397 $actions = array('-1' => __('Actions'), 'delete' => __('Delete') ); 398 if ( isset($orphans) ) 399 $actions['attach'] = __('Attach to a post'); 400 print_table_actions( $actions, '', 'action2', 'doaction2', 'doaction2', '', 'media'); 401 ?> 406 402 </div> 407 403 408 404 <br class="clear" /> -
wp-admin/users.php
316 316 <?php endif; ?> 317 317 318 318 <div class="alignleft"> 319 <select name="action"> 320 <option value="" selected="selected"><?php _e('Actions'); ?></option> 321 <option value="delete"><?php _e('Delete'); ?></option> 322 </select> 323 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 319 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action', 'doaction', 'doaction', '', 'users'); ?> 324 320 <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> 325 321 <input type="submit" value="<?php _e('Change'); ?>" name="changeit" class="button-secondary" /> 326 322 <?php wp_nonce_field('bulk-users'); ?> … … 384 380 <?php endif; ?> 385 381 386 382 <div class="alignleft"> 387 <select name="action2"> 388 <option value="" selected="selected"><?php _e('Actions'); ?></option> 389 <option value="delete"><?php _e('Delete'); ?></option> 390 </select> 391 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 383 <?php print_table_actions( array('' => __('Actions'), 'delete' => __('Delete') ), '', 'action2', 'doaction2', 'doaction2', '', 'users'); ?> 392 384 </div> 393 385 394 386 <br class="clear" />