Changeset 4159 for branches/plugin/bbp-admin/bbp-admin.php
- Timestamp:
- 08/18/2012 07:47:06 PM (14 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-admin/bbp-admin.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-admin.php
r4139 r4159 123 123 /** Filters ***********************************************************/ 124 124 125 // Add link to settings page126 add_filter( 'plugin_action_links', array( $this, ' add_settings_link' ), 10, 2 );125 // Modify bbPress's admin links 126 add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); 127 127 128 128 /** Network Admin *****************************************************/ … … 207 207 ); 208 208 } 209 210 // These are later removed in admin_head 211 if ( bbp_current_user_can_see( 'bbp_about_page' ) ) { 212 213 // About 214 add_dashboard_page( 215 __( 'Welcome to bbPress', 'bbpress' ), 216 __( 'Welcome to bbPress', 'bbpress' ), 217 $this->minimum_capability, 218 'bbp-about', 219 array( $this, 'about_screen' ) 220 ); 221 222 // Credits 223 add_dashboard_page( 224 __( 'Welcome to bbPress', 'bbpress' ), 225 __( 'Welcome to bbPress', 'bbpress' ), 226 $this->minimum_capability, 227 'bbp-credits', 228 array( $this, 'credits_screen' ) 229 ); 230 } 209 231 } 210 232 … … 230 252 * 231 253 * @since bbPress (r3767) 232 * @return type 254 * @return type 233 255 */ 234 256 public static function new_install() { … … 339 361 * @return array Processed links 340 362 */ 341 public static function add_settings_link( $links, $file ) { 342 343 if ( plugin_basename( bbpress()->file ) == $file ) { 344 $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . __( 'Settings', 'bbpress' ) . '</a>'; 345 array_unshift( $links, $settings_link ); 346 } 347 348 return $links; 363 public static function modify_plugin_action_links( $links, $file ) { 364 365 // Return normal links if not bbPress 366 if ( plugin_basename( bbpress()->file ) != $file ) 367 return $links; 368 369 // Add a few links to the existing links array 370 return array_merge( $links, array( 371 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . __( 'Settings', 'bbpress' ) . '</a>', 372 'about' => '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . __( 'About', 'bbpress' ) . '</a>' 373 ) ); 349 374 } 350 375 … … 377 402 remove_submenu_page( 'tools.php', 'bbp-converter' ); 378 403 remove_submenu_page( 'tools.php', 'bbp-reset' ); 404 remove_submenu_page( 'index.php', 'bbp-about' ); 405 remove_submenu_page( 'index.php', 'bbp-credits' ); 379 406 380 407 // The /wp-admin/images/ folder … … 387 414 $menu_icon_url_2x = $this->images_url . 'menu-2x.png?ver=' . $version; 388 415 $icon32_url_2x = $this->images_url . 'icons32-2x.png?ver=' . $version; 416 $badge_url = $this->images_url . 'badge.png?ver=' . $version; 417 $badge_url_2x = $this->images_url . 'badge-2x.png?ver=' . $version; 389 418 390 419 // Top level menu classes … … 395 424 <style type="text/css" media="screen"> 396 425 /*<![CDATA[*/ 426 427 /* Version Badge */ 428 429 .bbp-badge { 430 padding-top: 142px; 431 height: 50px; 432 width: 173px; 433 color: #fafafa; 434 font-weight: bold; 435 font-size: 14px; 436 text-align: center; 437 margin: 0 -5px; 438 background: url('<?php echo $badge_url; ?>') no-repeat; 439 } 440 441 .about-wrap .bbp-badge { 442 position: absolute; 443 top: 0; 444 right: 0; 445 } 397 446 398 447 #bbp-dashboard-right-now p.sub, … … 561 610 #menu-posts-<?php echo $reply_class; ?>:hover .wp-menu-image, 562 611 563 #menu-posts-<?php echo $forum_class; ?>.wp-has-current-submenu .wp-menu-image, 612 #menu-posts-<?php echo $forum_class; ?>.wp-has-current-submenu .wp-menu-image, 564 613 #menu-posts-<?php echo $topic_class; ?>.wp-has-current-submenu .wp-menu-image, 565 614 #menu-posts-<?php echo $reply_class; ?>.wp-has-current-submenu .wp-menu-image { … … 601 650 #menu-posts-<?php echo $reply_class; ?>:hover .wp-menu-image, 602 651 603 #menu-posts-<?php echo $forum_class; ?>.wp-has-current-submenu .wp-menu-image, 652 #menu-posts-<?php echo $forum_class; ?>.wp-has-current-submenu .wp-menu-image, 604 653 #menu-posts-<?php echo $topic_class; ?>.wp-has-current-submenu .wp-menu-image, 605 654 #menu-posts-<?php echo $reply_class; ?>.wp-has-current-submenu .wp-menu-image { … … 607 656 background-size: 100px 64px; 608 657 } 658 659 .bbp-badge { 660 background-image: url('<?php echo $badge_url_2x; ?>'); 661 background-size: 173px 194px; 662 } 609 663 } 610 664 … … 612 666 613 667 /* Green Scheme Images */ 614 668 615 669 .post-com-count { 616 670 background-image: url('<?php echo $wp_admin_url; ?>bubble_bg.gif'); … … 953 1007 background-image: url('<?php echo $wp_admin_url; ?>arrows-dark.png'); 954 1008 } 955 1009 956 1010 @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { 957 1011 .icon32.icon-post, … … 1041 1095 } 1042 1096 1097 /** About *****************************************************************/ 1098 1099 /** 1100 * Output the about screen 1101 * 1102 * @since bbPress (r4159) 1103 */ 1104 public function about_screen() { 1105 1106 $display_version = bbp_get_version(); ?> 1107 1108 <div class="wrap about-wrap"> 1109 <h1><?php printf( __( 'Welcome to bbPress %s' ), $display_version ); ?></h1> 1110 <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!' ), $display_version ); ?></div> 1111 <div class="bbp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> 1112 1113 <h2 class="nav-tab-wrapper"> 1114 <a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>"> 1115 <?php _e( 'What’s New' ); ?> 1116 </a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>"> 1117 <?php _e( 'Credits' ); ?> 1118 </a> 1119 </h2> 1120 1121 <div class="return-to-dashboard"> 1122 <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-settings' ), 'index.php' ) ) ); ?>"><?php _e( 'Go to Forum Settings' ); ?></a> 1123 </div> 1124 1125 </div> 1126 1127 <?php 1128 } 1129 1130 /** 1131 * Output the credits screen 1132 * 1133 * @since bbPress (r4159) 1134 */ 1135 public function credits_screen() { 1136 1137 $display_version = bbp_get_version(); ?> 1138 1139 <div class="wrap about-wrap"> 1140 <h1><?php printf( __( 'Welcome to bbPress %s' ), $display_version ); ?></h1> 1141 <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!' ), $display_version ); ?></div> 1142 <div class="bbp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> 1143 1144 <h2 class="nav-tab-wrapper"> 1145 <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-about' ), 'index.php' ) ) ); ?>" class="nav-tab"> 1146 <?php _e( 'What’s New' ); ?> 1147 </a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active"> 1148 <?php _e( 'Credits' ); ?> 1149 </a> 1150 </h2> 1151 1152 <div class="return-to-dashboard"> 1153 <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'bbp-settings' ), 'index.php' ) ) ); ?>"><?php _e( 'Go to Forum Settings' ); ?></a> 1154 </div> 1155 1156 </div> 1157 1158 <?php 1159 } 1160 1043 1161 /** Updaters **************************************************************/ 1044 1162 … … 1085 1203 1086 1204 ?> 1087 1205 1088 1206 <p><?php _e( 'All done!', 'bbpress' ); ?></p> 1089 1207 <a class="button" href="index.php?page=bbpress-update"><?php _e( 'Go Back', 'bbpress' ); ?></a>
Note: See TracChangeset
for help on using the changeset viewer.