Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revision 12725)
+++ wp-admin/admin-ajax.php	(working copy)
@@ -1003,8 +1003,11 @@
 case 'autosave-generate-nonces' :
 	check_ajax_referer( 'autosave', 'autosavenonce' );
 	$ID = (int) $_POST['post_ID'];
-	$post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
-	if ( current_user_can( "edit_{$post_type}", $ID ) )
+	$post_type = $_POST['post_type'];
+	$post_type_object = get_post_type_object($post_type);
+	if ( !$post_type_object )
+		die('0');
+	if ( current_user_can( $post_type_object->edit_cap, $ID ) )
 		die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&amp;', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) );
 	do_action('autosave_generate_nonces');
 	die('0');
Index: wp-admin/post-new.php
===================================================================
--- wp-admin/post-new.php	(revision 12725)
+++ wp-admin/post-new.php	(working copy)
@@ -17,8 +17,6 @@
 if ( 'post' != $post_type ) {
 	$parent_file = "edit.php?post_type=$post_type";
 	$submenu_file = "post-new.php?post_type=$post_type";
-	if ( 'page' == $post_type )
-		$parent_file = 'edit-pages.php';
 } else {
 	$parent_file = 'edit.php';
 	$submenu_file = 'post-new.php';
Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 12725)
+++ wp-admin/includes/post.php	(working copy)
@@ -819,10 +819,11 @@
 	$q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
 	$post_stati  = get_post_stati();
 
-	if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types( array('_show' => true) ) ) )
+	if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types() ) )
 		$post_type = $q['post_type'];
 	else
 		$post_type = 'post';
+	$post_type_object = get_post_type_object($post_type);
 
 	$avail_post_stati = get_available_post_statuses($post_type);
 
@@ -842,17 +843,25 @@
 		$orderby = 'date';
 	}
 
-	if ( 'post' != $post_type )
-		$per_page = 'edit_' . $post_type . '_per_page';
-	else
-		$per_page = 'edit_per_page';
-	$posts_per_page = (int) get_user_option( 'edit_per_page' );
+	$per_page = 'edit_' . $post_type . '_per_page';
+	$posts_per_page = (int) get_user_option( $per_page );
 	if ( empty( $posts_per_page ) || $posts_per_page < 1 )
 		$posts_per_page = 15;
-	$posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
+	$posts_per_page = apply_filters( $per_page, $posts_per_page );
 
-	wp( compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page') );
 
+	$query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
+
+	// Hierarchical types require special args.
+	if ( $post_type_object->hierarchical ) {
+		$query['orderby'] = 'menu_order title';
+		$query['order'] = 'asc';
+		$query['posts_per_page'] = -1;
+		$query['posts_per_archive_page'] = -1;
+	}
+
+	wp( $query );
+
 	return $avail_post_stati;
 }
 
Index: wp-admin/includes/misc.php
===================================================================
--- wp-admin/includes/misc.php	(revision 12725)
+++ wp-admin/includes/misc.php	(working copy)
@@ -407,7 +407,6 @@
 
 		switch ( $map_option ) {
 			case 'edit_per_page':
-			case 'edit_pages_per_page':
 			case 'edit_comments_per_page':
 			case 'upload_per_page':
 			case 'categories_per_page':
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 12725)
+++ wp-admin/includes/template.php	(working copy)
@@ -747,22 +747,26 @@
  *
  * @return unknown
  */
-function wp_manage_posts_columns() {
-	global $typenow;
+function wp_manage_posts_columns( $screen = '') {
+	if ( empty($screen) )
+		$post_type = 'post';
+	else
+		$post_type = $screen->post_type;
 
 	$posts_columns = array();
 	$posts_columns['cb'] = '<input type="checkbox" />';
 	/* translators: manage posts column name */
-	$posts_columns['title'] = _x('Post', 'column name');
+	$posts_columns['title'] = _x('Title', 'column name');
 	$posts_columns['author'] = __('Author');
-	if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') )
+	if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') )
 		$posts_columns['categories'] = __('Categories');
-	if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') )
+	if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') )
 		$posts_columns['tags'] = __('Tags');
 	$post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
-	if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($typenow) || post_type_supports($typenow, 'comments') ) )
+	if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) )
 		$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
 	$posts_columns['date'] = __('Date');
+	// @todo filter per type
 	$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
 
 	return $posts_columns;
@@ -803,17 +807,7 @@
  * @return unknown
  */
 function wp_manage_pages_columns() {
-	$posts_columns = array();
-	$posts_columns['cb'] = '<input type="checkbox" />';
-	$posts_columns['title'] = __('Title');
-	$posts_columns['author'] = __('Author');
-	$post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
-	if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
-		$posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>';
-	$posts_columns['date'] = __('Date');
-	$posts_columns = apply_filters('manage_pages_columns', $posts_columns);
-
-	return $posts_columns;
+	return wp_manage_posts_columns();
 }
 
 /**
@@ -821,33 +815,28 @@
  *
  * @since unknown
  *
- * @param unknown_type $page
+ * @param unknown_type $screen
  * @return unknown
  */
