Changeset 7391
- Timestamp:
- 10/06/2013 03:40:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-admin.php
r7387 r7391 22 22 23 23 /** 24 * Registers the Activity component admin screen 24 * Registers the Activity component admin screen. 25 25 * 26 26 * @since BuddyPress (1.6) … … 44 44 45 45 /** 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. 47 51 * 48 52 * @since BuddyPress (1.7) 49 53 * 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 52 56 */ 53 57 function bp_activity_admin_menu_order( $custom_menus = array() ) { … … 58 62 59 63 /** 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. 62 68 * 63 69 * @since BuddyPress (1.6) … … 129 135 130 136 /** 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) 132 140 * 133 141 * @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. 136 144 * @return string Option value. False to abandon update. 137 * @since BuddyPress (1.6)138 145 */ 139 146 function bp_activity_admin_screen_options( $value, $option, $new_value ) { … … 150 157 151 158 /** 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. 157 165 */ 158 166 function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) { … … 168 176 169 177 /** 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 * 174 185 * @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. 175 189 */ 176 190 function bp_activity_admin_load() { … … 519 533 520 534 /** 521 * Outputs the Activity component admin screens 535 * Outputs the Activity component admin screens. 522 536 * 523 537 * @since BuddyPress (1.6) … … 537 551 538 552 /** 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 * 542 555 * @since BuddyPress (1.6) 543 556 */ … … 629 642 630 643 /** 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 * 634 646 * @since BuddyPress (1.6) 647 * 648 * @param object $item Activity item. 635 649 */ 636 650 function bp_activity_admin_edit_metabox_status( $item ) { … … 684 698 685 699 /** 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 * 689 702 * @since BuddyPress (1.6) 703 * 704 * @param object $item Activity item. 690 705 */ 691 706 function bp_activity_admin_edit_metabox_link( $item ) { … … 700 715 701 716 /** 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 * 705 719 * @since BuddyPress (1.6) 720 * 721 * @param object $item Activity item. 706 722 */ 707 723 function bp_activity_admin_edit_metabox_userid( $item ) { … … 717 733 * Activity type metabox for the Activity admin edit screen 718 734 * 735 * @since BuddyPress (1.6) 736 * 719 737 * @global object $bp BuddyPress global settings 738 * 720 739 * @param object $item Activity item 721 * @since BuddyPress (1.6)722 740 */ 723 741 function bp_activity_admin_edit_metabox_type( $item ) { … … 751 769 752 770 /** 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) 754 774 * 755 775 * @param object $item Activity item 756 * @since BuddyPress (1.6)757 776 */ 758 777 function bp_activity_admin_edit_metabox_itemids( $item ) { … … 774 793 * Display the Activity admin index screen, which contains a list of all the activities. 775 794 * 776 * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table777 * @global string $plugin_page778 795 * @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. 779 799 */ 780 800 function bp_activity_admin_index() { … … 927 947 928 948 /** 929 * Constructor 949 * Constructor. 930 950 * 931 951 * @since BuddyPress (1.6) … … 1043 1063 1044 1064 /** 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) 1046 1068 * 1047 1069 * @return array 1048 * @since BuddyPress (1.6)1049 1070 */ 1050 1071 function get_column_info() { … … 1059 1080 1060 1081 /** 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). 1062 1083 * 1063 1084 * @since BuddyPress (1.6) … … 1068 1089 1069 1090 /** 1070 * Outputs the Activity data table 1091 * Outputs the Activity data table. 1071 1092 * 1072 1093 * @since BuddyPress (1.6) … … 1100 1121 1101 1122 /** 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) 1103 1126 * 1104 1127 * @param object $item The current item 1105 * @since BuddyPress (1.6)1106 1128 */ 1107 1129 function single_row( $item ) { … … 1138 1160 } 1139 1161 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. 1145 1168 */ 1146 1169 function get_bulk_actions() { … … 1156 1179 * Get the table column titles. 1157 1180 * 1181 * @since BuddyPress (1.6) 1182 * 1158 1183 * @see WP_List_Table::single_row_columns() 1159 * @return array1160 * @ since BuddyPress (1.6)1184 * 1185 * @return array The columns to appear in the Activity list table. 1161 1186 */ 1162 1187 function get_columns() { … … 1170 1195 1171 1196 /** 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 * 1175 1201 * @since BuddyPress (1.6) 1176 1202 * @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. 1177 1205 */ 1178 1206 function get_sortable_columns() { … … 1185 1213 1186 1214 /** 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'. 1191 1220 */ 1192 1221 function extra_tablenav( $which ) { … … 1217 1246 1218 1247 /** 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 * 1222 1252 * @see WP_List_Table::single_row_columns() 1223 * @since BuddyPress (1.6) 1253 * 1254 * @param array $item A singular item (one full row). 1224 1255 */ 1225 1256 function column_cb( $item ) { … … 1228 1259 1229 1260 /** 1230 * Author column 1261 * Author column markup. 1262 * 1263 * @since BuddyPress (1.6) 1264 * 1265 * @see WP_List_Table::single_row_columns() 1231 1266 * 1232 1267 * @param array $item A singular item (one full row) 1233 * @see WP_List_Table::single_row_columns()1234 * @since BuddyPress (1.6)1235 1268 */ 1236 1269 function column_author( $item ) { … … 1243 1276 * Called "comment" in the CSS so we can re-use some WP core CSS. 1244 1277 * 1245 * @param array $item A singular item (one full row) 1278 * @since BuddyPress (1.6) 1279 * 1246 1280 * @see WP_List_Table::single_row_columns() 1247 * @since BuddyPress (1.6) 1281 & 1282 * @param array $item A singular item (one full row). 1248 1283 */ 1249 1284 function column_comment( $item ) { … … 1313 1348 1314 1349 /** 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 * 1318 1354 * @see WP_List_Table::single_row_columns() 1319 * @since BuddyPress (1.6) 1355 * 1356 * @param array $item A singular item (one full row). 1320 1357 */ 1321 1358 function column_response( $item ) { … … 1342 1379 1343 1380 /** 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. 1348 1390 */ 1349 1391 protected function get_activity_user_id( $activity_id ) { … … 1375 1417 1376 1418 /** 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. 1382 1428 */ 1383 1429 public static function flatten_activity_array( $tree ){
Note: See TracChangeset
for help on using the changeset viewer.