Skip to:
Content

BuddyPress.org

Changeset 8427


Ignore:
Timestamp:
05/16/2014 10:42:09 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Groups Admin:

  • Mark methods of BP_Groups_List_Table class as public.
  • Properly filter Group name and use it across list table for link, avatar, etc...

See #5645.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-admin.php

    r8426 r8427  
    10751075         * @since BuddyPress (1.7.0)
    10761076         */
    1077         function prepare_items() {
     1077        public function prepare_items() {
    10781078                global $groups_template;
    10791079
     
    11821182         * @return array Array of column headers.
    11831183         */
    1184         function get_column_info() {
     1184        public function get_column_info() {
    11851185                $this->_column_headers = array(
    11861186                        $this->get_columns(),
     
    11971197         * @since BuddyPress (1.7.0)
    11981198         */
    1199         function no_items() {
     1199        public function no_items() {
    12001200                _e( 'No groups found.', 'buddypress' );
    12011201        }
     
    12061206         * @since BuddyPress (1.7.0)
    12071207        */
    1208         function display() {
     1208        public function display() {
    12091209                extract( $this->_args );
    12101210
     
    12401240         * @param object $item The current group item in the loop.
    12411241         */
    1242         function single_row( $item = array() ) {
     1242        public function single_row( $item = array() ) {
    12431243                static $even = false;
    12441244
     
    12661266         * @since BuddyPress (1.7.0)
    12671267         */
    1268         function get_views() {
     1268        public function get_views() {
    12691269                $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?>
    12701270
     
    12871287         * @return array Key/value pairs for the bulk actions dropdown.
    12881288         */
    1289         function get_bulk_actions() {
     1289        public function get_bulk_actions() {
    12901290                return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
    12911291                        'delete' => __( 'Delete', 'buddypress' )
     
    13021302         * @return array Array of column titles.
    13031303         */
    1304         function get_columns() {
     1304        public function get_columns() {
    13051305                return apply_filters( 'bp_groups_list_table_get_columns', array(
    13061306                        'cb'          => '<input name type="checkbox" />',
     
    13291329         * @return array Array of sortable column names.
    13301330         */
    1331         function get_sortable_columns() {
     1331        public function get_sortable_columns() {
    13321332                return array(
    13331333                        'gid'         => array( 'gid', false ),
     
    13471347         * @param array $item A singular item (one full row).
    13481348         */
    1349         function column_cb( $item = array() ) {
     1349        public function column_cb( $item = array() ) {
    13501350                printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id'] );
    13511351        }
     
    13601360         * @param array $item A singular item (one full row).
    13611361         */
    1362         function column_gid( $item = array() ) {
    1363                 echo '<strong>' . $item['id'] . '</strong>';
     1362        public function column_gid( $item = array() ) {
     1363                echo '<strong>' . absint( $item['id'] ) . '</strong>';
    13641364        }
    13651365
     
    13751375         * @param array $item A singular item (one full row).
    13761376         */
    1377         function column_comment( $item = array() ) {
     1377        public function column_comment( $item = array() ) {
    13781378
    13791379                // Preorder items: Edit | Delete | View
     
    13921392                $edit_url   = $base_url . '&amp;action=edit';
    13931393                $view_url   = bp_get_group_permalink( $item_obj );
     1394                $group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item );
    13941395
    13951396                // Rollover actions
     
    14131414                        'type'       => 'thumb',
    14141415                        'avatar_dir' => 'group-avatars',
    1415                         'alt'        => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ),
     1416                        'alt'        => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ),
    14161417                        'width'      => '32',
    14171418                        'height'     => '32',
    1418                         'title'      => $item['name']
     1419                        'title'      => $group_name
    14191420                ) );
    14201421
    1421                 $content = apply_filters_ref_array( 'bp_get_group_name', array( sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $item['name'] ), $item ) );
     1422                $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name );
    14221423
    14231424                echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions );
     
    14311432         * @param array Information about the current row.
    14321433         */
    1433         function column_description( $item = array() ) {
     1434        public function column_description( $item = array() ) {
    14341435                echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
    14351436        }
     
    14421443         * @param array Information about the current row.
    14431444         */
    1444         function column_status( $item = array() ) {
     1445        public function column_status( $item = array() ) {
    14451446                $status      = $item['status'];
    14461447                $status_desc = '';
     
    14701471         * @param array Information about the current row.
    14711472         */
    1472         function column_members( $item = array() ) {
     1473        public function column_members( $item = array() ) {
    14731474                $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
    14741475                echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
     
    14821483         * @param array Information about the current row.
    14831484         */
    1484         function column_last_active( $item = array() ) {
     1485        public function column_last_active( $item = array() ) {
    14851486                $last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
    14861487                echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
     
    14951496         * @param string the column name.
    14961497         */
    1497         function column_default( $item = array(), $column_name = '' ) {
     1498        public function column_default( $item = array(), $column_name = '' ) {
    14981499                return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
    14991500        }
Note: See TracChangeset for help on using the changeset viewer.