Changeset 4596
- Timestamp:
- 07/04/2011 02:07:08 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r4590 r4596 9 9 * @subpackage Activity Core 10 10 */ 11 12 /** 13 * Checks $bp pages global and looks for directory page 14 * 15 * @since 1.3 16 * 17 * @global object $bp Global BuddyPress settings object 18 * @return bool True if set, False if empty 19 */ 20 function bp_activity_has_directory() { 21 global $bp; 22 23 return (bool) !empty( $bp->pages->activity->id ); 24 } 11 25 12 26 /** -
trunk/bp-blogs/bp-blogs-functions.php
r4486 r4596 1 1 <?php 2 2 3 /******************************************************************************* 4 * Business functions are where all the magic happens in BuddyPress. They will 5 * handle the actual saving or manipulation of information. Usually they will 6 * hand off to a database class for data access, then return 7 * true or false on success or failure. 8 */ 3 /** 4 * Checks $bp pages global and looks for directory page 5 * 6 * @since 1.3 7 * 8 * @global object $bp Global BuddyPress settings object 9 * @return bool True if set, False if empty 10 */ 11 function bp_blogs_has_directory() { 12 global $bp; 13 14 return (bool) !empty( $bp->pages->blogs->id ); 15 } 9 16 10 17 function bp_blogs_get_blogs( $args = '' ) { -
trunk/bp-core/admin/bp-core-admin.php
r4559 r4596 117 117 </td> 118 118 </tr> 119 120 <?php if ( bp_is_active( 'forums' ) ) : ?>121 122 <tr>123 <th scope="row"><?php _e( 'Disable global forum directory?', 'buddypress' ) ?>:</th>124 <td>125 <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( (int)bp_get_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 126 <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)bp_get_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?>127 </td>128 </tr>129 130 <?php endif; ?>131 119 132 120 <?php if ( bp_is_active( 'activity' ) ) : ?> -
trunk/bp-core/bp-core-filters.php
r4536 r4596 19 19 $pages[] = $bp->pages->register->id; 20 20 21 if ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && !bp_forums_is_installed_correctly() ) ) 22 if ( !empty( $bp->pages->forums ) ) 23 $pages[] = $bp->pages->forums->id; 21 if ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) 22 $pages[] = $bp->pages->forums->id; 24 23 25 24 return apply_filters( 'bp_core_exclude_pages', $pages ); -
trunk/bp-core/bp-core-functions.php
r4588 r4596 281 281 282 282 // Add the administration tab under the "Site Admin" tab for site administrators 283 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '', 4 ); 284 283 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '' ); 285 284 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup' ); 286 285 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Settings', 'buddypress' ), __( 'Settings', 'buddypress' ), 'manage_options', 'bp-settings', 'bp_core_admin_settings' ); … … 997 996 'bp-disable-avatar-uploads' => '0', 998 997 'bp-disable-account-deletion' => '0', 999 'bp-disable-forum-directory' => '0',1000 998 'bp-disable-blogforum-comments' => '0', 1001 999 'bb-config-location' => ABSPATH, -
trunk/bp-core/bp-core-template.php
r4559 r4596 248 248 $options['blogs'] = __( 'Blogs', 'buddypress' ); 249 249 250 if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && !bp_forum_directory_is_disabled() )250 if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() ) 251 251 $options['forums'] = __( 'Forums', 'buddypress' ); 252 252 -
trunk/bp-forums/bp-forums-functions.php
r4400 r4596 12 12 13 13 /** 14 * Convenience function to determine if the forum directory has been disabled 15 * by the site admin. 14 * Checks $bp pages global and looks for directory page 15 * 16 * @since 1.3 16 17 * 17 18 * @global object $bp Global BuddyPress settings object 18 * @return bool True if forum is disabled 19 * @since 1.3 19 * @return bool True if set, False if empty 20 20 */ 21 function bp_forum _directory_is_disabled() {22 global $bp; 23 24 return !empty( $bp->site_options['bp-disable-forum-directory']);21 function bp_forums_has_directory() { 22 global $bp; 23 24 return (bool) !empty( $bp->pages->forums->id ); 25 25 } 26 26 -
trunk/bp-forums/bp-forums-screens.php
r4572 r4596 4 4 5 5 if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) { 6 if ( bp_forum_directory_is_disabled() )6 if ( !bp_forums_has_directory() ) 7 7 return false; 8 8 -
trunk/bp-groups/bp-groups-functions.php
r4558 r4596 7 7 * true or false on success or failure. 8 8 */ 9 10 /** 11 * Checks $bp pages global and looks for directory page 12 * 13 * @since 1.3 14 * 15 * @global object $bp Global BuddyPress settings object 16 * @return bool True if set, False if empty 17 */ 18 function bp_groups_has_directory() { 19 global $bp; 20 21 return (bool) !empty( $bp->pages->groups->id ); 22 } 9 23 10 24 function groups_get_group( $args = '' ) { -
trunk/bp-members/bp-members-functions.php
r4594 r4596 10 10 */ 11 11 12 /** 13 * Checks $bp pages global and looks for directory page 14 * 15 * @since 1.3 16 * 17 * @global object $bp Global BuddyPress settings object 18 * @return bool True if set, False if empty 19 */ 20 function bp_members_has_directory() { 21 global $bp; 22 23 return (bool) !empty( $bp->pages->members->id ); 24 } 12 25 13 26 /** -
trunk/bp-themes/bp-default/forums/single/edit.php
r4322 r4596 11 11 </li> 12 12 13 <?php if ( !bp_forum_directory_is_disabled() ) : ?>13 <?php if ( bp_forums_has_directory() ) : ?> 14 14 15 15 <li> -
trunk/bp-themes/bp-default/forums/single/forum.php
r4452 r4596 20 20 </li> 21 21 22 <?php if ( !bp_forum_directory_is_disabled() ) : ?>22 <?php if ( bp_forums_has_directory() ) : ?> 23 23 24 24 <li> -
trunk/bp-themes/bp-default/forums/single/topic.php
r4347 r4596 38 38 </li> 39 39 40 <?php if ( !bp_forum_directory_is_disabled() ) : ?>40 <?php if ( bp_forums_has_directory() ) : ?> 41 41 42 42 <li> -
trunk/bp-themes/bp-default/functions.php
r4580 r4596 553 553 'title_li' => '' 554 554 ); 555 556 if ( ( !bp_is_active( 'forums' ) || bp_forum_directory_is_disabled() ) && !empty( $bp->pages->forums->id ) ) {557 if ( !empty( $pages_args['exclude'] ) )558 $pages_args['exclude'] .= ',';559 560 $pages_args['exclude'] .= $bp->pages->forums->id;561 }562 563 555 $menu = wp_page_menu( $pages_args ); 564 556 $menu = str_replace( array( '<div class="menu"><ul>', '</ul></div>' ), array( '<ul id="nav">', '</ul><!-- #nav -->' ), $menu ); -
trunk/bp-themes/bp-default/groups/single/forum.php
r4452 r4596 18 18 </li> 19 19 20 <?php if ( !bp_forum_directory_is_disabled() ) : ?>20 <?php if ( bp_forums_has_directory() ) : ?> 21 21 22 22 <li> -
trunk/bp-themes/bp-default/groups/single/forum/edit.php
r4322 r4596 11 11 </li> 12 12 13 <?php if ( !bp_forum_directory_is_disabled() ) : ?>13 <?php if ( bp_forums_has_directory() ) : ?> 14 14 15 15 <li> -
trunk/bp-themes/bp-default/groups/single/forum/topic.php
r4322 r4596 11 11 </li> 12 12 13 <?php if ( !bp_forum_directory_is_disabled() ) : ?>13 <?php if ( bp_forums_has_directory() ) : ?> 14 14 15 15 <li> -
trunk/bp-xprofile/bp-xprofile-admin.php
r4559 r4596 1 1 <?php 2 3 /** 4 * Creates the administration interface menus and checks to see if the DB 5 * tables are set up. 6 * 7 * @package BuddyPress XProfile 8 * @global object $bp Global BuddyPress settings object 9 * @global $wpdb WordPress DB access object. 10 * @uses is_super_admin() returns true if the current user is a site admin, false if not 11 * @uses bp_xprofile_install() runs the installation of DB tables for the xprofile component 12 * @uses wp_enqueue_script() Adds a JS file to the JS queue ready for output 13 * @uses add_submenu_page() Adds a submenu tab to a top level tab in the admin area 14 * @uses xprofile_install() Runs the DB table installation function 15 * @return 16 */ 17 function xprofile_add_admin_menu() { 18 global $wpdb, $bp; 19 20 if ( !is_super_admin() ) 21 return false; 22 23 $hook = add_options_page( __( 'Profiles Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' ); 24 25 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 26 } 27 add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' ); 2 28 3 29 /** -
trunk/bp-xprofile/bp-xprofile-buddybar.php
r4482 r4596 1 1 <?php 2 2 3 /** 4 * Creates the administration interface menus and checks to see if the DB 5 * tables are set up. 6 * 7 * @package BuddyPress XProfile 8 * @global object $bp Global BuddyPress settings object 9 * @global $wpdb WordPress DB access object. 10 * @uses is_super_admin() returns true if the current user is a site admin, false if not 11 * @uses bp_xprofile_install() runs the installation of DB tables for the xprofile component 12 * @uses wp_enqueue_script() Adds a JS file to the JS queue ready for output 13 * @uses add_submenu_page() Adds a submenu tab to a top level tab in the admin area 14 * @uses xprofile_install() Runs the DB table installation function 15 * @return 16 */ 17 function xprofile_add_admin_menu() { 18 global $wpdb, $bp; 19 20 if ( !is_super_admin() ) 21 return false; 22 23 // Add the administration tab under the "Site Admin" tab for site administrators 24 $hook = add_submenu_page( 'bp-general-settings', __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' ); 25 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 26 } 27 add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' ); 28 29 /** 30 * Adds an admin bar menu to any profile page providing site admin options 31 * for that user. 32 * 33 * @package BuddyPress XProfile 34 * @global $bp BuddyPress 35 */ 36 function xprofile_setup_adminbar_menu() { 37 global $bp; 38 39 if ( !$bp->displayed_user->id ) 40 return false; 41 42 // Don't show this menu to non site admins or if you're viewing your own profile 43 if ( !is_super_admin() || bp_is_my_profile() ) 44 return false; ?> 45 46 <li id="bp-adminbar-adminoptions-menu"> 47 <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a> 48 49 <ul> 50 <li><a href="<?php echo $bp->displayed_user->domain . $bp->profile->slug; ?>/edit/"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 51 <li><a href="<?php echo $bp->displayed_user->domain . $bp->profile->slug; ?>/change-avatar/"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 52 53 <?php if ( bp_is_active( 'settings' ) ) : ?> 54 55 <li><a href="<?php echo $bp->displayed_user->domain . $bp->settings->slug; ?>/general/"><?php printf( __( "Edit %s's Settings", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 56 57 <?php endif; ?> 58 59 <?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?> 60 61 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Mark as Spammer", 'buddypress' ) ?></a></li> 62 63 <?php else : ?> 64 65 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li> 66 67 <?php endif; ?> 68 69 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 70 71 <?php do_action( 'xprofile_adminbar_menu_items' ) ?> 72 73 </ul> 74 </li> 75 76 <?php 77 } 78 //add_action( 'bp_adminbar_menus', 'xprofile_setup_adminbar_menu', 20 ); 3 // Nothing to see here 79 4 80 5 ?>
Note: See TracChangeset
for help on using the changeset viewer.