Changeset 8888
- Timestamp:
- 09/14/2008 06:51:42 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r8868 r8888 405 405 406 406 return $posts_columns; 407 } 408 409 function wp_manage_links_columns() { 410 $link_columns = array( 411 'name' => __('Name'), 412 'url' => __('URL'), 413 'categories' => __('Categories'), 414 'rel' => __('rel'), 415 'visible' => __('Visible'), 416 ); 417 418 return apply_filters('manage_link_columns', $link_columns); 407 419 } 408 420 … … 1971 1983 elseif ( 'page' == $page ) 1972 1984 $columns = wp_manage_pages_columns(); 1985 elseif ( 'link' == $page ) 1986 $columns = wp_manage_links_columns(); 1973 1987 elseif ( 'media' == $page ) 1974 1988 $columns = wp_manage_media_columns(); … … 1979 1993 foreach ( $columns as $column => $title ) { 1980 1994 // Can't hide these 1981 if ( 'cb' == $column || 'title' == $column )1995 if ( 'cb' == $column || 'title' == $column || 'name' == $column ) 1982 1996 continue; 1983 1997 if ( 'comments' == $column ) -
trunk/wp-admin/link-manager.php
r8867 r8888 35 35 36 36 wp_enqueue_script('admin-forms'); 37 wp_enqueue_script('links'); 37 38 38 39 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); … … 95 96 96 97 <form id="links-filter" action="" method="get"> 98 99 <div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a> 100 <a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div> 101 102 <div id="edit-settings" class="hide-if-js hide-if-no-js"> 103 <div id="edit-settings-wrap"> 104 <h5><?php _e('Show on screen') ?></h5> 105 <div class="metabox-prefs"> 106 <?php manage_columns_prefs('link') ?> 107 <br class="clear" /> 108 </div></div> 109 </div> 110 97 111 <h2><?php printf( __('Links (<a href="%s">Add New</a>)' ), 'link-add.php' ); ?></h2> 98 112 … … 134 148 135 149 <br class="clear" /> 136 137 <?php138 $link_columns = array(139 'name' => '<th style="width: 15%;">' . __('Name') . '</th>',140 'url' => '<th>' . __('URL') . '</th>',141 'categories' => '<th>' . __('Categories') . '</th>',142 'rel' => '<th style="text-align: center">' . __('rel') . '</th>',143 'visible' => '<th style="text-align: center">' . __('Visible') . '</th>',144 );145 $link_columns = apply_filters('manage_link_columns', $link_columns);146 ?>147 150 148 151 <?php … … 154 157 $links = get_bookmarks( $args ); 155 158 if ( $links ) { 159 $link_columns = wp_manage_links_columns(); 160 $hidden = (array) get_user_option( 'manage-link-columns-hidden' ); 156 161 ?> 157 162 … … 161 166 <tr> 162 167 <th scope="col" class="check-column"><input type="checkbox" /></th> 163 <?php foreach($link_columns as $column_display_name) { 164 echo $column_display_name; 165 } ?> 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 } ?> 166 178 </tr> 167 179 </thead> … … 187 199 echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></th>'; 188 200 foreach($link_columns as $column_name=>$column_display_name) { 201 $class = "class=\"column-$column_name\""; 202 203 $style = ''; 204 if ( in_array($column_name, $hidden) ) 205 $style = ' style="display:none;"'; 206 if ( 'visible' == $column_name ) 207 $style = empty($style) ? ' style="text-align: center;"' : ' style="text-align: center; display: none;"'; 208 $attributes = "$class$style"; 209 189 210 switch($column_name) { 190 211 case 'name': 191 212 192 echo "<td ><strong><a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $link->link_name)) . "'>$link->link_name</a></strong><br />";213 echo "<td $attributes><strong><a class='row-title' href='$edit_link' title='" . attribute_escape(sprintf(__('Edit "%s"'), $link->link_name)) . "'>$link->link_name</a></strong><br />"; 193 214 $actions = array(); 194 215 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; … … 204 225 break; 205 226 case 'url': 206 echo "<td ><a href='$link->link_url' title='".sprintf(__('Visit %s'), $link->link_name)."'>$short_url</a></td>";227 echo "<td $attributes><a href='$link->link_url' title='".sprintf(__('Visit %s'), $link->link_name)."'>$short_url</a></td>"; 207 228 break; 208 229 case 'categories': 209 ?><td ><?php230 ?><td <?php echo $attributes ?>><?php 210 231 $cat_names = array(); 211 232 foreach ($link->link_category as $category) { … … 222 243 break; 223 244 case 'rel': 224 ?><td ><?php echo $link->link_rel; ?></td><?php245 ?><td <?php echo $attributes ?>><?php echo $link->link_rel; ?></td><?php 225 246 break; 226 247 case 'visible': 227 ?><td style='text-align: center;'><?php echo $visible; ?></td><?php248 ?><td <?php echo $attributes ?>><?php echo $visible; ?></td><?php 228 249 break; 229 250 default: -
trunk/wp-includes/script-loader.php
r8869 r8888 263 263 $scripts->add( 'posts', '/wp-admin/js/posts.js', array('columns'), '20080910' ); 264 264 $scripts->add( 'pages', '/wp-admin/js/pages.js', array('columns'), '20080910' ); 265 $scripts->add( 'links', '/wp-admin/js/links.js', array('columns'), '20080913' ); 265 266 266 267 $scripts->add( 'columns', '/wp-admin/js/columns.js', false, '20080910' );
Note: See TracChangeset
for help on using the changeset viewer.