Changeset 7217 for trunk/wp-admin/index.php
- Timestamp:
- 03/10/2008 10:59:57 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/index.php
r7202 r7217 40 40 41 41 <div id="rightnow"> 42 <h3 class="reallynow"><span><?php _e('Right Now'); ?></span> <a href="post-new.php" class="rbutton"><strong><?php _e('Write a New Post'); ?></strong></a> <a href="page-new.php" class="rbutton"><?php _e('Write a New Page'); ?></a><br class="clear" /></h3> 42 <h3 class="reallynow"> 43 <span><?php _e('Right Now'); ?></span> 44 45 <?php if ( $can_edit_posts = current_user_can( 'edit_posts' ) ) : ?> 46 <a href="post-new.php" class="rbutton"><strong><?php _e('Write a New Post'); ?></strong></a> 47 <?php endif; if ( $can_edit_pages = current_user_can( 'edit_pages' ) ) : ?> 48 <a href="page-new.php" class="rbutton"><?php _e('Write a New Page'); ?></a> 49 <?php endif; ?> 50 <br class="clear" /> 51 </h3> 43 52 44 53 <?php … … 52 61 $post_type_texts = array(); 53 62 54 if ( !empty($num_posts->publish) ) { 55 $post_type_texts[] = '<a href="edit.php">'.sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) ).'</a>'; 63 if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can 64 $post_text = sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) ); 65 $post_type_texts[] = $can_edit_posts ? "<a href='edit.php'>$post_text</a>" : $post_text; 56 66 } 57 if ( !empty($num_pages->publish) ) {67 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can 58 68 $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>'; 59 69 } 60 if ( !empty($num_posts->draft) ) {70 if ( $can_edit_posts && !empty($num_posts->draft) ) { 61 71 $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>'; 62 72 } 63 if ( !empty($num_posts->future) ) {73 if ( $can_edit_posts && !empty($num_posts->future) ) { 64 74 $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>'; 65 75 } 66 76 67 $cats_text = '<a href="categories.php">'.sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) ).'</a>'; 68 $tags_text = '<a href="edit-tags.php">'.sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) ).'</a>'; 77 $cats_text = sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) ); 78 $tags_text = sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) ); 79 if ( current_user_can( 'manage_categories' ) ) { 80 $cats_text = "<a href='categories.php'>$cats_text</a>"; 81 $tags_text = "<a href='edit-tags.php'>$tags_text</a>"; 82 } 69 83 70 84 $post_type_text = implode(', ', $post_type_texts); … … 80 94 $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) ); 81 95 $widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets ); 96 if ( $can_switch_themes = current_user_can( 'switch_themes' ) ) 97 $widgets_text = "<a href='widgets.php'>$widgets_text</a>"; 82 98 ?> 83 <p><?php printf( __( 'You use the %1$s theme with %2$s.' ), $ct->title, "<a href='widgets.php'>$widgets_text</a>" ); ?> <a href="themes.php" class="button"><?php _e('Change Theme'); ?></a> <?php printf( __( "This is WordPress version %s." ), $GLOBALS['wp_version'] ); ?></p> 99 <p> 100 <?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?> 101 <?php if ( $can_switch_themes ) : ?> 102 <a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a> 103 <?php endif; ?> 104 <?php printf( __( "This is WordPress version %s." ), $GLOBALS['wp_version'] ); ?> 105 </p> 106 84 107 <?php do_action( 'rightnow_end' ); ?> 85 108 <?php do_action( 'activity_box_end' ); ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)