-function get_column_headers($page) {
+function get_column_headers($screen) {
 	global $_wp_column_headers;
 
 	if ( !isset($_wp_column_headers) )
 		$_wp_column_headers = array();
 
-	$map_screen = $page;
-	$type = str_replace('edit-', '', $map_screen);
-	if ( in_array($type, get_post_types()) )
-		$map_screen = 'edit';
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
 
 	// Store in static to avoid running filters on each call
-	if ( isset($_wp_column_headers[$page]) )
-		return $_wp_column_headers[$page];
+	if ( isset($_wp_column_headers[$screen->id]) )
+		return $_wp_column_headers[$screen->id];
 
-	switch ($map_screen) {
+	switch ($screen->base) {
 		case 'edit':
-			 $_wp_column_headers[$page] = wp_manage_posts_columns();
+			 $_wp_column_headers[$screen->id] = wp_manage_posts_columns( $screen );
 			 break;
-		case 'edit-pages':
-			$_wp_column_headers[$page] = wp_manage_pages_columns();
-			break;
 		case 'edit-comments':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'author' => __('Author'),
 				/* translators: column name */
@@ -858,7 +847,7 @@
 
 			break;
 		case 'link-manager':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'name' => __('Name'),
 				'url' => __('URL'),
@@ -870,10 +859,10 @@
 
 			break;
 		case 'upload':
-			$_wp_column_headers[$page] = wp_manage_media_columns();
+			$_wp_column_headers[$screen->id] = wp_manage_media_columns();
 			break;
 		case 'categories':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'name' => __('Name'),
 				'description' => __('Description'),
@@ -883,7 +872,7 @@
 
 			break;
 		case 'edit-link-categories':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'name' => __('Name'),
 				'description' => __('Description'),
@@ -893,7 +882,7 @@
 
 			break;
 		case 'edit-tags':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'name' => __('Name'),
 				'description' => __('Description'),
@@ -903,7 +892,7 @@
 
 			break;
 		case 'users':
-			$_wp_column_headers[$page] = array(
+			$_wp_column_headers[$screen->id] = array(
 				'cb' => '<input type="checkbox" />',
 				'username' => __('Username'),
 				'name' => __('Name'),
@@ -913,11 +902,11 @@
 			);
 			break;
 		default :
-			$_wp_column_headers[$page] = array();
+			$_wp_column_headers[$screen->id] = array();
 	}
 
-	$_wp_column_headers[$page] = apply_filters('manage_' . $page . '_columns', $_wp_column_headers[$page]);
-	return $_wp_column_headers[$page];
+	$_wp_column_headers[$screen->id] = apply_filters('manage_' . $screen->id . '_columns', $_wp_column_headers[$screen->id]);
+	return $_wp_column_headers[$screen->id];
 }
 
 /**
@@ -925,13 +914,15 @@
  *
  * @since unknown
  *
- * @param unknown_type $type
+ * @param unknown_type $screen
  * @param unknown_type $id
  */
-function print_column_headers( $type, $id = true ) {
-	$type = str_replace('.php', '', $type);
-	$columns = get_column_headers( $type );
-	$hidden = get_hidden_columns($type);
+function print_column_headers( $screen, $id = true ) {
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
+	$columns = get_column_headers( $screen );
+	$hidden = get_hidden_columns($screen);
 	$styles = array();
 
 	foreach ( $columns as $column_key => $column_display_name ) {
@@ -950,8 +941,8 @@
 		if ( in_array($column_key, $hidden) )
 			$style = 'display:none;';
 
-		if ( isset($styles[$type]) && isset($styles[$type][$column_key]) )
-			$style .= ' ' . $styles[$type][$column_key];
+		if ( isset($styles[$screen->id]) && isset($styles[$screen->id][$column_key]) )
+			$style .= ' ' . $styles[$screen>id][$column_key];
 		$style = ' style="' . $style . '"';
 ?>
 	<th scope="col" <?php echo $id ? "id=\"$column_key\"" : ""; echo $class; echo $style; ?>><?php echo $column_display_name; ?></th>
@@ -970,10 +961,13 @@
 function register_column_headers($screen, $columns) {
 	global $_wp_column_headers;
 
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
 	if ( !isset($_wp_column_headers) )
 		$_wp_column_headers = array();
 
-	$_wp_column_headers[$screen] = $columns;
+	$_wp_column_headers[$screen->id] = $columns;
 }
 
 /**
@@ -981,11 +975,13 @@
  *
  * @since unknown
  *
- * @param unknown_type $page
+ * @param unknown_type $screen
  */
-function get_hidden_columns($page) {
-	$page = str_replace('.php', '', $page);
-	return (array) get_user_option( 'manage-' . $page . '-columns-hidden' );
+function get_hidden_columns($screen) {
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
+	return (array) get_user_option( 'manage-' . $screen->id. '-columns-hidden' );
 }
 
 /**
@@ -997,23 +993,23 @@
  *
  * @param string $type 'post' or 'page'
  */
-function inline_edit_row( $type ) {
+function inline_edit_row( $screen ) {
 	global $current_user, $mode;
 
-	$is_page = 'page' == $type;
-	if ( $is_page ) {
-		$screen = 'edit-pages';
-		$post = get_default_page_to_edit();
-	} else {
-		$screen = 'edit';
-		$post = get_default_post_to_edit();
+	if ( is_string($screen) ) {
+		$screen = array('id' => 'edit-' . $screen, 'base' => 'edit', 'post_type' => $screen );
+		$screen = (object) $screen;
 	}
 
-	$columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns();
+	$post = get_default_post_to_edit( $screen->post_type );
+	$post_type_object = get_post_type_object( $screen->post_type );
+
+	$columns = wp_manage_posts_columns($screen);
 	$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
 	$col_count = count($columns) - count($hidden);
 	$m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
-	$can_publish = current_user_can("publish_{$type}s");
+	// @todo use capability_type
+	$can_publish = current_user_can("publish_{$screen->post_type}s");
 	$core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );
 
 ?>
@@ -1023,12 +1019,12 @@
 	$bulk = 0;
 	while ( $bulk < 2 ) { ?>
 
-	<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$type ";
-		echo $bulk ? "bulk-edit-row bulk-edit-row-$type" : "quick-edit-row quick-edit-row-$type";
+	<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$screen->post_type ";
+		echo $bulk ? "bulk-edit-row bulk-edit-row-$screen->post_type" : "quick-edit-row quick-edit-row-$screen->post_type";
 	?>" style="display: none"><td colspan="<?php echo $col_count; ?>">
 
 	<fieldset class="inline-edit-col-left"><div class="inline-edit-col">
-		<h4><?php echo $bulk ? ( $is_page ? __( 'Bulk Edit Pages' ) : __( 'Bulk Edit Posts' ) ) : __( 'Quick Edit' ); ?></h4>
+		<h4><?php echo $bulk ? ( __( 'Bulk Edit' ) ) : __( 'Quick Edit' ); ?></h4>
 
 
 <?php if ( $bulk ) : ?>
@@ -1061,7 +1057,7 @@
 
 <?php endif; // $bulk
 
-		$authors = get_editable_user_ids( $current_user->id, true, $type ); // TODO: ROLE SYSTEM
+		$authors = get_editable_user_ids( $current_user->id, true, $screen->post_type ); // TODO: ROLE SYSTEM
 		$authors_dropdown = '';
 		if ( $authors && count( $authors ) > 1 ) :
 			$users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, 'echo' => 0);
@@ -1091,7 +1087,7 @@
 			</em>
 			<label class="alignleft inline-edit-private">
 				<input type="checkbox" name="keep_private" value="private" />
-				<span class="checkbox-title"><?php echo $is_page ? __('Private page') : __('Private post'); ?></span>
+				<span class="checkbox-title"><?php echo __('Private'); ?></span>
 			</label>
 		</div>
 
@@ -1099,7 +1095,7 @@
 
 	</div></fieldset>
 
-<?php if ( !$is_page && !$bulk ) : ?>
+<?php if ( is_object_in_taxonomy($screen->post_type, 'categories') && !$bulk ) : ?>
 
 	<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
 		<span class="title inline-edit-categories-label"><?php _e( 'Categories' ); ?>
@@ -1111,7 +1107,7 @@
 		</ul>
 	</div></fieldset>
 
-<?php endif; // !$is_page && !$bulk ?>
+<?php endif; // !hierarchical && !$bulk ?>
 
 	<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
 
@@ -1120,7 +1116,7 @@
 		echo $authors_dropdown;
 ?>
 
-<?php if ( $is_page ) : ?>
+<?php if ( $post_type_object->hierarchical ) : ?>
 
 		<label>
 			<span class="title"><?php _e( 'Parent' ); ?></span>
@@ -1220,7 +1216,7 @@
 				</select>
 			</label>
 
-<?php if ( !$is_page && $can_publish && current_user_can( 'edit_others_posts' ) ) : ?>
+<?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( 'edit_others_posts' ) ) : ?>
 
 <?php	if ( $bulk ) : ?>
 
@@ -1259,12 +1255,12 @@
 		<a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel alignleft"><?php _e('Cancel'); ?></a>
 		<?php if ( ! $bulk ) {
 			wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
-			$update_text = ( $is_page ) ? __( 'Update Page' ) : __( 'Update Post' );
+			$update_text = __( 'Update' );
 			?>
 			<a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a>
 			<img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" />
 		<?php } else {
-			$update_text = ( $is_page ) ? __( 'Update Pages' ) : __( 'Update Posts' );
+			$update_text = __( 'Update' );
 		?>
 			<input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo esc_attr( $update_text ); ?>" />
 		<?php } ?>
@@ -1368,7 +1364,7 @@
  * @param unknown_type $mode
  */
 function _post_row($a_post, $pending_comments, $mode) {
-	global $post, $current_user;
+	global $post, $current_user, $current_screen;
 	static $rowclass;
 
 	$global_post = $post;
@@ -1382,8 +1378,8 @@
 ?>
 	<tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top">
 <?php
-	$posts_columns = get_column_headers('edit');
-	$hidden = get_hidden_columns('edit');
+	$posts_columns = get_column_headers( $current_screen );
+	$hidden = get_hidden_columns( $current_screen );
 	foreach ( $posts_columns as $column_name=>$column_display_name ) {
 		$class = "class=\"$column_name column-$column_name\"";
 
@@ -1578,7 +1574,7 @@
  * @param unknown_type $level
  */
 function display_page_row( $page, $level = 0 ) {
-	global $post;
+	global $post, $current_screen;
 	static $rowclass;
 
 	$post = $page;
@@ -1605,8 +1601,8 @@
 	$pad = str_repeat( '&#8212; ', $level );
 	$id = (int) $page->ID;
 	$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
-	$posts_columns = get_column_headers('edit-pages');
-	$hidden = get_hidden_columns('edit-pages');
+	$posts_columns = get_column_headers( $current_screen );
+	$hidden = get_hidden_columns(  $current_screen );
 	$title = _draft_or_post_title();
 ?>
 <tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
@@ -3055,19 +3051,22 @@
  *
  * @since unknown
  *
- * @param unknown_type $page
+ * @param unknown_type $screen
  */
-function meta_box_prefs($page) {
+function meta_box_prefs($screen) {
 	global $wp_meta_boxes;
 
-	if ( empty($wp_meta_boxes[$page]) )
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
+	if ( empty($wp_meta_boxes[$screen->id]) )
 		return;
 
-	$hidden = get_hidden_meta_boxes($page);
+	$hidden = get_hidden_meta_boxes($screen);
 
-	foreach ( array_keys($wp_meta_boxes[$page]) as $context ) {
-		foreach ( array_keys($wp_meta_boxes[$page][$context]) as $priority ) {
-			foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
+	foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
+		foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
+			foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
 				if ( false == $box || ! $box['title'] )
 					continue;
 				// Submit box cannot be hidden
@@ -3082,9 +3081,12 @@
 	}
 }
 
-function get_hidden_meta_boxes($page) {
-	$hidden = (array) get_user_option( "meta-box-hidden_$page" );
+function get_hidden_meta_boxes($screen) {
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
 
+	$hidden = (array) get_user_option( "meta-box-hidden_$screen->id" );
+
 	// Hide slug boxes by default
 	if ( empty($hidden[0]) ) {
 		$hidden = array('slugdiv');
@@ -3278,44 +3280,47 @@
  * @since unknown
  */
 function favorite_actions( $screen = null ) {
-	switch ( $screen ) {
-		case 'post-new.php':
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
+	switch ( $screen->id ) {
+		case 'post':
 			$default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts'));
 			break;
-		case 'edit-pages.php':
-			$default_action = array('page-new.php' => array(__('New Page'), 'edit_pages'));
+		case 'edit-page':
+			$default_action = array('post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'));
 			break;
-		case 'page-new.php':
-			$default_action = array('edit-pages.php' => array(__('Edit Pages'), 'edit_pages'));
+		case 'page':
+			$default_action = array('edit.php?post_type=page' => array(__('Edit Pages'), 'edit_pages'));
 			break;
 		case 'upload.php':
 			$default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));
 			break;
-		case 'media-new.php':
+		case 'media':
 			$default_action = array('upload.php' => array(__('Edit Media'), 'upload_files'));
 			break;
-		case 'link-manager.php':
+		case 'link-manager':
 			$default_action = array('link-add.php' => array(__('New Link'), 'manage_links'));
 			break;
-		case 'link-add.php':
+		case 'link-add':
 			$default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links'));
 			break;
-		case 'users.php':
+		case 'users':
 			$default_action = array('user-new.php' => array(__('New User'), 'create_users'));
 			break;
-		case 'user-new.php':
+		case 'user':
 			$default_action = array('users.php' => array(__('Edit Users'), 'edit_users'));
 			break;
-		case 'plugins.php':
+		case 'plugins':
 			$default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins'));
 			break;
-		case 'plugin-install.php':
+		case 'plugin-install':
 			$default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins'));
 			break;
-		case 'themes.php':
+		case 'themes':
 			$default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes'));
 			break;
-		case 'theme-install.php':
+		case 'theme-install':
 			$default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes'));
 			break;
 		default:
@@ -3483,32 +3488,34 @@
 	}
 }
 
-function screen_meta($screen) {
-	global $wp_meta_boxes, $_wp_contextual_help, $typenow;
-
+// Convert a screen string to a screen object
+function convert_to_screen( $screen ) {
 	$screen = str_replace('.php', '', $screen);
 	$screen = str_replace('-new', '', $screen);
 	$screen = str_replace('-add', '', $screen);
 	$screen = apply_filters('screen_meta_screen', $screen);
 
+	$screen = array('id' => $screen, 'base' => $screen);
+	return (object) $screen;
+}
+
+function screen_meta($screen) {
+	global $wp_meta_boxes, $_wp_contextual_help, $post_type;
+
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
 	$column_screens = get_column_headers($screen);
 	$meta_screens = array('index' => 'dashboard');
 
-	// Give post_type pages their own screen
-	if ( 'post' == $screen ) {
-		if ( !empty($typenow) )
-			$screen = $typenow;
+	if ( isset($meta_screens[$screen->id]) ) {
+		$screen->id = $meta_screens[$screen->id];
+		$screen->base = $screen->id;
 	}
-	if ( 'edit' == $screen ) {
-		if ( !empty($typenow) )
-			$screen = 'edit-' . $typenow;
-	}
 
-	if ( isset($meta_screens[$screen]) )
-		$screen = $meta_screens[$screen];
 	$show_screen = false;
 	$show_on_screen = false;
-	if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) {
+	if ( !empty($wp_meta_boxes[$screen->id]) || !empty($column_screens) ) {
 		$show_screen = true;
 		$show_on_screen = true;
 	}
@@ -3522,49 +3529,8 @@
 
 	$settings = '';
 
-	switch ( $screen ) {
-		case 'post':
-			if ( !isset($_wp_contextual_help['post']) ) {
-				$help = drag_drop_help();
-				$help .= '<p>' . __('<a href="http://codex.wordpress.org/Writing_Posts" target="_blank">Writing Posts</a>') . '</p>';
-				$_wp_contextual_help['post'] = $help;
-			}
-			break;
-		case 'page':
-			if ( !isset($_wp_contextual_help['page']) ) {
-				$help = drag_drop_help();
-				$_wp_contextual_help['page'] = $help;
-			}
-			break;
-		case 'dashboard':
-			if ( !isset($_wp_contextual_help['dashboard']) ) {
-				$help = '<p>' . __('The modules on this screen can be arranged in several columns. You can select the number of columns from the Screen Options tab.') . "</p>\n";
-				$help .= drag_drop_help();
-				$_wp_contextual_help['dashboard'] = $help;
-			}
-			break;
-		case 'link':
-			if ( !isset($_wp_contextual_help['link']) ) {
-				$help = drag_drop_help();
-				$_wp_contextual_help['link'] = $help;
-			}
-			break;
-		case 'options-general':
-			if ( !isset($_wp_contextual_help['options-general']) )
-				$_wp_contextual_help['options-general'] = __('<a href="http://codex.wordpress.org/Settings_General_SubPanel" target="_blank">General Settings</a>');
-			break;
-		case 'theme-install':
-		case 'plugin-install':
-			if ( ( !isset($_GET['tab']) || 'dashboard' == $_GET['tab'] ) && !isset($_wp_contextual_help[$screen]) ) {
-				$help = plugins_search_help();
-				$_wp_contextual_help[$screen] = $help;
-			}
-			break;
+	switch ( $screen->id ) {
 		case 'widgets':
-			if ( !isset($_wp_contextual_help['widgets']) ) {
-				$help = widgets_help();
-				$_wp_contextual_help['widgets'] = $help;
-			}
 			$settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
 			$show_screen = true;
 			break;
@@ -3604,12 +3570,12 @@
 	<div id="contextual-help-wrap" class="hidden">
 	<?php
 	$contextual_help = '';
-	if ( isset($_wp_contextual_help[$screen]) ) {
+	if ( isset($_wp_contextual_help[$screen->id]) ) {
 		if ( !empty($title) )
 			$contextual_help .= '<h5>' . sprintf(__('Get help with &#8220;%s&#8221;'), $title) . '</h5>';
 		else
 			$contextual_help .= '<h5>' . __('Get help with this page') . '</h5>';
-		$contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen] . "</div>\n";
+		$contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen->id] . "</div>\n";
 
 		$contextual_help .= '<h5>' . __('Other Help') . '</h5>';
 	} else {
@@ -3651,10 +3617,13 @@
 function add_contextual_help($screen, $help) {
 	global $_wp_contextual_help;
 
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
 	if ( !isset($_wp_contextual_help) )
 		$_wp_contextual_help = array();
 
-	$_wp_contextual_help[$screen] = $help;
+	$_wp_contextual_help[$screen->id] = $help;
 }
 
 function drag_drop_help() {
@@ -3674,33 +3643,27 @@
 ';
 }
 
-function widgets_help() {
-	return '
-	<p>' . __('Widgets are added and arranged by simple drag &#8217;n&#8217; drop. If you hover your mouse over the titlebar of a widget, you&#8217;ll see a 4-arrow cursor which indicates that the widget is movable.  Click on the titlebar, hold down the mouse button and drag the widget to a sidebar. As you drag, you&#8217;ll see a dotted box that also moves. This box shows where the widget will go once you drop it.') . '</p>
-	<p>' . __('To remove a widget from a sidebar, drag it back to Available Widgets or click on the arrow on its titlebar to reveal its settings, and then click Remove.') . '</p>
-	<p>' . __('To remove a widget from a sidebar <em>and keep its configuration</em>, drag it to Inactive Widgets.') . '</p>
-	<p>' . __('The Inactive Widgets area stores widgets that are configured but not curently used. If you change themes and the new theme has fewer sidebars than the old, all extra widgets will be stored to Inactive Widgets automatically.') . '</p>
-';
-}
-
 function screen_layout($screen) {
 	global $screen_layout_columns;
 
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
+
 	$columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2);
 
 	// Add custom post types
 	foreach ( get_post_types( array('_show' => true) ) as $post_type )
 		$columns[$post_type] = 2;
 
-	$columns = apply_filters('screen_layout_columns', $columns, $screen);
+	$columns = apply_filters('screen_layout_columns', $columns, $screen->id, $screen);
 
-	if ( !isset($columns[$screen]) ) {
+	if ( !isset($columns[$screen->id]) ) {
 		$screen_layout_columns = 0;
 		return '';
  	}
 
-	$screen_layout_columns = get_user_option("screen_layout_$screen");
-	$num = $columns[$screen];
+	$screen_layout_columns = get_user_option("screen_layout_$screen->id");
+	$num = $columns[$screen->id];
 
 	if ( ! $screen_layout_columns )
 			$screen_layout_columns = 2;
@@ -3716,12 +3679,10 @@
 }
 
 function screen_options($screen) {
-	$map_screen = $screen;
-	$type = str_replace('edit-', '', $map_screen);
-	if ( in_array($type, get_post_types()) )
-		$map_screen = 'edit';
+	if ( is_string($screen) )
+		$screen = convert_to_screen($screen);
 
-	switch ( $map_screen ) {
+	switch ( $screen->base ) {
 		case 'edit':
 			$per_page_label = __('Posts per page:');
 			break;
@@ -3747,10 +3708,10 @@
 			return '';
 	}
 
-	$option = str_replace( '-', '_', "${screen}_per_page" );
+	$option = str_replace( '-', '_', "{$screen->id}_per_page" );
 	$per_page = (int) get_user_option( $option );
 	if ( empty( $per_page ) || $per_page < 1 ) {
-		if ( 'plugins' == $screen )
+		if ( 'plugins' == $screen->id )
 			$per_page = 999;
 		else
 			$per_page = 20;
@@ -3772,18 +3733,19 @@
 	return $return;
 }
 
-function screen_icon($name = '') {
-	global $parent_file, $hook_suffix;
+function screen_icon($screen = '') {
+	global $current_screen;
 
+	if ( empty($screen) )
+		$screen = $current_screen;
+	elseif ( is_string($screen) )
+		$name = $screen;
+
 	if ( empty($name) ) {
-		if ( isset($parent_file) && !empty($parent_file) ) {
-			$name = $parent_file;
-			if ( false !== $pos = strpos($name, '?post_type=') )
-				$name = substr($name, 0, $pos);
-			$name = substr($name, 0, -4);
-		}
+		if ( !empty($screen->parent_base) )
+			$name = $screen->parent_base;
 		else
-			$name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix);
+			$name = $screen->base;
 	}
 ?>
 	<div id="icon-<?php echo $name; ?>" class="icon32"><br /></div>
Index: wp-admin/post.php
===================================================================
--- wp-admin/post.php	(revision 12725)
+++ wp-admin/post.php	(working copy)
@@ -23,17 +23,29 @@
 else
 	$post_id = 0;
 $post_ID = $post_id;
-
 $post = null;
 $post_type_object = null;
 $post_type_cap = null;
+$post_type = null;
 if ( $post_id ) {
 	$post = get_post($post_id);
 	if ( $post ) {
 		$post_type_object = get_post_type_object($post->post_type);
-		if ( $post_type_object )
+		if ( $post_type_object ) {
+			$post_type = $post->post_type;
+			$current_screen->post_type = $post->post_type;
+			$current_screen->id = $current_screen->post_type;
 			$post_type_cap = $post_type_object->capability_type;
+		}
 	}
+} elseif ( isset($_POST['post_type']) ) {
+	$post_type_object = get_post_type_object($_POST['post_type']);
+	if ( $post_type_object ) {
+		$post_type = $post_type_object->name;
+		$current_screen->post_type = $post_type;
+		$current_screen->id = $current_screen->post_type;
+		$post_type_cap = $post_type_object->capability_type;
+	}
 }
 
 /**
@@ -108,7 +120,7 @@
 case 'post':
 case 'post-quickpress-publish':
 case 'post-quickpress-save':
-	check_admin_referer('add-post');
+	check_admin_referer('add-' . $post_type);
 
 	if ( 'post-quickpress-publish' == $action )
 		$_POST['publish'] = 'publish'; // tell write_post() to publish
@@ -163,17 +175,9 @@
 	if ( 'post' == $post_type ) {
 		$parent_file = "edit.php";
 		$submenu_file = "edit.php";
-	} elseif ( 'page' == $post_type ) {
-		$parent_file = "edit-pages.php";
-		$submenu_file = "edit-pages.php";
 	} else {
-		if ( $post_type_object->hierarchical ) {
-			$parent_file = "edit-pages.php?post_type=$post_type";
-			$submenu_file = "edit-pages.php?post_type=$post_type";
-		} else {
-			$parent_file = "edit.php?post_type=$post_type";
-			$submenu_file = "edit.php?post_type=$post_type";
-		}
+		$parent_file = "edit.php?post_type=$post_type";
+		$submenu_file = "edit.php?post_type=$post_type";
 	}
 
 	wp_enqueue_script('post');
@@ -213,7 +217,7 @@
 	wp_update_attachment_metadata( $post_id, $newmeta );
 
 case 'editpost':
-	check_admin_referer('update-' . $post->post_type . '_' . $post_id);
+	check_admin_referer('update-' . $post_type . '_' . $post_id);
 
 	$post_id = edit_post();
 
@@ -223,7 +227,7 @@
 	break;
 
 case 'trash':
-	check_admin_referer('trash-post_' . $post_id);
+	check_admin_referer('trash-' . $post_type . '_' . $post_id);
 
 	$post = & get_post($post_id);
 
@@ -238,7 +242,7 @@
 	break;
 
 case 'untrash':
-	check_admin_referer('untrash-post_' . $post_id);
+	check_admin_referer('untrash-' . $post_type . '_' . $post_id);
 
 	if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
 		wp_die( __('You are not allowed to move this item out of the trash.') );
@@ -251,7 +255,7 @@
 	break;
 
 case 'delete':
-	check_admin_referer('delete-post_' . $post_id);
+	check_admin_referer('delete-' . $post_type . '_' . $post_id);
 
 	if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
 		wp_die( __('You are not allowed to delete this item.') );
@@ -280,9 +284,6 @@
 	break;
 
 default:
-	if ( $post_type_object->hierarchical )
-		wp_redirect('edit-pages.php');
-	else
 		wp_redirect('edit.php');
 	exit();
 	break;
Index: wp-admin/admin.php
===================================================================
--- wp-admin/admin.php	(revision 12725)
+++ wp-admin/admin.php	(working copy)
@@ -177,4 +177,43 @@
 if ( !empty($_REQUEST['action']) )
 	do_action('admin_action_' . $_REQUEST['action']);
 
+$hook_suffix = '';
+if ( isset($page_hook) )
+	$hook_suffix = $page_hook;
+else if ( isset($plugin_page) )
+	$hook_suffix = $plugin_page;
+else if ( isset($pagenow) )
+	$hook_suffix = $pagenow;
+
+if ( isset($_GET['post_type']) )
+	$typenow = $_GET['post_type'];
+else
+	$typenow = '';
+// @todo validate typenow against post types.
+
+/**
+ * Global object containing info about the current screen.
+ */
+$current_screen = $hook_suffix;
+$current_screen = str_replace('.php', '', $current_screen);
+$current_screen = str_replace('-new', '', $current_screen);
+$current_screen = str_replace('-add', '', $current_screen);
+$current_screen = array('id' => $current_screen, 'base' => $current_screen);
+$current_screen = (object) $current_screen;
+if ( 'edit' == $current_screen->id ) {
+	if ( empty($typenow) )
+		$typenow = 'post';
+	$current_screen->id .= '-' . $typenow;
+	$current_screen->post_type = $typenow;
+} elseif ( 'post' == $current_screen->id ) {
+	if ( empty($typenow) )
+		$typenow = 'post';
+	$current_screen->id = $typenow;
+	$current_screen->post_type = $typenow;
+} else {
+	$typenow = '';
+}
+
+$current_screen = apply_filters('current_screen', $current_screen);
+
 ?>
Index: wp-admin/edit-post-rows.php
===================================================================
--- wp-admin/edit-post-rows.php	(revision 12725)
+++ wp-admin/edit-post-rows.php	(working copy)
@@ -13,17 +13,22 @@
 <table class="widefat post fixed" cellspacing="0">
 	<thead>
 	<tr>
-<?php print_column_headers('edit'); ?>
+<?php print_column_headers( $current_screen ); ?>
 	</tr>
 	</thead>
 
 	<tfoot>
 	<tr>
-<?php print_column_headers('edit', false); ?>
+<?php print_column_headers($current_screen, false); ?>
 	</tr>
 	</tfoot>
 
 	<tbody>
-<?php post_rows(); ?>
+<?php
+if ( $post_type_object->hierarchical )
+	page_rows($posts, $pagenum, $per_page);
+else
+	post_rows();
+?>
 	</tbody>
 </table>
\ No newline at end of file
Index: wp-admin/options-general.php
===================================================================
--- wp-admin/options-general.php	(revision 12725)
+++ wp-admin/options-general.php	(working copy)
@@ -50,6 +50,8 @@
 }
 add_filter('admin_head', 'add_js');
 
+add_contextual_help($current_screen, __('<a href="http://codex.wordpress.org/Settings_General_SubPanel" target="_blank">General Settings</a>'));
+
 include('./admin-header.php');
 ?>
 
Index: wp-admin/index.php
===================================================================
--- wp-admin/index.php	(revision 12725)
+++ wp-admin/index.php	(working copy)
@@ -23,6 +23,9 @@
 
 $title = __('Dashboard');
 $parent_file = 'index.php';
+
+add_contextual_help($current_screen, '<p>' . __('The modules on this screen can be arranged in several columns. You can select the number of columns from the Screen Options tab.') . "</p>\n" . drag_drop_help() );
+
 require_once('admin-header.php');
 
 $today = current_time('mysql', 1);
Index: wp-admin/edit-link-form.php
===================================================================
--- wp-admin/edit-link-form.php	(revision 12725)
+++ wp-admin/edit-link-form.php	(working copy)
@@ -34,6 +34,8 @@
 do_action('do_meta_boxes', 'link', 'advanced', $link);
 do_action('do_meta_boxes', 'link', 'side', $link);
 
+add_contextual_help($current_screen, drag_drop_help());
+
 require_once ('admin-header.php');
 
 ?>
Index: wp-admin/edit-form-advanced.php
===================================================================
--- wp-admin/edit-form-advanced.php	(revision 12725)
+++ wp-admin/edit-form-advanced.php	(working copy)
@@ -142,6 +142,8 @@
 do_action('do_meta_boxes', $post_type, 'advanced', $post);
 do_action('do_meta_boxes', $post_type, 'side', $post);
 
+add_contextual_help($current_screen, drag_drop_help());
+
 require_once('admin-header.php');
 ?>
 
Index: wp-admin/plugin-install.php
===================================================================
--- wp-admin/plugin-install.php	(revision 12725)
+++ wp-admin/plugin-install.php	(working copy)
@@ -52,6 +52,8 @@
 
 do_action('install_plugins_pre_' . $tab); //Used to override the general interface, Eg, install or plugin information.
 
+add_contextual_help($current_screen, plugins_search_help());
+
 include('admin-header.php');
 ?>
 <div class="wrap">
Index: wp-admin/menu.php
===================================================================
--- wp-admin/menu.php	(revision 12725)
+++ wp-admin/menu.php	(working copy)
@@ -68,10 +68,10 @@
 	$submenu['link-manager.php'][10] = array( _x('Add New', 'links'), 'manage_links', 'link-add.php' );
 	$submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
 
-$menu[20] = array( __('Pages'), 'edit_pages', 'edit-pages.php', '', 'menu-top', 'menu-pages', 'div' );
-	$submenu['edit-pages.php'][5] = array( __('Edit'), 'edit_pages', 'edit-pages.php' );
+$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top', 'menu-pages', 'div' );
+	$submenu['edit.php?post_type=page'][5] = array( __('Edit'), 'edit_pages', 'edit.php?post_type=page' );
 	/* translators: add new page */
-	$submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
+	$submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
 
 $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' );
 
Index: wp-admin/admin-header.php
===================================================================
--- wp-admin/admin-header.php	(revision 12725)
+++ wp-admin/admin-header.php	(working copy)
@@ -29,21 +29,6 @@
 	wp_admin_css( 'css/ms' );
 wp_enqueue_script('utils');
 
-$hook_suffix = '';
-if ( isset($page_hook) )
-	$hook_suffix = $page_hook;
-else if ( isset($plugin_page) )
-	$hook_suffix = $plugin_page;
-else if ( isset($pagenow) )
-	$hook_suffix = $pagenow;
-
-if ( isset($submenu_file) && (false !== $pos = strpos($submenu_file, 'post_type=')) )
-	$typenow = substr($submenu_file, $pos + 10);
-elseif ( isset($parent_file) && (false !== $pos = strpos($parent_file, 'post_type=')) )
-	$typenow = substr($parent_file, $pos + 10);
-else
-	$typenow = '';
-
 $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
 ?>
 <script type="text/javascript">
@@ -119,16 +104,22 @@
 <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
 </div>
 
-<?php favorite_actions($hook_suffix); ?>
+<?php favorite_actions($current_screen); ?>
 </div>
 </div>
 
 <div id="wpbody">
-<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
+<?php
+require(ABSPATH . 'wp-admin/menu-header.php');
 
+$current_screen->parent_file = $parent_file;
+$current_screen->parent_base = preg_replace('/\?.*$/', '', $parent_file);
+$current_screen->parent_base = str_replace('.php', '', $current_screen->parent_base);
+?>
+
 <div id="wpbody-content">
 <?php
-screen_meta($hook_suffix);
+screen_meta($current_screen);
 
 do_action('admin_notices');
 
Index: wp-admin/plugins.php
===================================================================
--- wp-admin/plugins.php	(revision 12725)
+++ wp-admin/plugins.php	(working copy)
@@ -236,7 +236,7 @@
 $help .= '<p>' . sprintf(__('You can find additional plugins for your site by using the new <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> directly and installing manually.  To <em>manually</em> install a plugin you generally just need to upload the plugin file into your <code>%2$s</code> directory.  Once a plugin has been installed, you may activate it here.'), 'plugin-install.php', WP_PLUGIN_DIR) . '</p>';
 }
 
-add_contextual_help('plugins', $help);
+add_contextual_help($current_screen, $help);
 
 if ( is_multisite() && is_super_admin() ) {
 	$menu_perms = get_site_option('menu_items', array());
Index: wp-admin/edit.php
===================================================================
--- wp-admin/edit.php	(revision 12725)
+++ wp-admin/edit.php	(working copy)
@@ -20,13 +20,14 @@
 	unset( $_redirect );
 }
 
-if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('_show' => true) ) ) )
+if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('_show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) )
 	$post_type = $_GET['post_type'];
 else
 	$post_type = 'post';
 $_GET['post_type'] = $post_type;
 
 $post_type_object = get_post_type_object($post_type);
+$post_type_cap = $post_type_object->capability_type;
 
 if ( 'post' != $post_type ) {
 	$parent_file = "edit.php?post_type=$post_type";
@@ -38,6 +39,16 @@
 	$post_new_file = 'post-new.php';
 }
 
+$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
+if ( empty($pagenum) )
+	$pagenum = 1;
+$per_page = 'edit_' . $post_type . '_per_page';
+$per_page = (int) get_user_option( $per_page );
+if ( empty( $per_page ) || $per_page < 1 )
+	$per_page = 15;
+// @todo filter based on type
+$per_page = apply_filters( 'edit_posts_per_page', $per_page );
+
 // Handle bulk actions
 if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
 	check_admin_referer('bulk-posts');
@@ -61,8 +72,8 @@
 		case 'trash':
 			$trashed = 0;
 			foreach( (array) $post_ids as $post_id ) {
-				if ( !current_user_can('delete_post', $post_id) )
-					wp_die( __('You are not allowed to move this post to the trash.') );
+				if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
+					wp_die( __('You are not allowed to move this item to the trash.') );
 
 				if ( !wp_trash_post($post_id) )
 					wp_die( __('Error in moving to trash...') );
@@ -74,8 +85,8 @@
 		case 'untrash':
 			$untrashed = 0;
 			foreach( (array) $post_ids as $post_id ) {
-				if ( !current_user_can('delete_post', $post_id) )
-					wp_die( __('You are not allowed to restore this post from the trash.') );
+				if ( !current_user_can('delete_' . $post_type_cap, $post_id) )
+					wp_die( __('You are not allowed to restore this item from the trash.') );
 
 				if ( !wp_untrash_post($post_id) )
 					wp_die( __('Error in restoring from trash...') );
@@ -89,8 +100,8 @@
 			foreach( (array) $post_ids as $post_id ) {
 				$post_del = & get_post($post_id);
 
-				if ( !current_user_can('delete_post', $post_id) )
-					wp_die( __('You are not allowed to delete this post.') );
+				if ( !current_user_can('delete_' .  $post_type_cap, $post_id) )
+					wp_die( __('You are not allowed to delete this item.') );
 
 				if ( $post_del->post_type == 'attachment' ) {
 					if ( ! wp_delete_attachment($post_id) )
@@ -130,7 +141,7 @@
 wp_enqueue_script('inline-edit-post');
 
 $user_posts = false;
-if ( !current_user_can('edit_others_posts') ) {
+if ( !current_user_can('edit_others_' . $post_type_cap . 's') ) {
 	$user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status != 'trash' AND post_author = %d", $post_type, $current_user->ID) );
 	$user_posts = true;
 	if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) )
@@ -139,11 +150,13 @@
 
 $avail_post_stati = wp_edit_posts_query();
 
+if ( $post_type_object->hierarchical )
+	$num_pages = ceil($wp_query->post_count / $per_page);
+else
+	$num_pages = $wp_query->max_num_pages;
+
 require_once('admin-header.php');
 
-if ( !isset( $_GET['paged'] ) )
-	$_GET['paged'] = 1;
-
 if ( empty($_GET['mode']) )
 	$mode = 'list';
 else
@@ -158,7 +171,7 @@
 
 <?php
 if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
-<div id="message" class="updated"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
+<div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
 endif; ?>
 
@@ -173,24 +186,24 @@
 	unset($_GET['skipped']);
 
 if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
-	printf( _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
+	printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
 	unset($_GET['locked']);
 }
 
 if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
-	printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
+	printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
 	unset($_GET['deleted']);
 }
 
 if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
-	printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
+	printf( _n( 'Item moved to the trash.', '%s items moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
 	$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
 	echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
 	unset($_GET['trashed']);
 }
 
 if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
-	printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
+	printf( _n( 'Item restored from the trash.', '%s items restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
 	unset($_GET['undeleted']);
 }
 
@@ -212,7 +225,7 @@
 if ( $user_posts ) {
 	if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
 		$class = ' class="current"';
-	$status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'My Posts <span class="count">(%s)</span>', 'My Posts <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
+	$status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
 	$allposts = '?all_posts=1';
 }
 
@@ -261,8 +274,8 @@
 	'format' => '',
 	'prev_text' => __('&laquo;'),
 	'next_text' => __('&raquo;'),
-	'total' => $wp_query->max_num_pages,
-	'current' => $_GET['paged']
+	'total' => $num_pages,
+	'current' => $pagenum
 ));
 
 $is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
@@ -318,23 +331,25 @@
 <?php } ?>
 
 <?php
-$dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1,
-	'show_count' => 0, 'orderby' => 'name', 'selected' => $cat);
-wp_dropdown_categories($dropdown_options);
-do_action('restrict_manage_posts');
+if ( is_object_in_taxonomy($post_type, 'category') ) {
+	$dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1,
+		'show_count' => 0, 'orderby' => 'name', 'selected' => $cat);
+	wp_dropdown_categories($dropdown_options);
+	do_action('restrict_manage_posts');
+}
 ?>
 <input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
 <?php }
 
-if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
+if ( $is_trash && current_user_can('edit_others_' . $post_type_cap .'s') ) { ?>
 <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
 <?php } ?>
 </div>
 
 <?php if ( $page_links ) { ?>
 <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
-	number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
-	number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
+	number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+	number_format_i18n( min( $pagenum * $per_page, $wp_query->found_posts ) ),
 	number_format_i18n( $wp_query->found_posts ),
 	$page_links
 ); echo $page_links_text; ?></div>
@@ -373,7 +388,7 @@
 <?php } ?>
 </select>
 <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-<?php if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
+<?php if ( $is_trash && current_user_can('edit_others_' . $post_type_cap . 's') ) { ?>
 <input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
 <?php } ?>
 <br class="clear" />
@@ -393,7 +408,7 @@
 
 </form>
 
-<?php inline_edit_row( 'post' ); ?>
+<?php inline_edit_row( $current_screen ); ?>
 
 <div id="ajax-response"></div>
 <br class="clear" />
Index: wp-admin/theme-install.php
===================================================================
--- wp-admin/theme-install.php	(revision 12725)
+++ wp-admin/theme-install.php	(working copy)
@@ -52,6 +52,8 @@
 
 do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
 
+add_contextual_help($current_screen, plugins_search_help());
+
 include('admin-header.php');
 ?>
 <div class="wrap">
Index: wp-admin/widgets.php
===================================================================
--- wp-admin/widgets.php	(revision 12725)
+++ wp-admin/widgets.php	(working copy)
@@ -33,6 +33,14 @@
 $title = __( 'Widgets' );
 $parent_file = 'themes.php';
 
+$help = '
+	<p>' . __('Widgets are added and arranged by simple drag &#8217;n&#8217; drop. If you hover your mouse over the titlebar of a widget, you&#8217;ll see a 4-arrow cursor which indicates that the widget is movable.  Click on the titlebar, hold down the mouse button and drag the widget to a sidebar. As you drag, you&#8217;ll see a dotted box that also moves. This box shows where the widget will go once you drop it.') . '</p>
+	<p>' . __('To remove a widget from a sidebar, drag it back to Available Widgets or click on the arrow on its titlebar to reveal its settings, and then click Remove.') . '</p>
+	<p>' . __('To remove a widget from a sidebar <em>and keep its configuration</em>, drag it to Inactive Widgets.') . '</p>
+	<p>' . __('The Inactive Widgets area stores widgets that are configured but not curently used. If you change themes and the new theme has fewer sidebars than the old, all extra widgets will be stored to Inactive Widgets automatically.') . '</p>
+';
+add_contextual_help($current_screen, $help);
+
 // register the inactive_widgets area as sidebar
 register_sidebar(array(
 	'name' => __('Inactive Widgets'),
Index: wp-admin/edit-pages.php
===================================================================
--- wp-admin/edit-pages.php	(revision 12725)
+++ wp-admin/edit-pages.php	(working copy)
@@ -1,384 +0,0 @@
-<?php
-/**
- * Edit Pages Administration Panel.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** WordPress Administration Bootstrap */
-require_once('admin.php');
-
-if ( !current_user_can('edit_pages') )
-	wp_die(__('Cheatin&#8217; uh?'));
-
-// Handle bulk actions
-if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
-	check_admin_referer('bulk-pages');
-	$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
-
-	if ( strpos($sendback, 'page.php') !== false )
-		$sendback = admin_url('post-new.php?post_type=page');
-
-	if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
-		$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
-		$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) );
-		$doaction = 'delete';
-	} elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
-		$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
-		$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
-	} else {
-		wp_redirect( admin_url('edit-pages.php') );
-	}
-
-	switch ( $doaction ) {
-		case 'trash':
-			$trashed = 0;
-			foreach( (array) $post_ids as $post_id ) {
-				if ( !current_user_can('delete_page', $post_id) )
-					wp_die( __('You are not allowed to move this page to the trash.') );
-
-				if ( !wp_trash_post($post_id) )
-					wp_die( __('Error in moving to trash...') );
-
-				$trashed++;
-			}
-			$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
-			break;
-		case 'untrash':
-			$untrashed = 0;
-			foreach( (array) $post_ids as $post_id ) {
-				if ( !current_user_can('delete_page', $post_id) )
-					wp_die( __('You are not allowed to restore this page from the trash.') );
-
-				if ( !wp_untrash_post($post_id) )
-					wp_die( __('Error in restoring from trash...') );
-
-				$untrashed++;
-			}
-			$sendback = add_query_arg('untrashed', $untrashed, $sendback);
-			break;
-		case 'delete':
-			$deleted = 0;
-			foreach( (array) $post_ids as $post_id ) {
-				$post_del = & get_post($post_id);
-
-				if ( !current_user_can('delete_page', $post_id) )
-					wp_die( __('You are not allowed to delete this page.') );
-
-				if ( $post_del->post_type == 'attachment' ) {
-					if ( ! wp_delete_attachment($post_id) )
-						wp_die( __('Error in deleting...') );
-				} else {
-					if ( !wp_delete_post($post_id) )
-						wp_die( __('Error in deleting...') );
-				}
-				$deleted++;
-			}
-			$sendback = add_query_arg('deleted', $deleted, $sendback);
-			break;
-		case 'edit':
-			$_GET['post_type'] = 'page';
-			$done = bulk_edit_posts($_GET);
-
-			if ( is_array($done) ) {
-				$done['updated'] = count( $done['updated'] );
-				$done['skipped'] = count( $done['skipped'] );
-				$done['locked'] = count( $done['locked'] );
-				$sendback = add_query_arg( $done, $sendback );
-			}
-			break;
-	}
-
-	if ( isset($_GET['action']) )
-		$sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status',  'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
-
-	wp_redirect($sendback);
-	exit();
-} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
-	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
-	 exit;
-}
-
-if ( empty($title) )
-	$title = __('Edit Pages');
-$parent_file = 'edit-pages.php';
-wp_enqueue_script('inline-edit-post');
-
-$post_stati  = array(	//	array( adj, noun )
-		'publish' => array(_x('Published', 'page'), __('Published pages'), _nx_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>', 'page')),
-		'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>', 'page')),
-		'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>', 'page')),
-		'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'page')),
-		'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
-		'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
-	);
-
-if ( !EMPTY_TRASH_DAYS )
-	unset($post_stati['trash']);
-
-$post_stati = apply_filters('page_stati', $post_stati);
-
-$query = array('post_type' => 'page', 'orderby' => 'menu_order title',
-	'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => 'asc');
-
-$post_status_label = __('Pages');
-if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
-	$post_status_label = $post_stati[$_GET['post_status']][1];
-	$query['post_status'] = $_GET['post_status'];
-	$query['perm'] = 'readable';
-}
-
-$query = apply_filters('manage_pages_query', $query);
-wp($query);
-
-if ( is_singular() ) {
-	wp_enqueue_script( 'admin-comments' );
-	enqueue_comment_hotkeys_js();
-}
-
-require_once('admin-header.php'); ?>
-
-<div class="wrap">
-<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title ); ?> <a href="post-new.php?post_type=page" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php
-if ( isset($_GET['s']) && $_GET['s'] )
-	printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( get_search_query() ) ); ?>
-</h2>
-
-<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
-<div id="message" class="updated"><p>
-<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
-	printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
-	unset($_GET['updated']);
-}
-if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
-	printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
-	unset($_GET['skipped']);
-}
-if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
-	printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
-	unset($_GET['locked']);
-}
-if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
-	printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
-	unset($_GET['deleted']);
-}
-if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
-	printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
-	$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
-	echo ' <a href="' . esc_url( wp_nonce_url( "edit-pages.php?doaction=undo&action=untrash&ids=$ids", "bulk-pages" ) ) . '">' . __('Undo') . '</a><br />';
-	unset($_GET['trashed']);
-}
-if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
-	printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
-	unset($_GET['untrashed']);
-}
-$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
-?>
-</p></div>
-<?php } ?>
-
-<?php if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
-<div id="message" class="updated"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div>
-<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
-endif; ?>
-
-<form id="posts-filter" action="<?php echo admin_url('edit-pages.php'); ?>" method="get">
-<ul class="subsubsub">
-<?php
-
-$avail_post_stati = get_available_post_statuses('page');
-if ( empty($locked_post_status) ) :
-$status_links = array();
-$num_posts = wp_count_posts('page', 'readable');
-$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
-$class = empty($_GET['post_status']) ? ' class="current"' : '';
-$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '</a>';
-foreach ( $post_stati as $status => $label ) {
-	$class = '';
-
-	if ( !in_array($status, $avail_post_stati) || $num_posts->$status <= 0 )
-		continue;
-
-	if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] )
-		$class = ' class="current"';
-
-	$status_links[] = "<li><a href='edit-pages.php?post_status=$status'$class>" . sprintf( _nx( $label[2][0], $label[2][1], $num_posts->$status, $label[2][2] ), number_format_i18n( $num_posts->$status ) ) . '</a>';
-}
-echo implode( " |</li>\n", $status_links ) . '</li>';
-unset($status_links);
-endif;
-?>
-</ul>
-
-<p class="search-box">
-	<label class="screen-reader-text" for="page-search-input"><?php _e( 'Search Pages' ); ?>:</label>
-	<input type="text" id="page-search-input" name="s" value="<?php _admin_search_query(); ?>" />
-	<input type="submit" value="<?php esc_attr_e( 'Search Pages' ); ?>" class="button" />
-</p>
-
-<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
-
-<?php if ($posts) { ?>
-
-<div class="tablenav">
-
-<?php
-$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
-if ( empty($pagenum) )
-	$pagenum = 1;
-$per_page = (int) get_user_option( 'edit_pages_per_page' );
-if ( empty( $per_page ) || $per_page < 1 )
-	$per_page = 20;
-$per_page = apply_filters( 'edit_pages_per_page', $per_page );
-
-$num_pages = ceil($wp_query->post_count / $per_page);
-$page_links = paginate_links( array(
-	'base' => add_query_arg( 'pagenum', '%#%' ),
-	'format' => '',
-	'prev_text' => __('&laquo;'),
-	'next_text' => __('&raquo;'),
-	'total' => $num_pages,
-	'current' => $pagenum
-));
-
-$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
-
-if ( $page_links ) : ?>
-<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
-	number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
-	number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ),
-	number_format_i18n( $wp_query->post_count ),
-	$page_links
-); echo $page_links_text; ?></div>
-<?php endif; ?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<?php wp_nonce_field('bulk-pages'); ?>
-<?php if ( $is_trash ) { ?>
-<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-</div>
-
-<br class="clear" />
-</div>
-
-<div class="clear"></div>
-
-<table class="widefat page fixed" cellspacing="0">
-  <thead>
-  <tr>
-<?php print_column_headers('edit-pages'); ?>
-  </tr>
-  </thead>
-
-  <tfoot>
-  <tr>
-<?php print_column_headers('edit-pages', false); ?>
-  </tr>
-  </tfoot>
-
-  <tbody>
-  <?php page_rows($posts, $pagenum, $per_page); ?>
-  </tbody>
-</table>
-
-<div class="tablenav">
-<?php
-if ( $page_links )
-	echo "<div class='tablenav-pages'>$page_links_text</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-<?php if ( $is_trash ) { ?>
-<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-</div>
-
-<br class="clear" />
-</div>
-
-<?php } else { ?>
-<div class="clear"></div>
-<p><?php _e('No pages found.') ?></p>
-<?php
-} // end if ($posts)
-?>
-
-</form>
-
-<?php inline_edit_row( 'page' ) ?>
-
-<div id="ajax-response"></div>
-
-
-<?php
-
-if ( 1 == count($posts) && is_singular() ) :
-
-	$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
-	if ( $comments ) :
-		// Make sure comments, post, and post_author are cached
-		update_comment_cache($comments);
-		$post = get_post($id);
-		$authordata = get_userdata($post->post_author);
-	?>
-
-<br class="clear" />
-
-<table class="widefat" cellspacing="0">
-<thead>
-  <tr>
-    <th scope="col" class="column-comment">
-		<?php  /* translators: column name */ echo _x('Comment', 'column name') ?>
-	</th>
-    <th scope="col" class="column-author"><?php _e('Author') ?></th>
-    <th scope="col" class="column-date"><?php _e('Submitted') ?></th>
-  </tr>
-</thead>
-<tbody id="the-comment-list" class="list:comment">
-<?php
-	foreach ($comments as $comment)
-		_wp_comment_row( $comment->comment_ID, 'single', false, false );
-?>
-</tbody>
-</table>
-
-<?php
-wp_comment_reply();
-endif; // comments
-endif; // posts;
-
-?>
-
-</div>
-
-<?php
-include('admin-footer.php');
Index: wp-admin/themes.php
===================================================================
--- wp-admin/themes.php	(revision 12725)
+++ wp-admin/themes.php	(working copy)
@@ -61,7 +61,7 @@
 	$help .= '<p>' . __('Once a theme is uploaded, you should see it on this page.') . '</p>' ;
 }
 
-add_contextual_help('themes', $help);
+add_contextual_help($current_screen, $help);
 
 add_thickbox();
 wp_enqueue_script( 'theme-preview' );
