<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][5758] trunk: Clean up $bp-&gt;current_component, $bp-&gt;current_action, and $bp-&gt;current_item usage.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/5758">5758</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-02-13 05:46:52 +0000 (Mon, 13 Feb 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up $bp-&gt;current_component, $bp-&gt;current_action, and $bp-&gt;current_item usage. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3738">#3738</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityscreensphp">trunk/bp-activity/bp-activity-screens.php</a></li>
<li><a href="#trunkbpactivitybpactivitytemplatephp">trunk/bp-activity/bp-activity-template.php</a></li>
<li><a href="#trunkbpcorebpcorebuddybarphp">trunk/bp-core/bp-core-buddybar.php</a></li>
<li><a href="#trunkbpcorebpcorefiltersphp">trunk/bp-core/bp-core-filters.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatephp">trunk/bp-core/bp-core-template.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsloaderphp">trunk/bp-groups/bp-groups-loader.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatephp">trunk/bp-groups/bp-groups-template.php</a></li>
<li><a href="#trunkbpmembersbpmemberstemplatephp">trunk/bp-members/bp-members-template.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatephp">trunk/bp-messages/bp-messages-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityscreensphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-screens.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-screens.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-activity/bp-activity-screens.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">         if ( !bp_is_activity_component() )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        if ( empty( $bp-&gt;current_action ) || !is_numeric( $bp-&gt;current_action ) )
</del><ins>+        if ( ! bp_current_action() || !is_numeric( bp_current_action() ) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         // Get the activity details
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">                 // Redirect based on logged in status
</span><span class="cx">                 is_user_logged_in() ?
</span><span class="cx">                         bp_core_redirect( bp_loggedin_user_domain() ) :
</span><del>-                        bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . esc_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $bp-&gt;current_action . '/' ) ) );
</del><ins>+                        bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . esc_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . bp_current_action() . '/' ) ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) );
</span><span class="lines">@@ -259,13 +259,11 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 1.2.0
</span><span class="cx">  *
</span><del>- * @global object $bp BuddyPress global settings
</del><span class="cx">  * @uses bp_get_user_meta()
</span><span class="cx">  * @uses bp_core_get_username()
</span><span class="cx">  * @uses do_action() To call the 'bp_activity_screen_notification_settings' hook
</span><span class="cx">  */
</span><span class="cx"> function bp_activity_screen_notification_settings() {
</span><del>-        global $bp;
</del><span class="cx"> 
</span><span class="cx">         if ( !$mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) )
</span><span class="cx">                 $mention = 'yes';
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-template.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-template.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-activity/bp-activity-template.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -276,8 +276,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // The default scope should recognize custom slugs
</span><del>-        if ( array_key_exists( $bp-&gt;current_action, (array) $bp-&gt;loaded_components ) ) {
-                $scope = $bp-&gt;loaded_components[$bp-&gt;current_action];
</del><ins>+        if ( array_key_exists( bp_current_action(), (array) $bp-&gt;loaded_components ) ) {
+                $scope = $bp-&gt;loaded_components[bp_current_action()];
</ins><span class="cx">         }
</span><span class="cx">         else
</span><span class="cx">                 $scope = bp_current_action();
</span><span class="lines">@@ -1811,15 +1811,12 @@
</span><span class="cx">          *
</span><span class="cx">          * @since 1.2.0
</span><span class="cx">          *
</span><del>-         * @global object $bp BuddyPress global settings
</del><span class="cx">          * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook
</span><span class="cx">          *
</span><span class="cx">          * @return string The activity permalink id
</span><span class="cx">          */
</span><span class="cx">         function bp_get_activity_permalink_id() {
</span><del>-                global $bp;
-
-                return apply_filters( 'bp_get_activity_permalink_id', $bp-&gt;current_action );
</del><ins>+                return apply_filters( 'bp_get_activity_permalink_id', bp_current_action() );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkbpcorebpcorebuddybarphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-buddybar.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-buddybar.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-core/bp-core-buddybar.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -124,11 +124,12 @@
</span><span class="cx">                 $bp-&gt;current_action = '';
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( $bp-&gt;current_component == $parent_slug &amp;&amp; !$bp-&gt;current_action ) {
-                if ( !is_object( $screen_function[0] ) )
</del><ins>+        if ( bp_is_current_component( $parent_slug ) &amp;&amp; !bp_current_action() ) {
+                if ( !is_object( $screen_function[0] ) ) {
</ins><span class="cx">                         add_action( 'bp_screens', $screen_function );
</span><del>-                else
</del><ins>+                } else {
</ins><span class="cx">                         add_action( 'bp_screens', array( &amp;$screen_function[0], $screen_function[1] ) );
</span><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 if ( $subnav_slug ) {
</span><span class="cx">                         $bp-&gt;current_action               = $subnav_slug;
</span><span class="lines">@@ -236,18 +237,19 @@
</span><span class="cx">          */
</span><span class="cx"> 
</span><span class="cx">         // If we *don't* meet condition (1), return
</span><del>-        if ( $bp-&gt;current_component != $parent_slug &amp;&amp; $bp-&gt;current_item != $parent_slug )
</del><ins>+        if ( ! bp_is_current_component( $parent_slug ) &amp;&amp; ! bp_is_current_item( $parent_slug ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         // If we *do* meet condition (2), then the added subnav item is currently being requested
</span><del>-        if ( ( !empty( $bp-&gt;current_action ) &amp;&amp; $slug == $bp-&gt;current_action ) || ( bp_is_user() &amp;&amp; empty( $bp-&gt;current_action ) &amp;&amp; $screen_function == $bp-&gt;bp_nav[$parent_slug]['screen_function'] ) ) {
</del><ins>+        if ( ( bp_current_action() &amp;&amp; bp_is_current_action( $slug ) ) || ( bp_is_user() &amp;&amp; ! bp_current_action() &amp;&amp; ( $screen_function == $bp-&gt;bp_nav[$parent_slug]['screen_function'] ) ) ) {
</ins><span class="cx"> 
</span><span class="cx">                 // Before hooking the screen function, check user access
</span><del>-                if ( $user_has_access ) {
-                        if ( !is_object( $screen_function[0] ) )
</del><ins>+                if ( !empty( $user_has_access ) ) {
+                        if ( !is_object( $screen_function[0] ) ) {
</ins><span class="cx">                                 add_action( 'bp_screens', $screen_function );
</span><del>-                        else
</del><ins>+                        } else {
</ins><span class="cx">                                 add_action( 'bp_screens', array( &amp;$screen_function[0], $screen_function[1] ) );
</span><ins>+                        }
</ins><span class="cx">                 } else {
</span><span class="cx">                         // When the content is off-limits, we handle the situation differently
</span><span class="cx">                         // depending on whether the current user is logged in
</span></span></pre></div>
<a id="trunkbpcorebpcorefiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-filters.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-filters.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-core/bp-core-filters.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -286,14 +286,14 @@
</span><span class="cx"> 
</span><span class="cx">         // A single group
</span><span class="cx">         } elseif ( bp_is_active( 'groups' ) &amp;&amp; !empty( $bp-&gt;groups-&gt;current_group ) &amp;&amp; !empty( $bp-&gt;bp_options_nav[$bp-&gt;groups-&gt;current_group-&gt;slug] ) ) {
</span><del>-                $subnav = isset( $bp-&gt;bp_options_nav[$bp-&gt;groups-&gt;current_group-&gt;slug][$bp-&gt;current_action]['name'] ) ? $bp-&gt;bp_options_nav[$bp-&gt;groups-&gt;current_group-&gt;slug][$bp-&gt;current_action]['name'] : '';
</del><ins>+                $subnav = isset( $bp-&gt;bp_options_nav[$bp-&gt;groups-&gt;current_group-&gt;slug][bp_current_action()]['name'] ) ? $bp-&gt;bp_options_nav[$bp-&gt;groups-&gt;current_group-&gt;slug][bp_current_action()]['name'] : '';
</ins><span class="cx">                 // translators: &quot;group name | group nav section name&quot;
</span><span class="cx">                 $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp-&gt;bp_options_title, $subnav );
</span><span class="cx"> 
</span><span class="cx">         // A single item from a component other than groups
</span><span class="cx">         } elseif ( bp_is_single_item() ) {
</span><span class="cx">                 // translators: &quot;component item name | component nav section name | root component name&quot;
</span><del>-                $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp-&gt;bp_options_title, $bp-&gt;bp_options_nav[$bp-&gt;current_item][$bp-&gt;current_action]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
</del><ins>+                $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp-&gt;bp_options_title, $bp-&gt;bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
</ins><span class="cx"> 
</span><span class="cx">         // An index or directory
</span><span class="cx">         } elseif ( bp_is_directory() ) {
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-template.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-template.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-core/bp-core-template.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> 
</span><span class="cx">         // If we are looking at a member profile, then the we can use the current component as an
</span><span class="cx">         // index. Otherwise we need to use the component's root_slug
</span><del>-        $component_index = !empty( $bp-&gt;displayed_user ) ? $bp-&gt;current_component : bp_get_root_slug( $bp-&gt;current_component );
</del><ins>+        $component_index = !empty( $bp-&gt;displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
</ins><span class="cx"> 
</span><span class="cx">         if ( !bp_is_single_item() ) {
</span><span class="cx">                 if ( !isset( $bp-&gt;bp_options_nav[$component_index] ) || count( $bp-&gt;bp_options_nav[$component_index] ) &lt; 1 ) {
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx">                         $the_index = $component_index;
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><del>-                if ( !isset( $bp-&gt;bp_options_nav[$bp-&gt;current_item] ) || count( $bp-&gt;bp_options_nav[$bp-&gt;current_item] ) &lt; 1 ) {
</del><ins>+                if ( !isset( $bp-&gt;bp_options_nav[bp_current_item()] ) || count( $bp-&gt;bp_options_nav[bp_current_item()] ) &lt; 1 ) {
</ins><span class="cx">                         return false;
</span><span class="cx">                 } else {
</span><del>-                        $the_index = $bp-&gt;current_item;
</del><ins>+                        $the_index = bp_current_item();
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">                         continue;
</span><span class="cx"> 
</span><span class="cx">                 // If the current action or an action variable matches the nav item id, then add a highlight CSS class.
</span><del>-                if ( $subnav_item['slug'] == $bp-&gt;current_action ) {
</del><ins>+                if ( $subnav_item['slug'] == bp_current_action() ) {
</ins><span class="cx">                         $selected = ' class=&quot;current selected&quot;';
</span><span class="cx">                 } else {
</span><span class="cx">                         $selected = '';
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // Use current global component if none passed
</span><span class="cx">                 if ( empty( $component ) )
</span><del>-                        $component = $bp-&gt;current_component;
</del><ins>+                        $component = bp_current_component();
</ins><span class="cx"> 
</span><span class="cx">                 // Component is active
</span><span class="cx">                 if ( !empty( $bp-&gt;active_components[$component] ) ) {
</span><span class="lines">@@ -694,7 +694,7 @@
</span><span class="cx"> 
</span><span class="cx">         // If no slug is passed, look at current_component
</span><span class="cx">         if ( empty( $root_slug ) )
</span><del>-                $root_slug = $bp-&gt;current_component;
</del><ins>+                $root_slug = bp_current_component();
</ins><span class="cx"> 
</span><span class="cx">         // No current component or root slug, so flee
</span><span class="cx">         if ( empty( $root_slug ) )
</span><span class="lines">@@ -762,6 +762,7 @@
</span><span class="cx">                 $component = 'profile';
</span><span class="cx"> 
</span><span class="cx">         if ( !empty( $bp-&gt;current_component ) ) {
</span><ins>+
</ins><span class="cx">                 // First, check to see whether $component_name and the current
</span><span class="cx">                 // component are a simple match
</span><span class="cx">                 if ( $bp-&gt;current_component == $component ) {
</span><span class="lines">@@ -780,8 +781,9 @@
</span><span class="cx">                 // non-translatable component name. If so, we can return its
</span><span class="cx">                 // corresponding slug from $bp-&gt;active_components.
</span><span class="cx">                 } else if ( $key = array_search( $component, $bp-&gt;active_components ) ) {
</span><del>-                        if ( strstr( $bp-&gt;current_component, $key ) )
</del><ins>+                        if ( strstr( $bp-&gt;current_component, $key ) ) {
</ins><span class="cx">                                 $is_current_component = true;
</span><ins>+                        }
</ins><span class="cx"> 
</span><span class="cx">                 // If we haven't found a match yet, check against the root_slugs
</span><span class="cx">                 // created by $bp-&gt;pages, as well as the regular slugs
</span><span class="lines">@@ -789,8 +791,9 @@
</span><span class="cx">                         foreach ( $bp-&gt;active_components as $id ) {
</span><span class="cx">                                 // If the $component parameter does not match the current_component,
</span><span class="cx">                                 // then move along, these are not the droids you are looking for
</span><del>-                                if ( empty( $bp-&gt;{$id}-&gt;root_slug ) || $bp-&gt;{$id}-&gt;root_slug != $bp-&gt;current_component )
</del><ins>+                                if ( empty( $bp-&gt;{$id}-&gt;root_slug ) || $bp-&gt;{$id}-&gt;root_slug != $bp-&gt;current_component ) {
</ins><span class="cx">                                         continue;
</span><ins>+                                }
</ins><span class="cx"> 
</span><span class="cx">                                 if ( $id == $component ) {
</span><span class="cx">                                         $is_current_component = true;
</span><span class="lines">@@ -807,8 +810,9 @@
</span><span class="cx">                 $page_template = $custom_fields[0];
</span><span class="cx"> 
</span><span class="cx">                 // Component name is in the page template name
</span><del>-                if ( !empty( $page_template ) &amp;&amp; strstr( strtolower( $page_template ), strtolower( $component ) ) )
</del><ins>+                if ( !empty( $page_template ) &amp;&amp; strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
</ins><span class="cx">                         $is_current_component = true;
</span><ins>+                }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">          return apply_filters( 'bp_is_current_component', $is_current_component, $component );
</span><span class="lines">@@ -832,9 +836,7 @@
</span><span class="cx">  * @return bool True if the current action matches $action
</span><span class="cx">  */
</span><span class="cx"> function bp_is_current_action( $action = '' ) {
</span><del>-        global $bp;
-
-        if ( $action == $bp-&gt;current_action )
</del><ins>+        if ( $action == bp_current_action() )
</ins><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">         return false;
</span><span class="lines">@@ -1080,9 +1082,7 @@
</span><span class="cx"> /** Activity ******************************************************************/
</span><span class="cx"> 
</span><span class="cx"> function bp_is_single_activity() {
</span><del>-        global $bp;
-
-        if ( bp_is_activity_component() &amp;&amp; is_numeric( $bp-&gt;current_action ) )
</del><ins>+        if ( bp_is_activity_component() &amp;&amp; is_numeric( bp_current_action() ) )
</ins><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-loader.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-loader.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-groups/bp-groups-loader.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><span class="cx">                 // If the user was attempting to access a group, but no group by that name was found, 404
</span><del>-                if ( bp_is_groups_component() &amp;&amp; empty( $this-&gt;current_group ) &amp;&amp; !empty( $bp-&gt;current_action ) &amp;&amp; !in_array( $bp-&gt;current_action, $this-&gt;forbidden_names ) ) {
</del><ins>+                if ( bp_is_groups_component() &amp;&amp; empty( $this-&gt;current_group ) &amp;&amp; bp_current_action() &amp;&amp; !in_array( bp_current_action(), $this-&gt;forbidden_names ) ) {
</ins><span class="cx">                         bp_do_404();
</span><span class="cx">                         return;
</span><span class="cx">                 }
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">                         
</span><span class="cx">                         // Prepare for a redirect to the canonical URL
</span><span class="cx">                         $bp-&gt;redirect_stack['base_url']  = bp_get_group_permalink( $this-&gt;current_group );
</span><del>-                        $bp-&gt;redirect_stack['action']          = $bp-&gt;current_action;
</del><ins>+                        $bp-&gt;redirect_stack['action']          = bp_current_action();
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 // Group access control
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-template.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-template.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-groups/bp-groups-template.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -245,13 +245,13 @@
</span><span class="cx">                 $user_id = bp_displayed_user_id();
</span><span class="cx"> 
</span><span class="cx">         // Type
</span><del>-        if ( 'my-groups' == $bp-&gt;current_action ) {
</del><ins>+        if ( bp_is_current_action( 'my-groups' ) ) {
</ins><span class="cx">                 if ( 'most-popular' == $order ) {
</span><span class="cx">                         $type = 'popular';
</span><span class="cx">                 } elseif ( 'alphabetically' == $order ) {
</span><span class="cx">                         $type = 'alphabetical';
</span><span class="cx">                 }
</span><del>-        } elseif ( 'invites' == $bp-&gt;current_action ) {
</del><ins>+        } elseif ( bp_is_current_action( 'invites' ) ) {
</ins><span class="cx">                 $type = 'invites';
</span><span class="cx">         } elseif ( isset( $bp-&gt;groups-&gt;current_group-&gt;slug ) &amp;&amp; $bp-&gt;groups-&gt;current_group-&gt;slug ) {
</span><span class="cx">                 $type = 'single-group';
</span></span></pre></div>
<a id="trunkbpmembersbpmemberstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-members/bp-members-template.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-members/bp-members-template.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-members/bp-members-template.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -705,7 +705,7 @@
</span><span class="cx">                 $selected = '';
</span><span class="cx"> 
</span><span class="cx">                 // If the current component matches the nav item id, then add a highlight CSS class.
</span><del>-                if ( !bp_is_directory() &amp;&amp; $bp-&gt;active_components[$bp-&gt;current_component] == $nav_item['css_id'] ) {
</del><ins>+                if ( !bp_is_directory() &amp;&amp; $bp-&gt;active_components[bp_current_component()] == $nav_item['css_id'] ) {
</ins><span class="cx">                         $selected = ' class=&quot;current selected&quot;';
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -750,7 +750,7 @@
</span><span class="cx">                         continue;
</span><span class="cx"> 
</span><span class="cx">                 $selected = '';
</span><del>-                if ( $bp-&gt;current_component == $user_nav_item['slug'] ) {
</del><ins>+                if ( bp_is_current_component( $user_nav_item['slug'] ) ) {
</ins><span class="cx">                         $selected = ' class=&quot;current selected&quot;';
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-template.php (5757 => 5758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-template.php        2012-02-13 05:36:12 UTC (rev 5757)
+++ trunk/bp-messages/bp-messages-template.php        2012-02-13 05:46:52 UTC (rev 5758)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">                 $this-&gt;in_the_loop = true;
</span><span class="cx">                 $this-&gt;thread = $this-&gt;next_thread();
</span><span class="cx"> 
</span><del>-                if ( 'notices' != $bp-&gt;current_action ) {
</del><ins>+                if ( ! bp_is_current_action( 'notices' ) ) {
</ins><span class="cx">                         $last_message_index = count( $this-&gt;thread-&gt;messages ) - 1;
</span><span class="cx">                         $this-&gt;thread-&gt;messages = array_reverse( (array) $this-&gt;thread-&gt;messages );
</span><span class="cx"> 
</span><span class="lines">@@ -167,26 +167,27 @@
</span><span class="cx">         global $bp, $messages_template;
</span><span class="cx"> 
</span><span class="cx">         $defaults = array(
</span><del>-                'user_id' =&gt; bp_loggedin_user_id(),
-                'box' =&gt; 'inbox',
</del><ins>+                'user_id'  =&gt; bp_loggedin_user_id(),
+                'box'      =&gt; 'inbox',
</ins><span class="cx">                 'per_page' =&gt; 10,
</span><del>-                'max' =&gt; false,
-                'type' =&gt; 'all'
</del><ins>+                'max'      =&gt; false,
+                'type'     =&gt; 'all'
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><del>-        if ( 'notices' == $bp-&gt;current_action &amp;&amp; !bp_current_user_can( 'bp_moderate' ) ) {
</del><ins>+        if ( bp_is_current_action( 'notices' ) &amp;&amp; !bp_current_user_can( 'bp_moderate' ) ) {
</ins><span class="cx">                 wp_redirect( bp_displayed_user_id() );
</span><span class="cx">         } else {
</span><del>-                if ( 'inbox' == $bp-&gt;current_action )
</del><ins>+                if ( bp_is_current_action( 'inbox' ) ) {
</ins><span class="cx">                         bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp-&gt;messages-&gt;id, 'new_message' );
</span><ins>+                }
</ins><span class="cx"> 
</span><del>-                if ( 'sentbox' == $bp-&gt;current_action )
</del><ins>+                if ( bp_is_current_action( 'sentbox' ) )
</ins><span class="cx">                         $box = 'sentbox';
</span><span class="cx"> 
</span><del>-                if ( 'notices' == $bp-&gt;current_action )
</del><ins>+                if ( bp_is_current_action( 'notices' ) )
</ins><span class="cx">                         $box = 'notices';
</span><span class="cx"> 
</span><span class="cx">                 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );
</span><span class="lines">@@ -246,7 +247,7 @@
</span><span class="cx"> }
</span><span class="cx">         function bp_get_message_thread_to() {
</span><span class="cx">                 global $messages_template;
</span><del>-                return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template-&gt;thread-&gt;recipients) );
</del><ins>+                return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template-&gt;thread-&gt;recipients ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_message_thread_view_link() {
</span><span class="lines">@@ -262,7 +263,7 @@
</span><span class="cx"> }
</span><span class="cx">         function bp_get_message_thread_delete_link() {
</span><span class="cx">                 global $messages_template, $bp;
</span><del>-                return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp-&gt;messages-&gt;slug . '/' . $bp-&gt;current_action . '/delete/' . $messages_template-&gt;thread-&gt;thread_id ), 'messages_delete_thread' ) );
</del><ins>+                return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp-&gt;messages-&gt;slug . '/' . bp_current_action() . '/delete/' . $messages_template-&gt;thread-&gt;thread_id ), 'messages_delete_thread' ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_message_css_class() {
</span><span class="lines">@@ -415,14 +416,14 @@
</span><span class="cx">                 &lt;option value=&quot;all&quot;&gt;&lt;?php _e('All', 'buddypress') ?&gt;&lt;/option&gt;
</span><span class="cx">         &lt;/select&gt; &amp;nbsp;
</span><span class="cx"> 
</span><del>-        &lt;?php if ( $bp-&gt;current_action != 'sentbox' &amp;&amp; $bp-&gt;current_action != 'notices' ) : ?&gt;
</del><ins>+        &lt;?php if ( ! bp_is_current_action( 'sentbox' ) &amp;&amp; bp_is_current_action( 'notices' ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;a href=&quot;#&quot; id=&quot;mark_as_read&quot;&gt;&lt;?php _e('Mark as Read', 'buddypress') ?&gt;&lt;/a&gt; &amp;nbsp;
</span><span class="cx">                 &lt;a href=&quot;#&quot; id=&quot;mark_as_unread&quot;&gt;&lt;?php _e('Mark as Unread', 'buddypress') ?&gt;&lt;/a&gt; &amp;nbsp;
</span><span class="cx"> 
</span><span class="cx">         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;a href=&quot;#&quot; id=&quot;delete_&lt;?php echo $bp-&gt;current_action ?&gt;_messages&quot;&gt;&lt;?php _e('Delete Selected', 'buddypress') ?&gt;&lt;/a&gt; &amp;nbsp;
</del><ins>+        &lt;a href=&quot;#&quot; id=&quot;delete_&lt;?php echo bp_current_action(); ?&gt;_messages&quot;&gt;&lt;?php _e( 'Delete Selected', 'buddypress' ); ?&gt;&lt;/a&gt; &amp;nbsp;
</ins><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>