Changeset 8923
- Timestamp:
- 09/18/2008 05:41:45 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
wp-admin/categories.php (modified) (3 diffs)
-
wp-admin/edit-attachment-rows.php (modified) (2 diffs)
-
wp-admin/edit-link-categories.php (modified) (3 diffs)
-
wp-admin/edit-pages.php (modified) (1 diff)
-
wp-admin/edit-post-rows.php (modified) (1 diff)
-
wp-admin/edit-tags.php (modified) (2 diffs)
-
wp-admin/includes/template.php (modified) (2 diffs)
-
wp-admin/js/categories.js (modified) (1 diff)
-
wp-admin/js/tags.js (modified) (1 diff)
-
wp-admin/link-manager.php (modified) (5 diffs)
-
wp-includes/script-loader.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/categories.php
r8867 r8923 135 135 <div class="wrap"> 136 136 <form id="posts-filter" action="" method="get"> 137 138 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 139 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 140 141 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 142 <div id="edit-settings-wrap"> 143 <h5><?php _e('Show on screen') ?></h5> 144 <div class="metabox-prefs"> 145 <?php manage_columns_prefs('category') ?> 146 <br class="clear" /> 147 </div></div> 148 </div> 149 137 150 <h2><?php printf( current_user_can('manage_categories') ? __('Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2> 138 151 … … 176 189 <thead> 177 190 <tr> 178 <th scope="col" class="check-column"><input type="checkbox" /></th> 179 <th scope="col"><?php _e('Name') ?></th> 180 <th scope="col"><?php _e('Description') ?></th> 181 <th scope="col" class="num"><?php _e('Posts') ?></th> 191 <?php print_column_headers('category'); ?> 182 192 </tr> 183 193 </thead> … … 188 198 </tbody> 189 199 </table> 200 201 <?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?> 202 190 203 </form> 191 204 -
trunk/wp-admin/edit-attachment-rows.php
r8901 r8923 12 12 <thead> 13 13 <tr> 14 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 ) { 20 if ( 'cb' === $post_column_key ) 21 $class = ' class="check-column"'; 22 elseif ( 'comments' === $post_column_key ) 23 $class = ' class="manage-column column-comments num"'; 24 elseif ( 'modified' === $post_column_key ) 25 $class = ' class="manage-column column-date"'; 26 else 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> 34 <?php } ?> 35 14 <?php print_column_headers('media'); ?> 36 15 </tr> 37 16 </thead> … … 53 32 54 33 <?php 55 34 $posts_columns = wp_manage_media_columns(); 56 35 foreach ($posts_columns as $column_name => $column_display_name ) { 57 36 $class = "class=\"$column_name column-$column_name\""; -
trunk/wp-admin/edit-link-categories.php
r8867 r8923 76 76 77 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('link-category') ?> 87 <br class="clear" /> 88 </div></div> 89 </div> 90 78 91 <h2><?php printf( current_user_can('manage_categories') ? __('Link Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2> 79 92 … … 117 130 <thead> 118 131 <tr> 119 <th scope="col" class="check-column"><input type="checkbox" /></th> 120 <th scope="col"><?php _e('Name') ?></th> 121 <th scope="col"><?php _e('Description') ?></th> 122 <th scope="col" class="num" style="width: 90px;"><?php _e('Links') ?></th> 132 <?php print_column_headers('link-category'); ?> 123 133 </tr> 124 134 </thead> … … 145 155 </tbody> 146 156 </table> 157 158 <?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?> 159 147 160 </form> 148 161 -
trunk/wp-admin/edit-pages.php
r8883 r8923 193 193 <thead> 194 194 <tr> 195 <?php 196 $posts_columns = wp_manage_pages_columns(); 197 $hidden = (array) get_user_option( 'manage-page-columns-hidden' ); 198 foreach($posts_columns as $post_column_key => $column_display_name) { 199 if ( 'cb' === $post_column_key ) 200 $class = ' class="check-column"'; 201 elseif ( 'comments' === $post_column_key ) 202 $class = ' class="manage-column column-comments num"'; 203 elseif ( 'modified' === $post_column_key ) 204 $class = ' class="manage-column column-date"'; 205 else 206 $class = " class=\"manage-column column-$post_column_key\""; 207 208 $style = ''; 209 if ( in_array($post_column_key, $hidden) ) 210 $style = ' style="display:none;"'; 211 ?> 212 <th scope="col"<?php echo "id=\"$post_column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> 213 <?php } ?> 195 <?php print_column_headers('page'); ?> 214 196 </tr> 215 197 </thead> -
trunk/wp-admin/edit-post-rows.php
r8858 r8923 12 12 <thead> 13 13 <tr> 14 15 <?php 16 $posts_columns = wp_manage_posts_columns(); 17 $hidden = (array) get_user_option( 'manage-post-columns-hidden' ); 18 foreach ( $posts_columns as $post_column_key => $column_display_name ) { 19 if ( 'cb' === $post_column_key ) 20 $class = ' class="check-column"'; 21 elseif ( 'comments' === $post_column_key ) 22 $class = ' class="manage-column column-comments num"'; 23 elseif ( 'modified' === $post_column_key ) 24 $class = ' class="manage-column column-date"'; 25 else 26 $class = " class=\"manage-column column-$post_column_key\""; 27 28 $style = ''; 29 if ( in_array($post_column_key, $hidden) ) 30 $style = ' style="display:none;"'; 31 ?> 32 <th scope="col"<?php echo "id=\"$post_column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> 33 <?php } ?> 34 14 <?php print_column_headers('post'); ?> 35 15 </tr> 36 16 </thead> -
trunk/wp-admin/edit-tags.php
r8867 r8923 142 142 143 143 <form id="posts-filter" action="" method="get"> 144 145 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 146 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 147 148 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 149 <div id="edit-settings-wrap"> 150 <h5><?php _e('Show on screen') ?></h5> 151 <div class="metabox-prefs"> 152 <?php manage_columns_prefs('tag') ?> 153 <br class="clear" /> 154 </div></div> 155 </div> 156 144 157 <h2><?php printf( current_user_can('manage_categories') ? __('Tags (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addtag' ); ?></h2> 145 158 … … 183 196 <thead> 184 197 <tr> 185 <th scope="col" class="check-column"><input type="checkbox" /></th> 186 <th scope="col"><?php _e('Name') ?></th> 187 <th scope="col" class="num" style="width: 90px"><?php _e('Posts') ?></th> 198 <?php print_column_headers('tag'); ?> 188 199 </tr> 189 200 </thead> -
trunk/wp-admin/includes/template.php
r8917 r8923 444 444 } 445 445 446 function wp_manage_links_columns() { 447 $link_columns = array( 448 'name' => __('Name'), 449 'url' => __('URL'), 450 'categories' => __('Categories'), 451 'rel' => __('rel'), 452 'visible' => __('Visible'), 453 ); 454 455 return apply_filters('manage_link_columns', $link_columns); 446 function get_column_headers($page) { 447 switch ($page) { 448 case 'post': 449 return wp_manage_posts_columns(); 450 case 'page': 451 return wp_manage_pages_columns(); 452 case 'link': 453 $columns = array( 454 'cb' => '<input type="checkbox" />', 455 'name' => __('Name'), 456 'url' => __('URL'), 457 'categories' => __('Categories'), 458 'rel' => __('rel'), 459 'visible' => __('Visible') 460 ); 461 462 return apply_filters('manage_link_columns', $columns); 463 case 'media': 464 return wp_manage_media_columns(); 465 case 'category': 466 $columns = array( 467 'cb' => '<input type="checkbox" />', 468 'name' => __('Name'), 469 'description' => __('Description'), 470 'posts' => __('Posts') 471 ); 472 473 return apply_filters('manage_categories_columns', $columns); 474 case 'link-category': 475 $columns = array( 476 'cb' => '<input type="checkbox" />', 477 'name' => __('Name'), 478 'description' => __('Description'), 479 'links' => __('Links') 480 ); 481 482 return apply_filters('manage_link_categories_columns', $columns); 483 case 'tag': 484 $columns = array( 485 'cb' => '<input type="checkbox" />', 486 'name' => __('Name'), 487 'posts' => __('Posts') 488 ); 489 490 return apply_filters('manage_link_categories_columns', $columns); 491 } 492 493 return $columns; 494 } 495 496 function print_column_headers( $type ) { 497 $columns = get_column_headers( $type ); 498 $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); 499 $styles = array(); 500 $styles['tag']['posts'] = 'width: 90px;'; 501 $styles['link-category']['links'] = 'width: 90px;'; 502 $styles['category']['posts'] = 'width: 90px;'; 503 $styles['link']['visible'] = 'text-align: center;'; 504 505 foreach ( $columns as $column_key => $column_display_name ) { 506 $class = ' class="manage-column'; 507 508 if ( 'modified' == $column_key ) 509 $column_key = 'date'; 510 511 $class .= " column-$column_key"; 512 513 if ( 'cb' == $column_key ) 514 $class .= ' check-column'; 515 elseif ( in_array($column_key, array('posts', 'comments', 'links')) ) 516 $class .= ' num'; 517 518 $class .= '"'; 519 520 $style = ''; 521 if ( in_array($column_key, $hidden) ) 522 $style = 'display:none;'; 523 524 if ( isset($styles[$type]) && isset($styles[$type][$column_key]) ) 525 $style .= ' ' . $styles[$type][$column_key]; 526 $style = ' style="' . $style . '"'; 527 ?> 528 <th scope="col"<?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> 529 <?php } 456 530 } 457 531 … … 2035 2109 2036 2110 function manage_columns_prefs($page) { 2037 if ( 'post' == $page ) 2038 $columns = wp_manage_posts_columns(); 2039 elseif ( 'page' == $page ) 2040 $columns = wp_manage_pages_columns(); 2041 elseif ( 'link' == $page ) 2042 $columns = wp_manage_links_columns(); 2043 elseif ( 'media' == $page ) 2044 $columns = wp_manage_media_columns(); 2045 else return; 2111 $columns = get_column_headers($page); 2046 2112 2047 2113 $hidden = (array) get_user_option( "manage-$page-columns-hidden" ); -
trunk/wp-admin/js/categories.js
r7131 r8923 21 21 else 22 22 $('#the-list').wpList(); 23 24 if ( jQuery('#link-category-search').size() ) { 25 columns.init('link-category'); 26 } else { 27 columns.init('category'); 28 } 29 30 // Edit Settings 31 $('#show-settings-link').click(function () { 32 $('#edit-settings').slideDown('normal', function(){ 33 $('#show-settings-link').hide(); 34 $('#hide-settings-link').show(); 35 36 }); 37 $('#show-settings').addClass('show-settings-opened'); 38 return false; 39 }); 40 41 $('#hide-settings-link').click(function () { 42 $('#edit-settings').slideUp('normal', function(){ 43 $('#hide-settings-link').hide(); 44 $('#show-settings-link').show(); 45 $('#show-settings').removeClass('show-settings-opened'); 46 }); 47 48 return false; 49 }); 23 50 }); -
trunk/wp-admin/js/tags.js
r6660 r8923 19 19 else 20 20 $('#the-list').wpList(); 21 22 columns.init('tag'); 23 24 // Edit Settings 25 $('#show-settings-link').click(function () { 26 $('#edit-settings').slideDown('normal', function(){ 27 $('#show-settings-link').hide(); 28 $('#hide-settings-link').show(); 29 30 }); 31 $('#show-settings').addClass('show-settings-opened'); 32 return false; 33 }); 34 35 $('#hide-settings-link').click(function () { 36 $('#edit-settings').slideUp('normal', function(){ 37 $('#hide-settings-link').hide(); 38 $('#show-settings-link').show(); 39 $('#show-settings').removeClass('show-settings-opened'); 40 }); 41 42 return false; 43 }); 21 44 }); -
trunk/wp-admin/link-manager.php
r8888 r8923 157 157 $links = get_bookmarks( $args ); 158 158 if ( $links ) { 159 $link_columns = wp_manage_links_columns();159 $link_columns = get_column_headers('link'); 160 160 $hidden = (array) get_user_option( 'manage-link-columns-hidden' ); 161 161 ?> … … 165 165 <thead> 166 166 <tr> 167 <th scope="col" class="check-column"><input type="checkbox" /></th> 168 <?php foreach($link_columns as $column_name => $column_display_name) { 169 $class = " class=\"manage-column column-$column_name\""; 170 $style = ''; 171 if ( in_array($column_name, $hidden) ) 172 $style = ' style="display:none;"'; 173 if ( 'visible' == $column_name ) 174 $style = empty($style) ? ' style="text-align: center;"' : ' style="text-align: center; display: none;"'; 175 ?> 176 <th scope="col"<?php echo "id=\"$column_name\""; echo $class; echo $style ?>><?php echo $column_display_name; ?></th> 177 <?php } ?> 167 <?php print_column_headers('link'); ?> 178 168 </tr> 179 169 </thead> … … 197 187 $edit_link = get_edit_bookmark_link(); 198 188 ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php 199 echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></th>';200 189 foreach($link_columns as $column_name=>$column_display_name) { 201 190 $class = "class=\"column-$column_name\""; … … 209 198 210 199 switch($column_name) { 200 case 'cb': 201 echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></th>'; 202 break; 211 203 case 'name': 212 204 … … 265 257 <p><?php _e('No links found.') ?></p> 266 258 <?php } ?> 259 <?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?> 267 260 </form> 268 261 -
trunk/wp-includes/script-loader.php
r8903 r8923 150 150 'how' => __('Separate multiple categories with commas.') 151 151 ) ); 152 $scripts->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists' ), '20071031' );153 $scripts->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists' ), '20071031' );152 $scripts->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists', 'columns'), '20071031' ); 153 $scripts->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists', 'columns'), '20071031' ); 154 154 $scripts->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' ); 155 155 $scripts->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20080824' );
Note: See TracChangeset
for help on using the changeset viewer.