]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/template.php
Wordpress 3.2
[autoinstalls/wordpress.git] / wp-admin / includes / template.php
index 2f16b3c125806cedcf673216222799757a3188d8..a488baf84dadc5c04f6e9cfe30d4c04be2f35470 100644 (file)
@@ -425,7 +425,7 @@ function list_meta( $meta ) {
 <table id="list-table" style="display: none;">
        <thead>
        <tr>
-               <th class="left">' . __( 'Name' ) . '</th>
+               <th class="left">' . _x( 'Name', 'meta name' ) . '</th>
                <th>' . __( 'Value' ) . '</th>
        </tr>
        </thead>
@@ -440,7 +440,7 @@ function list_meta( $meta ) {
 <table id="list-table">
        <thead>
        <tr>
-               <th class="left"><?php _e( 'Name' ) ?></th>
+               <th class="left"><?php _ex( 'Name', 'meta name' ) ?></th>
                <th><?php _e( 'Value' ) ?></th>
        </tr>
        </thead>
@@ -535,7 +535,7 @@ function meta_form() {
 <table id="newmeta">
 <thead>
 <tr>
-<th class="left"><label for="metakeyselect"><?php _e( 'Name' ) ?></label></th>
+<th class="left"><label for="metakeyselect"><?php _ex( 'Name', 'meta name' ) ?></label></th>
 <th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
 </tr>
 </thead>
@@ -942,10 +942,12 @@ function do_meta_boxes($page, $context, $object) {
        do {
                // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
                if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
-                       foreach ( $sorted as $box_context => $ids )
-                               foreach ( explode(',', $ids) as $id )
-                                       if ( $id )
+                       foreach ( $sorted as $box_context => $ids ) {
+                               foreach ( explode(',', $ids ) as $id ) {
+                                       if ( $id && 'dashboard_browser_nag' !== $id )
                                                add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
+                               }
+                       }
                }
                $already_sorted = true;
 
@@ -961,7 +963,8 @@ function do_meta_boxes($page, $context, $object) {
                                        $style = '';
                                        $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
                                        echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
-                                       echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
+                                       if ( 'dashboard_browser_nag' != $box['id'] )
+                                               echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
                                        echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
                                        echo '<div class="inside">' . "\n";
                                        call_user_func($box['callback'], $object, $box);
@@ -1627,16 +1630,16 @@ function _post_states($post) {
                $post_status = '';
 
        if ( !empty($post->post_password) )
-               $post_states[] = __('Password protected');
+               $post_states['protected'] = __('Password protected');
        if ( 'private' == $post->post_status && 'private' != $post_status )
-               $post_states[] = __('Private');
+               $post_states['private'] = __('Private');
        if ( 'draft' == $post->post_status && 'draft' != $post_status )
-               $post_states[] = __('Draft');
+               $post_states['draft'] = __('Draft');
        if ( 'pending' == $post->post_status && 'pending' != $post_status )
                /* translators: post state */
-               $post_states[] = _x('Pending', 'post state');
+               $post_states['pending'] = _x('Pending', 'post state');
        if ( is_sticky($post->ID) )
-               $post_states[] = __('Sticky');
+               $post_states['sticky'] = __('Sticky');
 
        $post_states = apply_filters( 'display_post_states', $post_states );
 
@@ -1655,6 +1658,36 @@ function _post_states($post) {
                echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
 }
 
+function _media_states( $post ) {
+       $media_states = array();
+       $stylesheet = get_option('stylesheet');
+
+       if ( current_theme_supports( 'custom-header') ) {
+               $meta_header = get_post_meta($post->ID, '_wp_attachment_is_custom_header', true );
+               if ( ! empty( $meta_header ) && $meta_header == $stylesheet )
+                       $media_states[] = __( 'Header Image' );
+       }
+
+       if ( current_theme_supports( 'custom-background') ) {
+               $meta_background = get_post_meta($post->ID, '_wp_attachment_is_custom_background', true );
+               if ( ! empty( $meta_background ) && $meta_background == $stylesheet )
+                       $media_states[] = __( 'Background Image' );
+       }
+
+       $media_states = apply_filters( 'display_media_states', $media_states );
+
+       if ( ! empty( $media_states ) ) {
+               $state_count = count( $media_states );
+               $i = 0;
+               echo ' - ';
+               foreach ( $media_states as $state ) {
+                       ++$i;
+                       ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+                       echo "<span class='post-state'>$state$sep</span>";
+               }
+       }
+}
+
 /**
  * Convert a screen string to a screen object
  *
@@ -1717,6 +1750,8 @@ function screen_meta($screen) {
        if ( !empty($wp_current_screen_options) )
                $show_screen = true;
 
+       $show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen);
+
 ?>
 <div id="screen-meta">
 <?php if ( $show_screen ) : ?>
@@ -1922,7 +1957,11 @@ function screen_options($screen) {
        return $return;
 }
 
-function screen_icon($screen = '') {
+function screen_icon( $screen = '' ) {
+       echo get_screen_icon( $screen );
+}
+
+function get_screen_icon( $screen = '' ) {
        global $current_screen, $typenow;
 
        if ( empty($screen) )
@@ -1950,9 +1989,7 @@ function screen_icon($screen = '') {
                        $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type );
        }
 
-?>
-       <div id="icon-<?php echo $name; ?>" class="<?php echo $class; ?>"><br /></div>
-<?php
+       return '<div id="icon-' . esc_attr( $name ) . '" class="' . $class . '"><br /></div>';
 }
 
 /**
@@ -2189,4 +2226,3 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $
 
        return $button;
 }
-