Ticket #4802: 4802-widget.diff
File 4802-widget.diff, 5.0 KB (added by , 12 years ago) |
---|
-
bp-templates/bp-legacy/buddypress-functions.php
1200 1200 1201 1201 exit; 1202 1202 } 1203 1204 /** 1205 * Filters bp_message_get_notice_checkbox 1206 * 1207 * Checks BP Messages Widget is active before printing the checkbox 1208 * Displays a message to admin if not active. 1209 * 1210 * @param string $notice_checkbox 1211 * @uses is_active_widget() to check if the widget is active 1212 * @uses admin_url() to print the widgets url 1213 * @return string $notice_checkbox 1214 */ 1215 function bp_legacy_theme_get_notice_checkbox( $notice_checkbox ) { 1216 1217 if( !is_active_widget( false, false, 'bp_messages_widget') ) 1218 $notice_checkbox = '<small>' . sprintf( __('You need to <a href="%s">activate</a> the (BuddyPress) Site Wide Notices widget to compose site wide notices', 'buddypress'), admin_url( 'widgets.php' ) ) .'</small>'; 1219 1220 return $notice_checkbox; 1221 } 1222 1223 add_filter( 'bp_message_get_notice_checkbox', 'bp_legacy_theme_get_notice_checkbox', 1, 1 ); 1224 No newline at end of file -
bp-templates/bp-legacy/buddypress/members/single/messages/compose.php
11 11 </ul> 12 12 13 13 <?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?> 14 <input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?> 14 15 <?php bp_message_notice_checkbox();?> 16 15 17 <?php endif; ?> 16 18 17 19 <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label> -
bp-templates/bp-legacy/css/buddypress.css
506 506 #buddypress div#message.updated { 507 507 clear: both; 508 508 } 509 #buddypress div#message p {509 #buddypress div#message p, .widget_bp_messages_widget div#message p { 510 510 font-size: 90%; 511 511 display: block; 512 512 padding: 10px 15px; … … 1003 1003 font-weight: bold; 1004 1004 } 1005 1005 #buddypress span.activity, 1006 #buddypress div#message p {1006 #buddypress div#message p, .widget_bp_messages_widget div#message p { 1007 1007 border: 1px solid #e1ca82; 1008 1008 -moz-border-radius: 3px; 1009 1009 -webkit-border-radius: 3px; -
bp-messages/bp-messages-loader.php
51 51 'functions', 52 52 'notifications' 53 53 ); 54 55 /* 56 checks for template dir (in case of child theme) 57 and if it's not bp-default then include the Site Wide Notice Widget 58 */ 59 if( strpos( get_template_directory(), 'bp-default' ) === false ) 60 $includes[] = 'widget'; 54 61 55 62 parent::includes( $includes ); 56 63 } -
bp-messages/bp-messages-template.php
523 523 return apply_filters( 'bp_get_message_notice_text', $messages_template->thread->message ); 524 524 } 525 525 526 527 /** 528 * Output the notice to all users checkbox 529 * 530 * @uses bp_message_get_notice_checkbox() 531 */ 532 function bp_message_notice_checkbox() { 533 echo bp_message_get_notice_checkbox(); 534 } 535 536 /** 537 * Returns the notice to all users checkbox 538 * 539 * @uses apply_filters() To call the 'bp_message_get_notice_checkbox' hook 540 */ 541 function bp_message_get_notice_checkbox() { 542 543 $notice_checkbox = '<input type="checkbox" id="send-notice" name="send-notice" value="1" /> '. __( "This is a notice to all users.", "buddypress" ); 544 545 return apply_filters( 'bp_message_get_notice_checkbox', $notice_checkbox ); 546 547 } 548 526 549 function bp_message_notice_delete_link() { 527 550 echo bp_get_message_notice_delete_link(); 528 551 } … … 584 607 return apply_filters( 'bp_get_messages_slug', $bp->messages->slug ); 585 608 } 586 609 587 function bp_message_get_notices() { 610 611 /** 612 * Displays site wide notices if any 613 * 614 * Specific to BP Theme Compat : 615 * using $before_widget and $after_widget parameters avoids extra html 616 * if no notice are found. 617 * 618 * @param string $before_widget the widget opening tag 619 * @param string $after_widget the widget closing tag 620 */ 621 function bp_message_get_notices( $before_widget = '', $after_widget = '' ) { 588 622 global $userdata; 589 623 590 624 $notice = BP_Messages_Notice::get_active(); … … 599 633 600 634 if ( is_array($closed_notices) ) { 601 635 if ( !in_array( $notice->id, $closed_notices ) && $notice->id ) { 636 echo $before_widget; 602 637 ?> 603 638 <div id="message" class="info notice" rel="n-<?php echo $notice->id ?>"> 604 639 <p> … … 608 643 </p> 609 644 </div> 610 645 <?php 646 echo $after_widget; 611 647 } 612 648 } 613 649 }