Changeset 6310
- Timestamp:
- 09/06/2012 04:24:22 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-akismet.php
r6259 r6310 98 98 $b[ $k ] = $item; 99 99 if ( $k == 'edit' ) 100 $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id']) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>';100 $b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; 101 101 } 102 102 … … 105 105 106 106 if ( $desc ) 107 echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id']) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';107 echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>'; 108 108 109 109 return apply_filters( 'bp_akismet_comment_row_action', $actions ); -
trunk/bp-core/admin/bp-core-functions.php
r6286 r6310 114 114 115 115 <p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p> 116 <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings > BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), $settings_url, network_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>116 <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings > BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p> 117 117 </div> 118 118 -
trunk/bp-core/admin/bp-core-settings.php
r6245 r6310 248 248 249 249 // We're saving our own options, until the WP Settings API is updated to work with Multisite 250 $form_action = add_query_arg( 'page', 'bp-settings', bp_ core_do_network_admin() ? network_admin_url( 'admin.php' ) :admin_url( 'admin.php' ) );250 $form_action = add_query_arg( 'page', 'bp-settings', bp_get_admin_url( 'admin.php' ) ); 251 251 252 252 ?> … … 314 314 } 315 315 316 bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_ core_do_network_admin() ? network_admin_url( 'admin.php' ) :admin_url( 'admin.php' ) ) );316 bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_get_admin_url( 'admin.php' ) ) ); 317 317 } 318 318 } -
trunk/bp-core/admin/bp-core-slugs.php
r6084 r6310 95 95 96 96 <td> 97 <?php if ( !bp_is_root_blog() ) 98 switch_to_blog( bp_get_root_blog_id() )?>97 98 <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?> 99 99 100 100 <?php echo wp_dropdown_pages( array( … … 114 114 <?php endif; ?> 115 115 116 <?php if ( !bp_is_root_blog() ) 117 restore_current_blog() ?> 116 <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?> 118 117 119 118 </td> … … 159 158 160 159 <td> 160 161 <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?> 162 161 163 <?php echo wp_dropdown_pages( array( 162 164 'name' => 'bp_pages[' . esc_attr( $name ) . ']', … … 174 176 175 177 <?php endif; ?> 178 179 <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?> 176 180 177 181 </td> -
trunk/bp-core/bp-core-admin.php
r6285 r6310 368 368 */ 369 369 public function add_settings_link( $links, $file ) { 370 global $bp; 371 372 if ( plugin_basename( $bp->file ) == $file ) { 370 371 if ( buddypress()->basename == $file ) { 373 372 $url = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); 374 373 $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>'; -
trunk/bp-core/bp-core-classes.php
r6259 r6310 877 877 */ 878 878 class BP_Button { 879 // Button properties 879 880 /** Button properties *****************************************************/ 880 881 881 882 /** … … 884 885 * @var integer 885 886 */ 886 var $id;887 private $id = ''; 887 888 888 889 /** … … 891 892 * @var string 892 893 */ 893 var $component;894 private $component = 'core'; 894 895 895 896 /** … … 898 899 * @var boolean 899 900 */ 900 var $must_be_logged_in; 901 902 /** 903 * True or false if the button should not be displayed while viewing your own profile. 901 private $must_be_logged_in = true; 902 903 /** 904 * True or false if the button should not be displayed while viewing your 905 * own profile. 904 906 * 905 907 * @var boolean 906 908 */ 907 var $block_self; 908 909 910 // Wrapper 909 private $block_self = true; 910 911 /** Wrapper ***************************************************************/ 911 912 912 913 /** … … 916 917 * @var mixed div|span|p|li, or false for no wrapper 917 918 */ 918 var $wrapper;919 private $wrapper = 'div'; 919 920 920 921 /** … … 923 924 * @var string 924 925 */ 925 var $wrapper_class;926 private $wrapper_class = ''; 926 927 927 928 /** … … 930 931 * @var string 931 932 */ 932 var $wrapper_id; 933 934 935 // Button 933 private $wrapper_id = ''; 934 935 /** Button ****************************************************************/ 936 936 937 937 /** … … 940 940 * @var string 941 941 */ 942 var $link_href;942 private $link_href = ''; 943 943 944 944 /** … … 947 947 * @var string 948 948 */ 949 var $link_class;949 private $link_class = ''; 950 950 951 951 /** … … 954 954 * @var string 955 955 */ 956 var $link_id;956 private $link_id = ''; 957 957 958 958 /** … … 961 961 * @var string 962 962 */ 963 var $link_rel;963 private $link_rel = ''; 964 964 965 965 /** … … 968 968 * @var string 969 969 */ 970 var $link_title;970 private $link_title = ''; 971 971 972 972 /** … … 975 975 * @var string 976 976 */ 977 var $link_text; 978 979 980 // HTML result 981 982 var $contents; 983 984 /** 985 * bp_button() 986 * 977 private $link_text = ''; 978 979 /** HTML result ***********************************************************/ 980 981 public $contents = ''; 982 983 /** 987 984 * Builds the button based on passed parameters: 988 985 * … … 1003 1000 * @return bool False if not allowed 1004 1001 */ 1005 function __construct( $args = '' ) { 1006 1007 // Default arguments 1008 $defaults = array( 1009 'id' => '', 1010 'component' => 'core', 1011 'must_be_logged_in' => true, 1012 'block_self' => true, 1013 1014 'wrapper' => 'div', 1015 'wrapper_id' => '', 1016 'wrapper_class' => '', 1017 1018 'link_href' => '', 1019 'link_title' => '', 1020 'link_id' => '', 1021 'link_class' => '', 1022 'link_rel' => '', 1023 'link_text' => '', 1024 ); 1025 1026 $r = wp_parse_args( $args, $defaults ); 1002 public function __construct( $args = '' ) { 1003 1004 $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) ); 1027 1005 extract( $r, EXTR_SKIP ); 1028 1006 … … 1101 1079 1102 1080 /** 1103 * contents()1104 *1105 1081 * Return contents of button 1106 1082 * 1107 1083 * @return string 1108 1084 */ 1109 function contents() {1085 public function contents() { 1110 1086 return $this->contents; 1111 1087 } 1112 1088 1113 1089 /** 1114 * display()1115 *1116 1090 * Output contents of button 1117 1091 */ 1118 function display() {1092 public function display() { 1119 1093 if ( !empty( $this->contents ) ) 1120 1094 echo $this->contents; -
trunk/bp-core/bp-core-cssjs.php
r6259 r6310 105 105 */ 106 106 function bp_core_add_cropper_inline_css() { 107 global $bp;108 107 ?> 109 108 110 109 <style type="text/css"> 111 110 .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; } 112 .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( <?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif); }111 .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); } 113 112 .jcrop-vline { height: 100%; width: 1px !important; } 114 113 .jcrop-hline { width: 100%; height: 1px !important; } -
trunk/bp-core/bp-core-functions.php
r6259 r6310 911 911 * Are we running multiblog mode? 912 912 * 913 * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is 914 * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog 915 * on the network. Thus, instead of having all 'boonebgorges' links go to 913 * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress 914 * Multisite. "Multiblog" is BuddyPress setup that allows BuddyPress components 915 * to be viewed on every blog on the network, each with their own settings. 916 * 917 * Thus, instead of having all 'boonebgorges' links go to 916 918 * http://example.com/members/boonebgorges 917 * on the root blog, each blog will have its own version of the same profilecontent, eg919 * on the root blog, each blog will have its own version of the same content, eg 918 920 * http://site2.example.com/members/boonebgorges (for subdomains) 919 921 * http://example.com/site2/members/boonebgorges (for subdirectories) 920 922 * 921 * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root 922 * blog. 923 * Multiblog mode is disabled by default, meaning that all BuddyPress content 924 * must be viewed on the root blog. It's also recommended not to use the 925 * BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated 926 * on individual sites. 927 * 928 * Why would you want to use this? Originally it was intended to allow 929 * BuddyPress to live in mu-plugins and be visible on mapped domains. This is 930 * a very small use-case with large architectural shortcomings, so do not go 931 * down this road unless you specifically need to. 923 932 * 924 933 * @package BuddyPress … … 929 938 */ 930 939 function bp_is_multiblog_mode() { 931 return apply_filters( 'bp_is_multiblog_mode', is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ); 940 941 // Setup some default values 942 $retval = false; 943 $is_multisite = is_multisite(); 944 $network_active = bp_is_network_activated(); 945 $is_multiblog = defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG; 946 947 // Multisite, Network Activated, and Specifically Multiblog 948 if ( $is_multisite && $network_active && $is_multiblog ) { 949 $retval = true; 950 951 // Multisite, but not network activated 952 } elseif ( $is_multisite && ! $network_active ) { 953 $retval = true; 954 } 955 956 return apply_filters( 'bp_is_multiblog_mode', $retval ); 932 957 } 933 958 … … 1077 1102 1078 1103 // Links belong in network admin 1079 if ( bp_core_do_network_admin() ) 1104 if ( bp_core_do_network_admin() ) { 1080 1105 $url = network_admin_url( $path, $scheme ); 1081 1106 1082 1107 // Links belong in site admin 1083 else1108 } else { 1084 1109 $url = admin_url( $path, $scheme ); 1110 } 1085 1111 1086 1112 return $url; 1087 1113 } 1088 1114 1115 /** 1116 * Should BuddyPress appear in network admin, or site admin? 1117 * 1118 * Because BuddyPress can be installed in multiple ways and with multiple 1119 * configurations, we need to check a few things to be confident about where 1120 * to hook into certain areas of WordPress's admin. 1121 * 1122 * This function defaults to BuddyPress being network activated. 1123 * @since BuddyPress (1.5) 1124 * 1125 * @uses bp_is_network_activated() 1126 * @uses bp_is_multiblog_mode() 1127 * @return boolean 1128 */ 1089 1129 function bp_core_do_network_admin() { 1090 $do_network_admin = false; 1091 1092 if ( is_multisite() && !bp_is_multiblog_mode() ) 1093 $do_network_admin = true; 1094 1095 return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); 1130 1131 // Default 1132 $retval = bp_is_network_activated(); 1133 1134 if ( bp_is_multiblog_mode() ) 1135 $retval = false; 1136 1137 return (bool) apply_filters( 'bp_core_do_network_admin', $retval ); 1096 1138 } 1097 1139 … … 1100 1142 1101 1143 return apply_filters( 'bp_core_admin_hook', $hook ); 1144 } 1145 1146 /** 1147 * Is BuddyPress active at the network level for this network? 1148 * 1149 * Used to determine admin menu placement, and where settings and options are 1150 * stored. If you're being *really* clever and manually pulling BuddyPress in 1151 * with an mu-plugin or some other method, you'll want to 1152 * 1153 * @since BuddyPress (1.7) 1154 * @return boolean 1155 */ 1156 function bp_is_network_activated() { 1157 1158 // Default to is_multisite() 1159 $retval = is_multisite(); 1160 1161 // Check the sitewide plugins array 1162 $base = buddypress()->basename; 1163 $plugins = get_site_option( 'active_sitewide_plugins' ); 1164 1165 // Override is_multisite() if not network activated 1166 if ( ! is_array( $plugins ) || ! isset( $plugins[$base] ) ) 1167 $retval = false; 1168 1169 return (bool) apply_filters( 'bp_is_network_activated', $retval ); 1102 1170 } 1103 1171 -
trunk/bp-forums/bp-forums-admin.php
r6195 r6310 4 4 5 5 function bp_forums_add_admin_menu() { 6 global $bp;7 6 8 7 if ( !is_super_admin() ) … … 23 22 */ 24 23 function bp_forums_bbpress_admin() { 25 global $bp;26 24 27 25 // The text and URL of the Site Wide Forums button differs depending on whether bbPress … … 110 108 111 109 function bp_forums_bbpress_install_wizard() { 112 $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );110 $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); 113 111 $bbpress_plugin_is_active = false; 114 112 -
trunk/bp-forums/deprecated/1.6.php
r6110 r6310 85 85 86 86 function bp_forums_bbpress_install_wizard() { 87 $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );87 $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); 88 88 89 89 $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
Note: See TracChangeset
for help on using the changeset viewer.