Changeset 8894
- Timestamp:
- 09/15/2008 05:53:30 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
wp-admin/edit-attachment-rows.php (modified) (11 diffs)
-
wp-admin/includes/template.php (modified) (2 diffs)
-
wp-admin/js/media.js (added)
-
wp-admin/upload.php (modified) (3 diffs)
-
wp-includes/script-loader.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r8682 r8894 13 13 <tr> 14 14 15 <?php $posts_columns = wp_manage_media_columns(); ?> 16 <?php foreach($posts_columns as $post_column_key => $column_display_name) { 15 <?php 16 $posts_columns = wp_manage_media_columns(); 17 $hidden = (array) get_user_option( 'manage-media-columns-hidden' ); 18 ?> 19 <?php foreach ($posts_columns as $post_column_key => $column_display_name ) { 17 20 if ( 'cb' === $post_column_key ) 18 21 $class = ' class="check-column"'; 19 22 elseif ( 'comments' === $post_column_key ) 20 $class = ' class="num"'; 23 $class = ' class="manage-column column-comments num"'; 24 elseif ( 'modified' === $post_column_key ) 25 $class = ' class="manage-column column-date"'; 21 26 else 22 $class = ''; 23 ?> 24 <th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th> 27 $class = " class=\"manage-column column-$post_column_key\""; 28 29 $style = ''; 30 if ( in_array($post_column_key, $hidden) ) 31 $style = ' style="display:none;"'; 32 ?> 33 <th scope="col"<?php echo "id=\"$post_column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> 25 34 <?php } ?> 26 35 … … 45 54 <?php 46 55 47 foreach($posts_columns as $column_name=>$column_display_name) { 56 foreach ($posts_columns as $column_name => $column_display_name ) { 57 $class = "class=\"$column_name column-$column_name\""; 58 59 $style = ''; 60 if ( in_array($column_name, $hidden) ) 61 $style = ' style="display:none;"'; 62 63 $attributes = "$class$style"; 48 64 49 65 switch($column_name) { … … 51 67 case 'cb': 52 68 ?> 53 <th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /></th>69 <th scope="row" <?php echo $attributes ?>><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /></th> 54 70 <?php 55 71 break; 56 72 57 73 case 'icon': 74 $attributes = 'class="post-title column-title"' . $style; 58 75 ?> 59 76 <td class="media-icon"><?php … … 73 90 case 'media': 74 91 ?> 75 <td ><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />92 <td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br /> 76 93 <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?> 77 94 <p> … … 87 104 case 'tags': 88 105 ?> 89 <td ><?php106 <td <?php echo $attributes ?>><?php 90 107 $tags = get_the_tags(); 91 108 if ( !empty( $tags ) ) { … … 103 120 case 'desc': 104 121 ?> 105 <td ><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>122 <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td> 106 123 <?php 107 124 break; … … 124 141 } 125 142 ?> 126 <td ><?php echo $h_time ?></td>143 <td <?php echo $attributes ?>><?php echo $h_time ?></td> 127 144 <?php 128 145 break; … … 137 154 } 138 155 ?> 139 <td ><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>, <?php echo get_the_time(__('Y/m/d')); ?></td>156 <td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>, <?php echo get_the_time(__('Y/m/d')); ?></td> 140 157 <?php 141 158 } else { 142 159 ?> 143 <td > </td>160 <td <?php echo $attributes ?>> </td> 144 161 <?php 145 162 } … … 148 165 149 166 case 'comments': 150 ?> 151 <td class="num"><div class="post-com-count-wrapper"> 167 $attributes = 'class="comments column-comments num"' . $style; 168 ?> 169 <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> 152 170 <?php 153 171 $left = get_pending_comments_num( $post->ID ); … … 165 183 case 'actions': 166 184 ?> 167 <td >185 <td <?php echo $attributes ?>> 168 186 <a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php _e('Edit'); ?></a> | 169 187 <a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a> … … 174 192 default: 175 193 ?> 176 <td ><?php do_action('manage_media_custom_column', $column_name, $id); ?></td>194 <td <?php echo $attributes ?>><?php do_action('manage_media_custom_column', $column_name, $id); ?></td> 177 195 <?php 178 196 break; -
trunk/wp-admin/includes/template.php
r8889 r8894 372 372 $posts_columns['date'] = _c('Date Added|media column header'); 373 373 $posts_columns['parent'] = _c('Appears with|media column header'); 374 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 374 //$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 375 $posts_columns['comments'] = __('Comments'); 375 376 // $posts_columns['actions'] = _c('Actions|media column header'); 376 377 $posts_columns = apply_filters('manage_media_columns', $posts_columns); … … 1993 1994 foreach ( $columns as $column => $title ) { 1994 1995 // Can't hide these 1995 if ( 'cb' == $column || 'title' == $column || 'name' == $column )1996 if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'media' == $column ) 1996 1997 continue; 1998 if ( empty($title) ) 1999 continue; 2000 1997 2001 if ( 'comments' == $column ) 1998 2002 $title = __('Comments'); -
trunk/wp-admin/upload.php
r8867 r8894 49 49 $parent_file = 'edit.php'; 50 50 wp_enqueue_script( 'admin-forms' ); 51 wp_enqueue_script('media'); 51 52 52 53 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); … … 75 76 76 77 <form id="posts-filter" action="" method="get"> 78 79 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 80 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 81 82 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 83 <div id="edit-settings-wrap"> 84 <h5><?php _e('Show on screen') ?></h5> 85 <div class="metabox-prefs"> 86 <?php manage_columns_prefs('media') ?> 87 <br class="clear" /> 88 </div></div> 89 </div> 90 77 91 <h2><?php 78 92 if ( is_singular() ) { … … 215 229 <?php include( 'edit-attachment-rows.php' ); ?> 216 230 231 <?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?> 232 217 233 </form> 218 234 -
trunk/wp-includes/script-loader.php
r8888 r8894 264 264 $scripts->add( 'pages', '/wp-admin/js/pages.js', array('columns'), '20080910' ); 265 265 $scripts->add( 'links', '/wp-admin/js/links.js', array('columns'), '20080913' ); 266 $scripts->add( 'media', '/wp-admin/js/media.js', array('columns'), '20080915' ); 266 267 267 268 $scripts->add( 'columns', '/wp-admin/js/columns.js', false, '20080910' );
Note: See TracChangeset
for help on using the changeset viewer.