Skip to:
Content

BuddyPress.org

Ticket #4631: 4631.02.patch

File 4631.02.patch, 6.5 KB (added by boonebgorges, 11 years ago)
  • bp-activity/bp-activity-loader.php

    diff --git bp-activity/bp-activity-loader.php bp-activity/bp-activity-loader.php
    index 651401e..cc54e7b 100644
    class BP_Activity_Component extends BP_Component { 
    106106                        'slug'                  => BP_ACTIVITY_SLUG,
    107107                        'root_slug'             => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG,
    108108                        'has_directory'         => true,
     109                        'directory_title'       => _x( 'Sitewide Activity', 'component directory title', 'buddypress' ),
    109110                        'notification_callback' => 'bp_activity_format_notifications',
    110111                        'search_string'         => __( 'Search Activity...', 'buddypress' ),
    111112                        'global_tables'         => $global_tables,
  • bp-activity/bp-activity-screens.php

    diff --git bp-activity/bp-activity-screens.php bp-activity/bp-activity-screens.php
    index cd0b679..2406771 100644
    class BP_Activity_Theme_Compat { 
    381381        public function directory_dummy_post() {
    382382                bp_theme_compat_reset_post( array(
    383383                        'ID'             => 0,
    384                         'post_title'     => __( 'Sitewide Activity', 'buddypress' ),
     384                        'post_title'     => bp_get_directory_title( 'activity' ),
    385385                        'post_author'    => 0,
    386386                        'post_date'      => 0,
    387387                        'post_content'   => '',
  • bp-core/bp-core-component.php

    diff --git bp-core/bp-core-component.php bp-core/bp-core-component.php
    index d5fab57..c16c17c 100644
    class BP_Component { 
    215215                        'slug'                  => $this->id,
    216216                        'root_slug'             => $default_root_slug,
    217217                        'has_directory'         => false,
     218                        'directory_title'       => '',
    218219                        'notification_callback' => '',
    219220                        'search_string'         => '',
    220221                        'global_tables'         => '',
    class BP_Component { 
    230231                // Does this component have a top-level directory?
    231232                $this->has_directory         = apply_filters( 'bp_' . $this->id . '_has_directory',         $r['has_directory']         );
    232233
     234                // Does this component have a top-level directory?
     235                $this->directory_title       = apply_filters( 'bp_' . $this->id . '_directory_title',       $r['directory_title']         );
     236
    233237                // Search string
    234238                $this->search_string         = apply_filters( 'bp_' . $this->id . '_search_string',         $r['search_string']         );
    235239
  • bp-core/bp-core-filters.php

    diff --git bp-core/bp-core-filters.php bp-core/bp-core-filters.php
    index 9c4dfbe..aecf786 100644
    function bp_modify_page_title( $title, $sep, $seplocation ) { 
    431431
    432432        // An index or directory
    433433        } elseif ( bp_is_directory() ) {
    434                 if ( !bp_current_component() ) {
    435                         $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );
     434
     435                $current_component = bp_current_component();
     436
     437                // No current component (when does this happen?)
     438                if ( empty( $current_component ) ) {
     439                        $title = __( 'Directory', 'buddypress' );
    436440                } else {
    437                         $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );
     441                        $title = bp_get_directory_title( $current_component );
    438442                }
    439443
    440444        // Sign up page
  • bp-core/bp-core-template.php

    diff --git bp-core/bp-core-template.php bp-core/bp-core-template.php
    index 8d0b50c..84a2608 100644
    function bp_get_options_title() { 
    8383        echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) );
    8484}
    8585
     86/**
     87 * Get the directory title for a component.
     88 *
     89 * Used for the <title> element and the page header on the component directory
     90 * page.
     91 *
     92 * @since BuddyPress (2.0.0)
     93 *
     94 * @return string
     95 */
     96function bp_get_directory_title( $component = '' ) {
     97        $title = '';
     98
     99        // Use the string provided by the component
     100        if ( isset( buddypress()->{$component}->directory_title ) ) {
     101                $title = buddypress()->{$component}->directory_title;
     102
     103        // If none is found, concatenate
     104        } else if ( isset( buddypress()->{$component}->name ) ) {
     105                $title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name );
     106        }
     107
     108        return apply_filters( 'bp_get_directory_title', $title, $component );
     109}
     110
    86111/** Avatars *******************************************************************/
    87112
    88113/**
  • bp-groups/bp-groups-loader.php

    diff --git bp-groups/bp-groups-loader.php bp-groups/bp-groups-loader.php
    index b40bf45..ec53658 100644
    class BP_Groups_Component extends BP_Component { 
    147147                        'slug'                  => BP_GROUPS_SLUG,
    148148                        'root_slug'             => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG,
    149149                        'has_directory'         => true,
     150                        'directory_title'       => _x( 'Groups', 'component directory title', 'buddypress' ),
    150151                        'notification_callback' => 'groups_format_notifications',
    151152                        'search_string'         => __( 'Search Groups...', 'buddypress' ),
    152153                        'global_tables'         => $global_tables,
  • bp-groups/bp-groups-screens.php

    diff --git bp-groups/bp-groups-screens.php bp-groups/bp-groups-screens.php
    index f461e6f..ced55a2 100644
    class BP_Groups_Theme_Compat { 
    10211021         */
    10221022        public function directory_dummy_post() {
    10231023
    1024                 $title = apply_filters( 'bp_groups_directory_title', __( 'Groups', 'buddypress' ) );
     1024                $title = apply_filters( 'bp_groups_directory_title', bp_get_directory_title( 'groups' ) );
    10251025
    10261026                bp_theme_compat_reset_post( array(
    10271027                        'ID'             => 0,
  • bp-members/bp-members-loader.php

    diff --git bp-members/bp-members-loader.php bp-members/bp-members-loader.php
    index d88380b..1402195 100644
    class BP_Members_Component extends BP_Component { 
    7272                        'slug'          => BP_MEMBERS_SLUG,
    7373                        'root_slug'     => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG,
    7474                        'has_directory' => true,
     75                        'directory_title' => _x( 'Members', 'component directory title', 'buddypress' ),
    7576                        'global_tables' => array(
    7677                                'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
    7778                        ),
  • bp-members/bp-members-screens.php

    diff --git bp-members/bp-members-screens.php bp-members/bp-members-screens.php
    index 4cb9f40..d652985 100644
    class BP_Members_Theme_Compat { 
    363363        public function directory_dummy_post() {
    364364                bp_theme_compat_reset_post( array(
    365365                        'ID'             => 0,
    366                         'post_title'     => __( 'Members', 'buddypress' ),
     366                        'post_title'     => bp_get_directory_title( 'members' ),
    367367                        'post_author'    => 0,
    368368                        'post_date'      => 0,
    369369                        'post_content'   => '',