Skip to:
Content

BuddyPress.org

Changeset 7391


Ignore:
Timestamp:
10/06/2013 03:40:14 PM (13 years ago)
Author:
boonebgorges
Message:

Inline doc improvements for bp-activity-admin.php

See #5022

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-admin.php

    r7387 r7391  
    2222
    2323/**
    24  * Registers the Activity component admin screen
     24 * Registers the Activity component admin screen.
    2525 *
    2626 * @since BuddyPress (1.6)
     
    4444
    4545/**
    46  * Add activity component to custom menus array
     46 * Add activity component to custom menus array.
     47 *
     48 * Several BuddyPress components have top-level menu items in the Dashboard,
     49 * which all appear together in the middle of the Dashboard menu. This function
     50 * adds the Activity page to the array of these menu items.
    4751 *
    4852 * @since BuddyPress (1.7)
    4953 *
    50  * @param array $custom_menus
    51  * @return array
     54 * @param array $custom_menus The list of top-level BP menu items.
     55 * @return array $custom_menus List of top-level BP menu items, with Activity added
    5256 */
    5357function bp_activity_admin_menu_order( $custom_menus = array() ) {
     
    5862
    5963/**
    60  * AJAX receiver for Activity replies via the admin screen. Adds a new activity
    61  * comment, and returns HTML for a new table row.
     64 * AJAX receiver for Activity replies via the admin screen.
     65 *
     66 * Processes requests to add new activity comments, and echoes HTML for a new
     67 * table row.
    6268 *
    6369 * @since BuddyPress (1.6)
     
    129135
    130136/**
    131  * Handle save/update of screen options for the Activity component admin screen
     137 * Handle save/update of screen options for the Activity component admin screen.
     138 *
     139 * @since BuddyPress (1.6)
    132140 *
    133141 * @param string $value Will always be false unless another plugin filters it first.
    134  * @param string $option Screen option name
    135  * @param string $new_value Screen option form value
     142 * @param string $option Screen option name.
     143 * @param string $new_value Screen option form value.
    136144 * @return string Option value. False to abandon update.
    137  * @since BuddyPress (1.6)
    138145 */
    139146function bp_activity_admin_screen_options( $value, $option, $new_value ) {
     
    150157
    151158/**
    152  * Hide the advanced edit meta boxes by default, so we don't clutter the scren.
    153  *
    154  * @param WP_Screen $screen Screen identifier
    155  * @return array Hidden Meta Boxes
    156  * @since BuddyPress (1.0)
     159 * Hide the advanced edit meta boxes by default, so we don't clutter the screen.
     160 *
     161 * @since BuddyPress (1.6)
     162 *
     163 * @param WP_Screen $screen Screen identifier.
     164 * @return array Hidden Meta Boxes.
    157165 */
    158166function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
     
    168176
    169177/**
    170  * Set up the admin page before any output is sent. Register contextual help and screen options for this admin page.
    171  *
    172  * @global object $bp BuddyPress global settings
    173  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
     178 * Set up the Activity admin page.
     179 *
     180 * Does the following:
     181 *   - Register contextual help and screen options for this admin page.
     182 *   - Enqueues scripts and styles
     183 *   - Catches POST and GET requests related to Activity
     184 *
    174185 * @since BuddyPress (1.6)
     186 *
     187 * @global object $bp BuddyPress global settings.
     188 * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
    175189 */
    176190function bp_activity_admin_load() {
     
    519533
    520534/**
    521  * Outputs the Activity component admin screens
     535 * Outputs the Activity component admin screens.
    522536 *
    523537 * @since BuddyPress (1.6)
     
    537551
    538552/**
    539  * Display the single activity edit screen
    540  *
    541  * @global int $screen_layout_columns Number of columns shown on this admin page
     553 * Display the single activity edit screen.
     554 *
    542555 * @since BuddyPress (1.6)
    543556 */
     
    629642
    630643/**
    631  * Status metabox for the Activity admin edit screen
    632  *
    633  * @param object $item Activity item
     644 * Status metabox for the Activity admin edit screen.
     645 *
    634646 * @since BuddyPress (1.6)
     647 *
     648 * @param object $item Activity item.
    635649 */
    636650function bp_activity_admin_edit_metabox_status( $item ) {
     
    684698
    685699/**
    686  * Primary link metabox for the Activity admin edit screen
    687  *
    688  * @param object $item Activity item
     700 * Primary link metabox for the Activity admin edit screen.
     701 *
    689702 * @since BuddyPress (1.6)
     703 *
     704 * @param object $item Activity item.
    690705 */
    691706function bp_activity_admin_edit_metabox_link( $item ) {
     
    700715
    701716/**
    702  * User ID metabox for the Activity admin edit screen
    703  *
    704  * @param object $item Activity item
     717 * User ID metabox for the Activity admin edit screen.
     718 *
    705719 * @since BuddyPress (1.6)
     720 *
     721 * @param object $item Activity item.
    706722 */
    707723function bp_activity_admin_edit_metabox_userid( $item ) {
     
    717733 * Activity type metabox for the Activity admin edit screen
    718734 *
     735 * @since BuddyPress (1.6)
     736 *
    719737 * @global object $bp BuddyPress global settings
     738 *
    720739 * @param object $item Activity item
    721  * @since BuddyPress (1.6)
    722740 */
    723741function bp_activity_admin_edit_metabox_type( $item ) {
     
    751769
    752770/**
    753  * Primary item ID/Secondary item ID metabox for the Activity admin edit screen
     771 * Primary item ID/Secondary item ID metabox for the Activity admin edit screen.
     772 *
     773 * @since BuddyPress (1.6)
    754774 *
    755775 * @param object $item Activity item
    756  * @since BuddyPress (1.6)
    757776 */
    758777function bp_activity_admin_edit_metabox_itemids( $item ) {
     
    774793 * Display the Activity admin index screen, which contains a list of all the activities.
    775794 *
    776  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table
    777  * @global string $plugin_page
    778795 * @since BuddyPress (1.6)
     796 *
     797 * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
     798 * @global string $plugin_page The current plugin page.
    779799 */
    780800function bp_activity_admin_index() {
     
    927947
    928948        /**
    929          * Constructor
     949         * Constructor.
    930950         *
    931951         * @since BuddyPress (1.6)
     
    10431063
    10441064        /**
    1045          * Get an array of all the columns on the page
     1065         * Get an array of all the columns on the page.
     1066         *
     1067         * @since BuddyPress (1.6)
    10461068         *
    10471069         * @return array
    1048          * @since BuddyPress (1.6)
    10491070         */
    10501071        function get_column_info() {
     
    10591080
    10601081        /**
    1061          * Displays a message on screen when no items are found (e.g. no search matches)
     1082         * Displays a message on screen when no items are found (e.g. no search matches).
    10621083         *
    10631084         * @since BuddyPress (1.6)
     
    10681089
    10691090        /**
    1070          * Outputs the Activity data table
     1091         * Outputs the Activity data table.
    10711092         *
    10721093         * @since BuddyPress (1.6)
     
    11001121
    11011122        /**
    1102          * Generates content for a single row of the table
     1123         * Generates content for a single row of the table.
     1124         *
     1125         * @since BuddyPress (1.6)
    11031126         *
    11041127         * @param object $item The current item
    1105          * @since BuddyPress (1.6)
    11061128         */
    11071129        function single_row( $item ) {
     
    11381160        }
    11391161
    1140                 /**
    1141          * Get bulk actions
    1142          *
    1143          * @return array Key/value pairs for the bulk actions dropdown
    1144          * @since BuddyPress (1.6)
     1162        /**
     1163         * Get bulk actions.
     1164         *
     1165         * @since BuddyPress (1.6)
     1166         *
     1167         * @return array Key/value pairs for the bulk actions dropdown.
    11451168         */
    11461169        function get_bulk_actions() {
     
    11561179         * Get the table column titles.
    11571180         *
     1181         * @since BuddyPress (1.6)
     1182         *
    11581183         * @see WP_List_Table::single_row_columns()
    1159          * @return array
    1160          * @since BuddyPress (1.6)
     1184         *
     1185         * @return array The columns to appear in the Activity list table.
    11611186         */
    11621187        function get_columns() {
     
    11701195
    11711196        /**
    1172          * Get the column names for sortable columns
    1173          *
    1174          * @return array
     1197         * Get the column names for sortable columns.
     1198         *
     1199         * Currently, returns an empty array (no columns are sortable).
     1200         *
    11751201         * @since BuddyPress (1.6)
    11761202         * @todo For this to work, BP_Activity_Activity::get() needs updating to supporting ordering by specific fields
     1203         *
     1204         * @return array The columns that can be sorted on the Activity screen.
    11771205         */
    11781206        function get_sortable_columns() {
     
    11851213
    11861214        /**
    1187          * Markup for the "filter" part of the form (i.e. which activity type to display)
    1188          *
    1189          * @param string $which 'top' or 'bottom'
    1190          * @since BuddyPress (1.6)
     1215         * Markup for the "filter" part of the form (i.e. which activity type to display).
     1216         *
     1217         * @since BuddyPress (1.6)
     1218         *
     1219         * @param string $which 'top' or 'bottom'.
    11911220         */
    11921221        function extra_tablenav( $which ) {
     
    12171246
    12181247        /**
    1219          * Checkbox column
    1220          *
    1221          * @param array $item A singular item (one full row)
     1248         * Checkbox column markup.
     1249         *
     1250         * @since BuddyPress (1.6)
     1251         *
    12221252         * @see WP_List_Table::single_row_columns()
    1223          * @since BuddyPress (1.6)
     1253         *
     1254         * @param array $item A singular item (one full row).
    12241255         */
    12251256        function column_cb( $item ) {
     
    12281259
    12291260        /**
    1230          * Author column
     1261         * Author column markup.
     1262         *
     1263         * @since BuddyPress (1.6)
     1264         *
     1265         * @see WP_List_Table::single_row_columns()
    12311266         *
    12321267         * @param array $item A singular item (one full row)
    1233          * @see WP_List_Table::single_row_columns()
    1234          * @since BuddyPress (1.6)
    12351268         */
    12361269        function column_author( $item ) {
     
    12431276         * Called "comment" in the CSS so we can re-use some WP core CSS.
    12441277         *
    1245          * @param array $item A singular item (one full row)
     1278         * @since BuddyPress (1.6)
     1279         *
    12461280         * @see WP_List_Table::single_row_columns()
    1247          * @since BuddyPress (1.6)
     1281         &
     1282         * @param array $item A singular item (one full row).
    12481283         */
    12491284        function column_comment( $item ) {
     
    13131348
    13141349        /**
    1315          * "In response to" column
    1316          *
    1317          * @param array $item A singular item (one full row)
     1350         * "In response to" column markup.
     1351         *
     1352         * @since BuddyPress (1.6)
     1353         *
    13181354         * @see WP_List_Table::single_row_columns()
    1319          * @since BuddyPress (1.6)
     1355         *
     1356         * @param array $item A singular item (one full row).
    13201357         */
    13211358        function column_response( $item ) {
     
    13421379
    13431380        /**
    1344          * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID.
    1345          *
    1346          * @param int $activity_id Activity ID to retrieve User ID for
    1347          * @since BuddyPress (1.6)
     1381         * Get the user id associated with a given activity item.
     1382         *
     1383         * Wraps bp_activity_get_specific(), with some additional logic for
     1384         * avoiding duplicate queries.
     1385         *
     1386         * @since BuddyPress (1.6)
     1387         *
     1388         * @param int $activity_id Activity ID to retrieve User ID for.
     1389         * @return int User ID of the activity item in question.
    13481390         */
    13491391        protected function get_activity_user_id( $activity_id ) {
     
    13751417
    13761418        /**
    1377          * Helper function to flatten all activites returned from bp_activity_get() into a single array.
    1378          *
    1379          * @param array $tree Source array
    1380          * @return array Flattened array
    1381          * @since BuddyPress (1.6)
     1419         * Flatten the activity array.
     1420         *
     1421         * In some cases, BuddyPress gives us a structured tree of activity
     1422         * items plus their comments. This method converts it to a flat array.
     1423         *
     1424         * @since BuddyPress (1.6)
     1425         *
     1426         * @param array $tree Source array.
     1427         * @return array Flattened array.
    13821428         */
    13831429        public static function flatten_activity_array( $tree ){
Note: See TracChangeset for help on using the changeset viewer.