X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..2394dc71e94f8323dc422e89f9841959de78d328:/wp-admin/includes/template.php
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index db80bf80..3d0c1162 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1,127 +1,23 @@
0);
- if ( !empty($_GET['s']) )
- $args['search'] = $_GET['s'];
- $categories = get_categories( $args );
- }
-
- $children = _get_term_hierarchy('category');
-
- if ( $categories ) {
- ob_start();
- foreach ( $categories as $category ) {
- if ( $category->parent == $parent) {
- echo "\t" . _cat_row( $category, $level );
- if ( isset($children[$category->term_id]) )
- cat_rows( $category->term_id, $level +1, $categories );
- }
- }
- $output = ob_get_contents();
- ob_end_clean();
-
- $output = apply_filters('cat_rows', $output);
-
- echo $output;
- } else {
- return false;
- }
-}
-
-function _cat_row( $category, $level, $name_override = false ) {
- global $class;
-
- $category = get_category( $category );
-
- $pad = str_repeat( '— ', $level );
- $name = ( $name_override ? $name_override : $pad . ' ' . $category->name );
- if ( current_user_can( 'manage_categories' ) ) {
- $edit = "name)) . "'>$name ";
- } else {
- $edit = $name;
- }
-
- $class = " class='alternate'" == $class ? '' : " class='alternate'";
-
- $category->count = number_format_i18n( $category->count );
- $posts_count = ( $category->count > 0 ) ? "$category->count " : $category->count;
- $output = "
-
-
- $column_display_name) {
-
- switch ($column_name) {
-
- case 'cb':
- ?>
-
- post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- } else {
- if ( 'modified' == $column_name ) {
- $t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
- $m_time = $page->post_modified;
- $time = get_post_modified_time('G', true);
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $page->post_date;
- $time = get_post_time('G', true);
- }
- if ( ( abs(time() - $time) ) < 86400 ) {
- if ( ( 'future' == $page->post_status) )
- $h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
- else
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- } else {
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
- }
- ?>
-
-
- ">
- post_status) _e(' — Private '); ?>
-
-
- ID );
- $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
- if ( $left )
- echo '
';
- comments_number(" ', " ', " ');
- if ( $left )
- echo ' ';
- ?>
-
-
-
- post_type);
+ if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) )
+ return;
- case 'status':
- ?>
-
- " rel="permalink">
- post_status ) {
- case 'publish' :
- case 'private' :
- _e('Published');
- break;
- case 'future' :
- _e('Scheduled');
- break;
- case 'pending' :
- _e('Pending Review');
- break;
- case 'draft' :
- _e('Unpublished');
- break;
- }
- ?>
-
-
- post_title ) );
- default:
- ?>
-
- ID . '">
+ ' . $title . '
+ ' . apply_filters('editable_slug', $post->post_name) . '
+ ' . $post->post_author . '
+
+ ' . esc_html( $post->ping_status ) . '
+ ' . esc_html( $post->post_status ) . '
+ ' . mysql2date( 'd', $post->post_date, false ) . '
+ ' . mysql2date( 'm', $post->post_date, false ) . '
+ ' . mysql2date( 'Y', $post->post_date, false ) . '
+ ' . mysql2date( 'H', $post->post_date, false ) . '
+ ' . mysql2date( 'i', $post->post_date, false ) . '
+ ' . mysql2date( 's', $post->post_date, false ) . '
+ ' . esc_html( $post->post_password ) . '
';
+
+ if ( $post_type_object->hierarchical )
+ echo '' . $post->post_parent . '
';
+
+ if ( $post->post_type == 'page' )
+ echo '' . esc_html( get_post_meta( $post->ID, '_wp_page_template', true ) ) . '
';
+
+ if ( $post_type_object->hierarchical )
+ echo '';
+
+ $taxonomy_names = get_object_taxonomies( $post->post_type );
+ foreach ( $taxonomy_names as $taxonomy_name) {
+ $taxonomy = get_taxonomy( $taxonomy_name );
+
+ if ( $taxonomy->hierarchical && $taxonomy->show_ui )
+ echo '' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '
';
+ elseif ( $taxonomy->show_ui )
+ echo '' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '
';
}
-}
- ?>
-
-
-hierarchical )
+ echo '' . (is_sticky($post->ID) ? 'sticky' : '') . '
';
- for ( $i = 0; $i < count($children_pages); $i++ ) {
+ if ( post_type_supports( $post->post_type, 'post-formats' ) )
+ echo '' . esc_html( get_post_format( $post->ID ) ) . '
';
- $child = $children_pages[$i];
-
- if ( $child->post_parent == $id ) {
- array_splice($children_pages, $i, 1);
- display_page_row($child, $children_pages, $level+1);
- $i = -1; //as numeric keys in $children_pages are not preserved after splice
- }
- }
+ echo '';
}
-/*
- * displays pages in hierarchical order
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.7.0
+ *
+ * @param unknown_type $position
+ * @param unknown_type $checkbox
+ * @param unknown_type $mode
*/
-function page_rows( $pages ) {
- if ( ! $pages )
- $pages = get_pages( 'sort_column=menu_order' );
-
- if ( ! $pages )
- return false;
-
- // splice pages into two parts: those without parent and those with parent
-
- $top_level_pages = array();
- $children_pages = array();
-
- foreach ( $pages as $page ) {
-
- // catch and repair bad pages
- if ( $page->post_parent == $page->ID ) {
- $page->post_parent = 0;
- $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
- clean_page_cache( $page->ID );
- }
-
- if ( 0 == $page->post_parent )
- $top_level_pages[] = $page;
- else
- $children_pages[] = $page;
- }
-
- foreach ( $top_level_pages as $page )
- display_page_row($page, $children_pages, 0);
-
- /*
- * display the remaining children_pages which are orphans
- * having orphan requires parental attention
- */
- if ( count($children_pages) > 0 ) {
- $empty_array = array();
- foreach ( $children_pages as $orphan_page ) {
- clean_page_cache( $orphan_page->ID);
- display_page_row( $orphan_page, $empty_array, 0 );
- }
- }
-}
-
-function user_row( $user_object, $style = '', $role = '' ) {
- global $wp_roles;
-
- $current_user = wp_get_current_user();
-
- if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
- $user_object = new WP_User( (int) $user_object );
- $email = $user_object->user_email;
- $url = $user_object->user_url;
- $short_url = str_replace( 'http://', '', $url );
- $short_url = str_replace( 'www.', '', $short_url );
- if ('/' == substr( $short_url, -1 ))
- $short_url = substr( $short_url, 0, -1 );
- if ( strlen( $short_url ) > 35 )
- $short_url = substr( $short_url, 0, 32 ).'...';
- $numposts = get_usernumposts( $user_object->ID );
- if ( current_user_can( 'edit_user', $user_object->ID ) ) {
- if ($current_user->ID == $user_object->ID) {
- $edit = 'profile.php';
- } else {
- $edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
- }
- $edit = "";
- $r .= "\n\t\t ";
- $r .= "\n\t\t ";
- $r .= "\n\t\t ";
- $r .= "\n\t\t ";
+ $r .= "\n\t\t" . __( 'Key' ) . " ";
+
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta", "deletemeta[{$entry['meta_id']}]", false, array( 'tabindex' => '6' ) );
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , 'updatemeta', false, array( 'tabindex' => '6' ) );
+ $r .= "
";
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
- $r .= " \n\t ";
+ $r .= "";
+
+ $r .= "\n\t\t