Add colmn headrs and actions to bottom of posts table

git-svn-id: http://svn.automattic.com/wordpress/trunk@8981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-25 21:12:33 +00:00
parent 1c60d1346f
commit 4a93285747
4 changed files with 39 additions and 10 deletions

View File

@ -28,4 +28,9 @@ if ( have_posts() ) {
} // end if ( have_posts() )
?>
</tbody>
<thead>
<tr>
<?php print_column_headers('post'); ?>
</tr>
</thead>
</table>

View File

@ -9,11 +9,17 @@
/** WordPress Administration Bootstrap */
require_once('admin.php');
$action = -1;
if ( isset($_GET['action2']) && $_GET['action2'] != -1 )
$action = $_GET['action2'];
if ( isset($_GET['action']) && $_GET['action'] != -1 )
$action = $_GET['action'];
// Handle bulk actions
if ( isset($_GET['action']) && $_GET['action'] != -1 ) {
switch ( $_GET['action'] ) {
if ( $action != -1 ) {
switch ( $action ) {
case 'delete':
if ( isset($_GET['post']) && isset($_GET['doaction']) ) {
if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-posts');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
@ -265,12 +271,6 @@ do_action('restrict_manage_posts');
<?php include( 'edit-post-rows.php' ); ?>
</form>
<?php inline_edit_row( 'post' ); ?>
<div id="ajax-response"></div>
<div class="tablenav">
<?php
@ -278,8 +278,23 @@ if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<div class="alignleft">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Actions'); ?></option>
<option value="edit"><?php _e('Edit'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
<br class="clear" />
</div>
<br class="clear" />
</div>
</form>
<?php inline_edit_row( 'post' ); ?>
<div id="ajax-response"></div>
<br class="clear" />

View File

@ -56,6 +56,15 @@ inlineEdit = {
t.revert();
}
});
$('#doaction2').click(function(e){
if ( $('select[name="action2"]').val() == 'edit' ) {
e.preventDefault();
t.setBulk();
} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
t.revert();
}
});
$('#post-query-submit').click(function(e){
if ( $('form#posts-filter tr.inline-editor').length > 0 )

View File

@ -244,7 +244,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' );
$scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080925' );
$scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080926' );
$scripts->localize( 'inline-edit', 'inlineEditL10n', array(
'edit' => __('Double-click to edit')
) );