Changeset 4053 for branches/plugin/bbp-admin/bbp-forums.php
- Timestamp:
- 07/04/2012 02:17:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-forums.php
r4034 r4053 26 26 * @var The post type of this admin component 27 27 */ 28 var$post_type = '';28 private $post_type = ''; 29 29 30 30 /** Functions *************************************************************/ … … 102 102 public function edit_help() { 103 103 104 $current_screen = get_current_screen();105 $post_type = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';106 107 // Bail if current screen could not be found108 if ( empty( $current_screen ) )109 return;110 111 // Bail if not the forum post type112 if ( $post_type != $this->post_type )113 return;114 115 104 // Overview 116 $current_screen->add_help_tab( array(105 get_current_screen()->add_help_tab( array( 117 106 'id' => 'overview', 118 107 'title' => __( 'Overview', 'bbpress' ), … … 122 111 123 112 // Screen Content 124 $current_screen->add_help_tab( array(113 get_current_screen()->add_help_tab( array( 125 114 'id' => 'screen-content', 126 115 'title' => __( 'Screen Content', 'bbpress' ), … … 136 125 137 126 // Available Actions 138 $current_screen->add_help_tab( array(127 get_current_screen()->add_help_tab( array( 139 128 'id' => 'action-links', 140 129 'title' => __( 'Available Actions', 'bbpress' ), … … 151 140 152 141 // Bulk Actions 153 $current_screen->add_help_tab( array(142 get_current_screen()->add_help_tab( array( 154 143 'id' => 'bulk-actions', 155 144 'title' => __( 'Bulk Actions', 'bbpress' ), … … 160 149 161 150 // Help Sidebar 162 $current_screen->set_help_sidebar(151 get_current_screen()->set_help_sidebar( 163 152 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 164 153 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . … … 175 164 public function new_help() { 176 165 177 $current_screen = get_current_screen();178 $post_type = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';179 180 // Bail if current screen could not be found181 if ( empty( $current_screen ) )182 return;183 184 // Bail if not the forum post type185 if ( $post_type != $this->post_type )186 return;187 188 166 $customize_display = '<p>' . __( 'The title field and the big forum editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>'; 189 167 190 $current_screen->add_help_tab( array(168 get_current_screen()->add_help_tab( array( 191 169 'id' => 'customize-display', 192 170 'title' => __( 'Customizing This Display', 'bbpress' ), … … 194 172 ) ); 195 173 196 $current_screen->add_help_tab( array(174 get_current_screen()->add_help_tab( array( 197 175 'id' => 'title-forum-editor', 198 176 'title' => __( 'Title and Forum Editor', 'bbpress' ), … … 212 190 } 213 191 214 $current_screen->add_help_tab( array(192 get_current_screen()->add_help_tab( array( 215 193 'id' => 'forum-attributes', 216 194 'title' => __( 'Forum Attributes', 'bbpress' ), … … 226 204 ) ); 227 205 228 $current_screen->add_help_tab( array(206 get_current_screen()->add_help_tab( array( 229 207 'id' => 'publish-box', 230 208 'title' => __( 'Publish Box', 'bbpress' ), … … 232 210 ) ); 233 211 234 $current_screen->add_help_tab( array(212 get_current_screen()->add_help_tab( array( 235 213 'id' => 'discussion-settings', 236 214 'title' => __( 'Discussion Settings', 'bbpress' ), … … 240 218 ) ); 241 219 242 $current_screen->set_help_sidebar(220 get_current_screen()->set_help_sidebar( 243 221 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' . 244 222 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' . … … 309 287 return $forum_id; 310 288 311 // Bail if post_type is not a topic or reply312 if ( get_post_type( $forum_id ) != $this->post_type )313 return $forum_id;314 315 289 // Parent ID 316 290 $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0; … … 339 313 */ 340 314 function admin_head() { 341 342 if ( get_post_type() == $this->post_type ) : ?> 343 344 <style type="text/css" media="screen"> 345 /*<![CDATA[*/ 346 347 #misc-publishing-actions, 348 #save-post { 349 display: none; 350 } 351 352 strong.label { 353 display: inline-block; 354 width: 60px; 355 } 356 357 #bbp_forum_attributes hr { 358 border-style: solid; 359 border-width: 1px; 360 border-color: #ccc #fff #fff #ccc; 361 } 362 363 .column-bbp_forum_topic_count, 364 .column-bbp_forum_reply_count, 365 .column-bbp_topic_reply_count, 366 .column-bbp_topic_voice_count { 367 width: 8% !important; 368 } 369 370 .column-author, 371 .column-bbp_reply_author, 372 .column-bbp_topic_author { 373 width: 10% !important; 374 } 375 376 .column-bbp_topic_forum, 377 .column-bbp_reply_forum, 378 .column-bbp_reply_topic { 379 width: 10% !important; 380 } 381 382 .column-bbp_forum_freshness, 383 .column-bbp_topic_freshness { 384 width: 10% !important; 385 } 386 387 .column-bbp_forum_created, 388 .column-bbp_topic_created, 389 .column-bbp_reply_created { 390 width: 15% !important; 391 } 392 393 .status-closed { 394 background-color: #eaeaea; 395 } 396 397 .status-spam { 398 background-color: #faeaea; 399 } 400 401 /*]]>*/ 402 </style> 403 404 <?php endif; ?> 315 ?> 316 317 <style type="text/css" media="screen"> 318 /*<![CDATA[*/ 319 320 #misc-publishing-actions, 321 #save-post { 322 display: none; 323 } 324 325 strong.label { 326 display: inline-block; 327 width: 60px; 328 } 329 330 #bbp_forum_attributes hr { 331 border-style: solid; 332 border-width: 1px; 333 border-color: #ccc #fff #fff #ccc; 334 } 335 336 .column-bbp_forum_topic_count, 337 .column-bbp_forum_reply_count, 338 .column-bbp_topic_reply_count, 339 .column-bbp_topic_voice_count { 340 width: 8% !important; 341 } 342 343 .column-author, 344 .column-bbp_reply_author, 345 .column-bbp_topic_author { 346 width: 10% !important; 347 } 348 349 .column-bbp_topic_forum, 350 .column-bbp_reply_forum, 351 .column-bbp_reply_topic { 352 width: 10% !important; 353 } 354 355 .column-bbp_forum_freshness, 356 .column-bbp_topic_freshness { 357 width: 10% !important; 358 } 359 360 .column-bbp_forum_created, 361 .column-bbp_topic_created, 362 .column-bbp_reply_created { 363 width: 15% !important; 364 } 365 366 .status-closed { 367 background-color: #eaeaea; 368 } 369 370 .status-spam { 371 background-color: #faeaea; 372 } 373 374 /*]]>*/ 375 </style> 405 376 406 377 <?php … … 495 466 */ 496 467 function row_actions( $actions, $forum ) { 497 if ( $forum->post_type == $this->post_type ) { 498 unset( $actions['inline hide-if-no-js'] ); 499 500 // simple hack to show the forum description under the title 501 bbp_forum_content( $forum->ID ); 502 } 468 unset( $actions['inline hide-if-no-js'] ); 469 470 // simple hack to show the forum description under the title 471 bbp_forum_content( $forum->ID ); 503 472 504 473 return $actions; … … 511 480 * 512 481 * @global int $post_ID 513 * @uses get_post_type()514 482 * @uses bbp_get_forum_permalink() 515 483 * @uses wp_post_revision_title() … … 523 491 function updated_messages( $messages ) { 524 492 global $post_ID; 525 526 if ( get_post_type( $post_ID ) != $this->post_type )527 return $messages;528 493 529 494 // URL for the current forum … … 583 548 * Setup bbPress Forums Admin 584 549 * 550 * This is currently here to make hooking and unhooking of the admin UI easy. 551 * It could use dependency injection in the future, but for now this is easier. 552 * 585 553 * @since bbPress (r2596) 586 554 * … … 588 556 */ 589 557 function bbp_admin_forums() { 558 global $typenow; 559 560 if ( bbp_get_forum_post_type() != $typenow ) 561 return; 562 590 563 bbpress()->admin->forums = new BBP_Forums_Admin(); 591 564 }
Note: See TracChangeset
for help on using the changeset viewer.