[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-activity/ -> bp-activity-admin.php (source)

   1  <?php
   2  /**
   3   * BuddyPress Activity component admin screen.
   4   *
   5   * Props to WordPress core for the Comments admin screen, and its contextual
   6   * help text, on which this implementation is heavily based.
   7   *
   8   * @package BuddyPress
   9   * @subpackage ActivityAdmin
  10   * @since 1.6.0
  11   */
  12  
  13  // Exit if accessed directly.
  14  defined( 'ABSPATH' ) || exit;
  15  
  16  // Include WP's list table class.
  17  if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
  18  
  19  // Per_page screen option. Has to be hooked in extremely early.
  20  if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] )
  21      add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 );
  22  
  23  /**
  24   * Register the Activity component admin screen.
  25   *
  26   * @since 1.6.0
  27   */
  28  function bp_activity_add_admin_menu() {
  29  
  30      // Add our screen.
  31      $hook = add_menu_page(
  32          _x( 'Activity', 'Admin Dashbord SWA page title', 'buddypress' ),
  33          _x( 'Activity', 'Admin Dashbord SWA menu', 'buddypress' ),
  34          'bp_moderate',
  35          'bp-activity',
  36          'bp_activity_admin',
  37          'div'
  38      );
  39  
  40      // Hook into early actions to load custom CSS and our init handler.
  41      add_action( "load-$hook", 'bp_activity_admin_load' );
  42  }
  43  add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
  44  
  45  /**
  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.
  51   *
  52   * @since 1.7.0
  53   *
  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.
  56   */
  57  function bp_activity_admin_menu_order( $custom_menus = array() ) {
  58      array_push( $custom_menus, 'bp-activity' );
  59      return $custom_menus;
  60  }
  61  add_filter( 'bp_admin_menu_order', 'bp_activity_admin_menu_order' );
  62  
  63  /**
  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.
  68   *
  69   * @since 1.6.0
  70   */
  71  function bp_activity_admin_reply() {
  72      // Check nonce.
  73      check_ajax_referer( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply' );
  74  
  75      $parent_id = ! empty( $_REQUEST['parent_id'] ) ? (int) $_REQUEST['parent_id'] : 0;
  76      $root_id   = ! empty( $_REQUEST['root_id'] )   ? (int) $_REQUEST['root_id']   : 0;
  77  
  78      // $parent_id is required
  79      if ( empty( $parent_id ) )
  80          die( '-1' );
  81  
  82      // If $root_id not set (e.g. for root items), use $parent_id.
  83      if ( empty( $root_id ) )
  84          $root_id = $parent_id;
  85  
  86      // Check that a reply has been entered.
  87      if ( empty( $_REQUEST['content'] ) )
  88          die( __( 'ERROR: Please type a reply.', 'buddypress' ) );
  89  
  90      // Check parent activity exists.
  91      $parent_activity = new BP_Activity_Activity( $parent_id );
  92      if ( empty( $parent_activity->component ) )
  93          die( __( 'ERROR: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) );
  94  
  95      // @todo: Check if user is allowed to create new activity items
  96      // if ( ! current_user_can( 'bp_new_activity' ) )
  97      if ( ! bp_current_user_can( 'bp_moderate' ) )
  98          die( '-1' );
  99  
 100      // Add new activity comment.
 101      $new_activity_id = bp_activity_new_comment( array(
 102          'activity_id' => $root_id,              // ID of the root activity item.
 103          'content'     => $_REQUEST['content'],
 104          'parent_id'   => $parent_id,            // ID of a parent comment.
 105      ) );
 106  
 107      // Fetch the new activity item, as we need it to create table markup to return.
 108      $new_activity = new BP_Activity_Activity( $new_activity_id );
 109  
 110      // This needs to be set for the BP_Activity_List_Table constructor to work.
 111      set_current_screen( 'toplevel_page_bp-activity' );
 112  
 113      // Set up an output buffer.
 114      ob_start();
 115      $list_table = new BP_Activity_List_Table();
 116      $list_table->single_row( (array) $new_activity );
 117  
 118      // Get table markup.
 119      $response =  array(
 120          'data'     => ob_get_contents(),
 121          'id'       => $new_activity_id,
 122          'position' => -1,
 123          'what'     => 'bp_activity',
 124      );
 125      ob_end_clean();
 126  
 127      // Send response.
 128      $r = new WP_Ajax_Response();
 129      $r->add( $response );
 130      $r->send();
 131  
 132      exit();
 133  }
 134  add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
 135  
 136  /**
 137   * Handle save/update of screen options for the Activity component admin screen.
 138   *
 139   * @since 1.6.0
 140   *
 141   * @param string $value     Will always be false unless another plugin filters it first.
 142   * @param string $option    Screen option name.
 143   * @param string $new_value Screen option form value.
 144   * @return string|int Option value. False to abandon update.
 145   */
 146  function bp_activity_admin_screen_options( $value, $option, $new_value ) {
 147      if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )
 148          return $value;
 149  
 150      // Per page.
 151      $new_value = (int) $new_value;
 152      if ( $new_value < 1 || $new_value > 999 )
 153          return $value;
 154  
 155      return $new_value;
 156  }
 157  
 158  /**
 159   * Hide the advanced edit meta boxes by default, so we don't clutter the screen.
 160   *
 161   * @since 1.6.0
 162   *
 163   * @param array     $hidden Array of items to hide.
 164   * @param WP_Screen $screen Screen identifier.
 165   * @return array Hidden Meta Boxes.
 166   */
 167  function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
 168      if ( empty( $screen->id ) || 'toplevel_page_bp-activity' !== $screen->id && 'toplevel_page_bp-activity-network' !== $screen->id ) {
 169          return $hidden;
 170      }
 171  
 172      // Hide the primary link meta box by default.
 173      $hidden  = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
 174  
 175      /**
 176       * Filters default hidden metaboxes so plugins can alter list.
 177       *
 178       * @since 1.6.0
 179       *
 180       * @param array     $hidden Default metaboxes to hide.
 181       * @param WP_Screen $screen Screen identifier.
 182       */
 183      return apply_filters( 'bp_hide_meta_boxes', array_unique( $hidden ), $screen );
 184  }
 185  add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxes', 10, 2 );
 186  
 187  /**
 188   * Set up the Activity admin page.
 189   *
 190   * Does the following:
 191   *   - Register contextual help and screen options for this admin page.
 192   *   - Enqueues scripts and styles.
 193   *   - Catches POST and GET requests related to Activity.
 194   *
 195   * @since 1.6.0
 196   *
 197   * @global object                 $bp                     BuddyPress global settings.
 198   * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
 199   */
 200  function bp_activity_admin_load() {
 201      global $bp_activity_list_table;
 202  
 203      $bp       = buddypress();
 204      $doaction = bp_admin_list_table_current_bulk_action();
 205      $min      = bp_core_get_minified_asset_suffix();
 206  
 207      /**
 208       * Fires at top of Activity admin page.
 209       *
 210       * @since 1.6.0
 211       *
 212       * @param string $doaction Current $_GET action being performed in admin screen.
 213       */
 214      do_action( 'bp_activity_admin_load', $doaction );
 215  
 216      // Edit screen.
 217      if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) {
 218          // Columns screen option.
 219          add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
 220  
 221          get_current_screen()->add_help_tab( array(
 222              'id'      => 'bp-activity-edit-overview',
 223              'title'   => __( 'Overview', 'buddypress' ),
 224              'content' =>
 225                  '<p>' . __( 'You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error.', 'buddypress' ) . '</p>' .
 226                  '<p>' . __( 'The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen.', 'buddypress' ) . '</p>' .
 227                  '<p>' . __( 'You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity.', 'buddypress' ) . '</p>'
 228          ) );
 229  
 230          get_current_screen()->add_help_tab( array(
 231              'id'      => 'bp-activity-edit-advanced',
 232              'title'   => __( 'Item, Link, Type', 'buddypress' ),
 233              'content' =>
 234                  '<p>' . __( '<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields.', 'buddypress' ) . '</p>' .
 235                  '<p>' . __( '<strong>Link</strong> - Used by some types of activity (blog posts and comments) to store a link back to the original content.', 'buddypress' ) . '</p>' .
 236                  '<p>' . __( '<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group.', 'buddypress' ) . '</p>' .
 237                  '<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
 238          ) );
 239  
 240          // Help panel - sidebar links.
 241          get_current_screen()->set_help_sidebar(
 242              '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
 243              '<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/activity-stream-management-panels/">Managing Activity</a>', 'buddypress' ) . '</p>' .
 244              '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 245          );
 246  
 247          // Register metaboxes for the edit screen.
 248          add_meta_box( 'submitdiv',           _x( 'Status', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_status', get_current_screen()->id, 'side', 'core' );
 249          add_meta_box( 'bp_activity_itemids', _x( 'Primary Item/Secondary Item', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_itemids', get_current_screen()->id, 'normal', 'core' );
 250          add_meta_box( 'bp_activity_link',    _x( 'Link', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_link', get_current_screen()->id, 'normal', 'core' );
 251          add_meta_box( 'bp_activity_type',    _x( 'Type', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_type', get_current_screen()->id, 'normal', 'core' );
 252          add_meta_box( 'bp_activity_userid',  _x( 'Author ID', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_userid', get_current_screen()->id, 'normal', 'core' );
 253  
 254          /**
 255           * Fires after the registration of all of the default activity meta boxes.
 256           *
 257           * @since 2.4.0
 258           */
 259          do_action( 'bp_activity_admin_meta_boxes' );
 260  
 261          // Enqueue JavaScript files.
 262          wp_enqueue_script( 'postbox' );
 263          wp_enqueue_script( 'dashboard' );
 264          wp_enqueue_script( 'comment' );
 265  
 266      // Index screen.
 267      } else {
 268          // Create the Activity screen list table.
 269          $bp_activity_list_table = new BP_Activity_List_Table();
 270  
 271          // The per_page screen option.
 272          add_screen_option( 'per_page', array( 'label' => _x( 'Activity', 'Activity items per page (screen options)', 'buddypress' )) );
 273  
 274          // Help panel - overview text.
 275          get_current_screen()->add_help_tab( array(
 276              'id'      => 'bp-activity-overview',
 277              'title'   => __( 'Overview', 'buddypress' ),
 278              'content' =>
 279                  '<p>' . __( 'You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>' .
 280                  '<p>' . __( 'There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>'
 281          ) );
 282  
 283          // Help panel - moderation text.
 284          get_current_screen()->add_help_tab( array(
 285              'id'        => 'bp-activity-moderating',
 286              'title'        => __( 'Moderating Activity', 'buddypress' ),
 287              'content'    =>
 288                  '<p>' . __( 'In the <strong>Activity</strong> column, above each activity it says &#8220;Submitted on,&#8221; followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity.', 'buddypress' ) . '</p>' .
 289                  '<p>' . __( "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.", 'buddypress' ) . '</p>'
 290          ) );
 291  
 292          // Help panel - sidebar links.
 293          get_current_screen()->set_help_sidebar(
 294              '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
 295              '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 296          );
 297  
 298          // Add accessible hidden heading and text for Activity screen pagination.
 299          get_current_screen()->set_screen_reader_content( array(
 300              /* translators: accessibility text */
 301              'heading_pagination' => __( 'Activity list navigation', 'buddypress' ),
 302          ) );
 303  
 304      }
 305  
 306      // Enqueue CSS and JavaScript.
 307      wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin{$min}.js",   array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true );
 308      wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array(
 309          'page' => get_current_screen()->id
 310      ) );
 311      wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin{$min}.css", array(),                               bp_get_version()       );
 312  
 313      wp_style_add_data( 'bp_activity_admin_css', 'rtl', 'replace' );
 314      if ( $min ) {
 315          wp_style_add_data( 'bp_activity_admin_css', 'suffix', $min );
 316      }
 317  
 318      /**
 319       * Fires after the activity js and style has been enqueued.
 320       *
 321       * @since 2.4.0
 322       */
 323      do_action( 'bp_activity_admin_enqueue_scripts' );
 324  
 325      // Handle spam/un-spam/delete of activities.
 326      if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
 327  
 328          // Build redirection URL.
 329          $redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() );
 330          $redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to );
 331  
 332          // Get activity IDs.
 333          $activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] );
 334  
 335          /**
 336           * Filters list of IDs being spammed/un-spammed/deleted.
 337           *
 338           * @since 1.6.0
 339           *
 340           * @param array $activity_ids Activity IDs to spam/un-spam/delete.
 341           */
 342          $activity_ids = apply_filters( 'bp_activity_admin_action_activity_ids', $activity_ids );
 343  
 344          // Is this a bulk request?
 345          if ( 'bulk_' == substr( $doaction, 0, 5 ) && ! empty( $_REQUEST['aid'] ) ) {
 346              // Check this is a valid form submission.
 347              check_admin_referer( 'bulk-activities' );
 348  
 349              // Trim 'bulk_' off the action name to avoid duplicating a ton of code.
 350              $doaction = substr( $doaction, 5 );
 351  
 352          // This is a request to delete, spam, or un-spam, a single item.
 353          } elseif ( !empty( $_REQUEST['aid'] ) ) {
 354  
 355              // Check this is a valid form submission.
 356              check_admin_referer( 'spam-activity_' . $activity_ids[0] );
 357          }
 358  
 359          // Initialise counters for how many of each type of item we perform an action on.
 360          $deleted = $spammed = $unspammed = 0;
 361  
 362          // Store any errors that occurs when updating the database items.
 363          $errors = array();
 364  
 365          // "We'd like to shoot the monster, could you move, please?"
 366          foreach ( $activity_ids as $activity_id ) {
 367              // @todo: Check the permissions on each
 368              // if ( ! current_user_can( 'bp_edit_activity', $activity_id ) )
 369              // continue;
 370              // Get the activity from the database.
 371              $activity = new BP_Activity_Activity( $activity_id );
 372              if ( empty( $activity->component ) ) {
 373                  $errors[] = $activity_id;
 374                  continue;
 375              }
 376  
 377              switch ( $doaction ) {
 378                  case 'delete' :
 379                      if ( 'activity_comment' == $activity->type )
 380                          bp_activity_delete_comment( $activity->item_id, $activity->id );
 381                      else
 382                          bp_activity_delete( array( 'id' => $activity->id ) );
 383  
 384                      $deleted++;
 385                      break;
 386  
 387                  case 'ham' :
 388                      /**
 389                       * Remove moderation and blacklist checks in case we want to ham an activity
 390                       * which contains one of these listed keys.
 391                       */
 392                      remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2 );
 393                      remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2 );
 394  
 395                      bp_activity_mark_as_ham( $activity );
 396                      $result = $activity->save();
 397  
 398                      // Check for any error during activity save.
 399                      if ( ! $result )
 400                          $errors[] = $activity->id;
 401                      else
 402                          $unspammed++;
 403                      break;
 404  
 405                  case 'spam' :
 406                      bp_activity_mark_as_spam( $activity );
 407                      $result = $activity->save();
 408  
 409                      // Check for any error during activity save.
 410                      if ( ! $result )
 411                          $errors[] = $activity->id;
 412                      else
 413                          $spammed++;
 414                      break;
 415  
 416                  default:
 417                      break;
 418              }
 419  
 420              // Release memory.
 421              unset( $activity );
 422          }
 423  
 424          /**
 425           * Fires before redirect for plugins to do something with activity.
 426           *
 427           * Passes an activity array counts how many were spam, not spam, deleted, and IDs that were errors.
 428           *
 429           * @since 1.6.0
 430           *
 431           * @param array  $value        Array holding spam, not spam, deleted counts, error IDs.
 432           * @param string $redirect_to  URL to redirect to.
 433           * @param array  $activity_ids Original array of activity IDs.
 434           */
 435          do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids );
 436  
 437          // Add arguments to the redirect URL so that on page reload, we can easily display what we've just done.
 438          if ( $spammed )
 439              $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
 440  
 441          if ( $unspammed )
 442              $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
 443  
 444          if ( $deleted )
 445              $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
 446  
 447          // If an error occurred, pass back the activity ID that failed.
 448          if ( ! empty( $errors ) )
 449              $redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
 450  
 451          /**
 452           * Filters redirect URL after activity spamming/un-spamming/deletion occurs.
 453           *
 454           * @since 1.6.0
 455           *
 456           * @param string $redirect_to URL to redirect to.
 457           */
 458          wp_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) );
 459          exit;
 460  
 461  
 462      // Save the edit.
 463      } elseif ( $doaction && 'save' == $doaction ) {
 464          // Build redirection URL.
 465          $redirect_to = remove_query_arg( array( 'action', 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
 466  
 467          // Get activity ID.
 468          $activity_id = (int) $_REQUEST['aid'];
 469  
 470          // Check this is a valid form submission.
 471          check_admin_referer( 'edit-activity_' . $activity_id );
 472  
 473          // Get the activity from the database.
 474          $activity = new BP_Activity_Activity( $activity_id );
 475  
 476          // If the activity doesn't exist, just redirect back to the index.
 477          if ( empty( $activity->component ) ) {
 478              wp_redirect( $redirect_to );
 479              exit;
 480          }
 481  
 482          // Check the form for the updated properties.
 483          // Store any error that occurs when updating the database item.
 484          $error = 0;
 485  
 486          // Activity spam status.
 487          $prev_spam_status = $new_spam_status = false;
 488          if ( ! empty( $_POST['activity_status'] ) ) {
 489              $prev_spam_status = $activity->is_spam;
 490              $new_spam_status  = ( 'spam' == $_POST['activity_status'] ) ? true : false;
 491          }
 492  
 493          // Activity action.
 494          if ( isset( $_POST['bp-activities-action'] ) )
 495              $activity->action = $_POST['bp-activities-action'];
 496  
 497          // Activity content.
 498          if ( isset( $_POST['bp-activities-content'] ) )
 499              $activity->content = $_POST['bp-activities-content'];
 500  
 501          // Activity primary link.
 502          if ( ! empty( $_POST['bp-activities-link'] ) )
 503              $activity->primary_link = $_POST['bp-activities-link'];
 504  
 505          // Activity user ID.
 506          if ( ! empty( $_POST['bp-activities-userid'] ) )
 507              $activity->user_id = (int) $_POST['bp-activities-userid'];
 508  
 509          // Activity item primary ID.
 510          if ( isset( $_POST['bp-activities-primaryid'] ) )
 511              $activity->item_id = (int) $_POST['bp-activities-primaryid'];
 512  
 513          // Activity item secondary ID.
 514          if ( isset( $_POST['bp-activities-secondaryid'] ) )
 515              $activity->secondary_item_id = (int) $_POST['bp-activities-secondaryid'];
 516  
 517          // Activity type.
 518          if ( ! empty( $_POST['bp-activities-type'] ) ) {
 519              $actions = bp_activity_admin_get_activity_actions();
 520  
 521              // Check that the new type is a registered activity type.
 522              if ( in_array( $_POST['bp-activities-type'], $actions ) ) {
 523                  $activity->type = $_POST['bp-activities-type'];
 524              }
 525          }
 526  
 527          // Activity timestamp.
 528          if ( ! empty( $_POST['aa'] ) && ! empty( $_POST['mm'] ) && ! empty( $_POST['jj'] ) && ! empty( $_POST['hh'] ) && ! empty( $_POST['mn'] ) && ! empty( $_POST['ss'] ) ) {
 529              $aa = $_POST['aa'];
 530              $mm = $_POST['mm'];
 531              $jj = $_POST['jj'];
 532              $hh = $_POST['hh'];
 533              $mn = $_POST['mn'];
 534              $ss = $_POST['ss'];
 535              $aa = ( $aa <= 0 ) ? date( 'Y' ) : $aa;
 536              $mm = ( $mm <= 0 ) ? date( 'n' ) : $mm;
 537              $jj = ( $jj > 31 ) ? 31 : $jj;
 538              $jj = ( $jj <= 0 ) ? date( 'j' ) : $jj;
 539              $hh = ( $hh > 23 ) ? $hh -24 : $hh;
 540              $mn = ( $mn > 59 ) ? $mn -60 : $mn;
 541              $ss = ( $ss > 59 ) ? $ss -60 : $ss;
 542  
 543              // Reconstruct the date into a timestamp.
 544              $gmt_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
 545  
 546              $activity->date_recorded = $gmt_date;
 547          }
 548  
 549          // Has the spam status has changed?
 550          if ( $new_spam_status != $prev_spam_status ) {
 551              if ( $new_spam_status )
 552                  bp_activity_mark_as_spam( $activity );
 553              else
 554                  bp_activity_mark_as_ham( $activity );
 555          }
 556  
 557          // Save.
 558          $result = $activity->save();
 559  
 560          // Clear the activity stream first page cache, in case this activity's timestamp was changed.
 561          wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 562  
 563          // Check for any error during activity save.
 564          if ( false === $result )
 565              $error = $activity->id;
 566  
 567          /**
 568           * Fires before redirect so plugins can do something first on save action.
 569           *
 570           * @since 1.6.0
 571           *
 572           * @param array $value Array holding activity object and ID that holds error.
 573           */
 574          do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) );
 575  
 576          // If an error occurred, pass back the activity ID that failed.
 577          if ( $error )
 578              $redirect_to = add_query_arg( 'error', $error, $redirect_to );
 579          else
 580              $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to );
 581  
 582          /**
 583           * Filters URL to redirect to after saving.
 584           *
 585           * @since 1.6.0
 586           *
 587           * @param string $redirect_to URL to redirect to.
 588           */
 589          wp_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) );
 590          exit;
 591  
 592  
 593      // If a referrer and a nonce is supplied, but no action, redirect back.
 594      } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
 595          wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
 596          exit;
 597      }
 598  }
 599  
 600  /**
 601   * Output the Activity component admin screens.
 602   *
 603   * @since 1.6.0
 604   */
 605  function bp_activity_admin() {
 606      // Decide whether to load the index or edit screen.
 607      $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
 608  
 609      // Display the single activity edit screen.
 610      if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) )
 611          bp_activity_admin_edit();
 612  
 613      // Otherwise, display the Activity index screen.
 614      else
 615          bp_activity_admin_index();
 616  }
 617  
 618  /**
 619   * Display the single activity edit screen.
 620   *
 621   * @since 1.6.0
 622   */
 623  function bp_activity_admin_edit() {
 624  
 625      // @todo: Check if user is allowed to edit activity items
 626      // if ( ! current_user_can( 'bp_edit_activity' ) )
 627      if ( ! is_super_admin() )
 628          die( '-1' );
 629  
 630      // Get the activity from the database.
 631      $activity = bp_activity_get( array(
 632          'in'               => ! empty( $_REQUEST['aid'] ) ? (int) $_REQUEST['aid'] : 0,
 633          'max'              => 1,
 634          'show_hidden'      => true,
 635          'spam'             => 'all',
 636          'display_comments' => 0
 637      ) );
 638  
 639      if ( ! empty( $activity['activities'][0] ) ) {
 640          $activity = $activity['activities'][0];
 641  
 642          // Workaround to use WP's touch_time() without duplicating that function.
 643          $GLOBALS['comment'] = new stdClass;
 644          $GLOBALS['comment']->comment_date = $activity->date_recorded;
 645      } else {
 646          $activity = '';
 647      }
 648  
 649      // Construct URL for form.
 650      $form_url = remove_query_arg( array( 'action', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
 651      $form_url = add_query_arg( 'action', 'save', $form_url );
 652  
 653      /**
 654       * Fires before activity edit form is displays so plugins can modify the activity.
 655       *
 656       * @since 1.6.0
 657       *
 658       * @param array $value Array holding single activity object that was passed by reference.
 659       */
 660      do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
 661  
 662      <div class="wrap">
 663          <h1><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h1>
 664  
 665          <?php if ( ! empty( $activity ) ) : ?>
 666  
 667              <form action="<?php echo esc_url( $form_url ); ?>" id="bp-activities-edit-form" method="post">
 668                  <div id="poststuff">
 669  
 670                      <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
 671                          <div id="post-body-content">
 672                              <div id="postdiv">
 673                                  <div id="bp_activity_action" class="postbox">
 674                                      <h2><?php _e( 'Action', 'buddypress' ); ?></h2>
 675                                      <div class="inside">
 676                                          <label for="bp-activities-action" class="screen-reader-text"><?php
 677                                              /* translators: accessibility text */
 678                                              _e( 'Edit activity action', 'buddypress' );
 679                                          ?></label>
 680                                          <?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
 681                                      </div>
 682                                  </div>
 683  
 684                                  <div id="bp_activity_content" class="postbox">
 685                                      <h2><?php _e( 'Content', 'buddypress' ); ?></h2>
 686                                      <div class="inside">
 687                                          <label for="bp-activities-content" class="screen-reader-text"><?php
 688                                              /* translators: accessibility text */
 689                                              _e( 'Edit activity content', 'buddypress' );
 690                                          ?></label>
 691                                          <?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?>
 692                                      </div>
 693                                  </div>
 694                              </div>
 695                          </div><!-- #post-body-content -->
 696  
 697                          <div id="postbox-container-1" class="postbox-container">
 698                              <?php do_meta_boxes( get_current_screen()->id, 'side', $activity ); ?>
 699                          </div>
 700  
 701                          <div id="postbox-container-2" class="postbox-container">
 702                              <?php do_meta_boxes( get_current_screen()->id, 'normal', $activity ); ?>
 703                              <?php do_meta_boxes( get_current_screen()->id, 'advanced', $activity ); ?>
 704                          </div>
 705                      </div><!-- #post-body -->
 706  
 707                  </div><!-- #poststuff -->
 708                  <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
 709                  <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
 710                  <?php wp_nonce_field( 'edit-activity_' . $activity->id ); ?>
 711              </form>
 712  
 713          <?php else : ?>
 714  
 715              <p><?php
 716                  printf(
 717                      '%1$s <a href="%2$s">%3$s</a>',
 718                      __( 'No activity found with this ID.', 'buddypress' ),
 719                      esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ),
 720                      __( 'Go back and try again.', 'buddypress' )
 721                  );
 722              ?></p>
 723  
 724          <?php endif; ?>
 725  
 726      </div><!-- .wrap -->
 727  
 728  <?php
 729  }
 730  
 731  /**
 732   * Status metabox for the Activity admin edit screen.
 733   *
 734   * @since 1.6.0
 735   *
 736   * @param object $item Activity item.
 737   */
 738  function bp_activity_admin_edit_metabox_status( $item ) {
 739  ?>
 740  
 741      <div class="submitbox" id="submitcomment">
 742  
 743          <div id="minor-publishing">
 744              <div id="minor-publishing-actions">
 745                  <div id="preview-action">
 746                      <a class="button preview" href="<?php echo esc_attr( bp_activity_get_permalink( $item->id, $item ) ); ?>" target="_blank"><?php _e( 'View Activity', 'buddypress' ); ?></a>
 747                  </div>
 748  
 749                  <div class="clear"></div>
 750              </div><!-- #minor-publishing-actions -->
 751  
 752              <div id="misc-publishing-actions">
 753                  <div class="misc-pub-section" id="comment-status-radio">
 754                      <label class="approved" for="activity-status-approved"><input type="radio" name="activity_status" id="activity-status-approved" value="ham" <?php checked( $item->is_spam, 0 ); ?>><?php _e( 'Approved', 'buddypress' ); ?></label><br />
 755                      <label class="spam" for="activity-status-spam"><input type="radio" name="activity_status" id="activity-status-spam" value="spam" <?php checked( $item->is_spam, 1 ); ?>><?php _e( 'Spam', 'buddypress' ); ?></label>
 756                  </div>
 757  
 758                  <div class="misc-pub-section curtime misc-pub-section-last">
 759                      <?php
 760                      // Translators: Publish box date format, see http://php.net/date.
 761                      $datef = __( 'M j, Y @ G:i', 'buddypress' );
 762                      $date  = date_i18n( $datef, strtotime( $item->date_recorded ) );
 763                      ?>
 764                      <span id="timestamp"><?php printf( __( 'Submitted on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a>
 765  
 766                      <div id='timestampdiv' class='hide-if-js'>
 767                          <?php touch_time( 1, 0, 5 ); ?>
 768                      </div><!-- #timestampdiv -->
 769                  </div>
 770              </div> <!-- #misc-publishing-actions -->
 771  
 772              <div class="clear"></div>
 773          </div><!-- #minor-publishing -->
 774  
 775          <div id="major-publishing-actions">
 776              <div id="publishing-action">
 777                  <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false ); ?>
 778              </div>
 779              <div class="clear"></div>
 780          </div><!-- #major-publishing-actions -->
 781  
 782      </div><!-- #submitcomment -->
 783  
 784  <?php
 785  }
 786  
 787  /**
 788   * Primary link metabox for the Activity admin edit screen.
 789   *
 790   * @since 1.6.0
 791   *
 792   * @param object $item Activity item.
 793   */
 794  function bp_activity_admin_edit_metabox_link( $item ) {
 795  ?>
 796  
 797      <label class="screen-reader-text" for="bp-activities-link"><?php
 798          /* translators: accessibility text */
 799          _e( 'Link', 'buddypress' );
 800      ?></label>
 801      <input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" />
 802      <p id="bp-activities-link-description"><?php _e( 'Activity generated by posts and comments uses the link field for a permalink back to the content item.', 'buddypress' ); ?></p>
 803  
 804  <?php
 805  }
 806  
 807  /**
 808   * User ID metabox for the Activity admin edit screen.
 809   *
 810   * @since 1.6.0
 811   *
 812   * @param object $item Activity item.
 813   */
 814  function bp_activity_admin_edit_metabox_userid( $item ) {
 815  ?>
 816  
 817      <label class="screen-reader-text" for="bp-activities-userid"><?php
 818          /* translators: accessibility text */
 819          _e( 'Author ID', 'buddypress' );
 820      ?></label>
 821      <input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" />
 822  
 823  <?php
 824  }
 825  
 826  /**
 827   * Get flattened array of all registered activity actions.
 828   *
 829   * Format is [activity_type] => Pretty name for activity type.
 830   *
 831   * @since 2.0.0
 832   *
 833   * @return array $actions
 834   */
 835  function bp_activity_admin_get_activity_actions() {
 836      $actions  = array();
 837  
 838      // Walk through the registered actions, and build an array of actions/values.
 839      foreach ( bp_activity_get_actions() as $action ) {
 840          $action = array_values( (array) $action );
 841  
 842          for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
 843              /**
 844               * Don't take in account:
 845               * - a mis-named Friends activity type from before BP 1.6,
 846               * - The Group's component 'activity_update' one as the Activity component is using it.
 847               */
 848              if ( 'friends_register_activity_action' === $action[$i]['key'] || 'bp_groups_format_activity_action_group_activity_update' === $action[$i]['format_callback'] ) {
 849                  continue;
 850              }
 851  
 852              $actions[ $action[$i]['key'] ] = $action[$i]['value'];
 853          }
 854      }
 855  
 856      // Sort array by the human-readable value.
 857      natsort( $actions );
 858  
 859      return $actions;
 860  }
 861  
 862  /**
 863   * Activity type metabox for the Activity admin edit screen.
 864   *
 865   * @since 1.6.0
 866   *
 867   * @param object $item Activity item.
 868   */
 869  function bp_activity_admin_edit_metabox_type( $item ) {
 870      $bp = buddypress();
 871  
 872      $actions  = array();
 873      $selected = $item->type;
 874  
 875      // Walk through the registered actions, and build an array of actions/values.
 876      foreach ( bp_activity_get_actions() as $action ) {
 877          $action = array_values( (array) $action );
 878  
 879          for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
 880              /**
 881               * Don't take in account:
 882               * - a mis-named Friends activity type from before BP 1.6,
 883               * - The Group's component 'activity_update' one as the Activity component is using it.
 884               */
 885              if ( 'friends_register_activity_action' === $action[$i]['key'] || 'bp_groups_format_activity_action_group_activity_update' === $action[$i]['format_callback'] ) {
 886                  continue;
 887              }
 888  
 889              $actions[ $action[$i]['key'] ] = $action[$i]['value'];
 890          }
 891      }
 892  
 893      // Sort array by the human-readable value.
 894      natsort( $actions );
 895  
 896      /*
 897       * If the activity type is not registered properly (eg, a plugin has
 898       * not called bp_activity_set_action()), add the raw type to the end
 899       * of the list.
 900       */
 901      if ( ! isset( $actions[ $selected ] ) ) {
 902          _doing_it_wrong( __FUNCTION__, sprintf( __( 'This activity item has a type (%s) that is not registered using bp_activity_set_action(), so no label is available.', 'buddypress' ), $selected ), '2.0.0' );
 903          $actions[ $selected ] = $selected;
 904      }
 905  
 906      ?>
 907  
 908      <label for="bp-activities-type" class="screen-reader-text"><?php
 909          /* translators: accessibility text */
 910          esc_html_e( 'Select activity type', 'buddypress' );
 911      ?></label>
 912      <select name="bp-activities-type" id="bp-activities-type">
 913          <?php foreach ( $actions as $k => $v ) : ?>
 914              <option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k,  $selected ); ?>><?php echo esc_html( $v ); ?></option>
 915          <?php endforeach; ?>
 916      </select>
 917  
 918  <?php
 919  }
 920  
 921  /**
 922   * Primary item ID/Secondary item ID metabox for the Activity admin edit screen.
 923   *
 924   * @since 1.6.0
 925   *
 926   * @param object $item Activity item.
 927   */
 928  function bp_activity_admin_edit_metabox_itemids( $item ) {
 929  ?>
 930  
 931      <label for="bp-activities-primaryid"><?php _e( 'Primary Item ID', 'buddypress' ); ?></label>
 932      <input type="number" name="bp-activities-primaryid" id="bp-activities-primaryid" value="<?php echo esc_attr( $item->item_id ); ?>" min="0" />
 933      <br />
 934  
 935      <label for="bp-activities-secondaryid"><?php _e( 'Secondary Item ID', 'buddypress' ); ?></label>
 936      <input type="number" name="bp-activities-secondaryid" id="bp-activities-secondaryid" value="<?php echo esc_attr( $item->secondary_item_id ); ?>" min="0" />
 937  
 938      <p><?php _e( 'These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs.', 'buddypress' ); ?></p>
 939  
 940  <?php
 941  }
 942  
 943  /**
 944   * Display the Activity admin index screen, which contains a list of all the activities.
 945   *
 946   * @since 1.6.0
 947   *
 948   * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
 949   * @global string                 $plugin_page            The current plugin page.
 950   */
 951  function bp_activity_admin_index() {
 952      global $bp_activity_list_table, $plugin_page;
 953  
 954      $messages = array();
 955  
 956      // If the user has just made a change to an activity item, build status messages.
 957      if ( ! empty( $_REQUEST['deleted'] ) || ! empty( $_REQUEST['spammed'] ) || ! empty( $_REQUEST['unspammed'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) ) {
 958          $deleted   = ! empty( $_REQUEST['deleted']   ) ? (int) $_REQUEST['deleted']   : 0;
 959          $errors    = ! empty( $_REQUEST['error']     ) ? $_REQUEST['error']           : '';
 960          $spammed   = ! empty( $_REQUEST['spammed']   ) ? (int) $_REQUEST['spammed']   : 0;
 961          $unspammed = ! empty( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
 962          $updated   = ! empty( $_REQUEST['updated']   ) ? (int) $_REQUEST['updated']   : 0;
 963  
 964          $errors = array_map( 'absint', explode( ',', $errors ) );
 965  
 966          // Make sure we don't get any empty values in $errors.
 967          for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) {
 968              if ( 0 === $errors[$i] ) {
 969                  unset( $errors[$i] );
 970              }
 971          }
 972  
 973          // Reindex array.
 974          $errors = array_values( $errors );
 975  
 976          if ( $deleted > 0 )
 977              $messages[] = sprintf( _n( '%s activity item has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
 978  
 979          if ( ! empty( $errors ) ) {
 980              if ( 1 == count( $errors ) ) {
 981                  $messages[] = sprintf( __( 'An error occurred when trying to update activity ID #%s.', 'buddypress' ), number_format_i18n( $errors[0] ) );
 982  
 983              } else {
 984                  $error_msg  = __( 'Errors occurred when trying to update these activity items:', 'buddypress' );
 985                  $error_msg .= '<ul class="activity-errors">';
 986  
 987                  // Display each error as a list item.
 988                  foreach ( $errors as $error ) {
 989                      // Translators: This is a bulleted list of item IDs.
 990                      $error_msg .= '<li>' . sprintf( __( '#%s', 'buddypress' ), number_format_i18n( $error ) ) . '</li>';
 991                  }
 992  
 993                  $error_msg  .= '</ul>';
 994                  $messages[] = $error_msg;
 995              }
 996          }
 997  
 998          if ( $spammed > 0 )
 999              $messages[] = sprintf( _n( '%s activity item has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) );
1000  
1001          if ( $unspammed > 0 )
1002              $messages[] = sprintf( _n( '%s activity item has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
1003  
1004          if ( $updated > 0 )
1005              $messages[] = __( 'The activity item has been updated successfully.', 'buddypress' );
1006      }
1007  
1008      // Prepare the activity items for display.
1009      $bp_activity_list_table->prepare_items();
1010  
1011      /**
1012       * Fires before edit form is displayed so plugins can modify the activity messages.
1013       *
1014       * @since 1.6.0
1015       *
1016       * @param array $messages Array of messages to display at top of page.
1017       */
1018      do_action( 'bp_activity_admin_index', $messages ); ?>
1019  
1020      <div class="wrap">
1021          <h1>
1022              <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
1023                  <?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
1024              <?php else : ?>
1025                  <?php _ex( 'Activity', 'Admin SWA page', 'buddypress' ); ?>
1026              <?php endif; ?>
1027  
1028              <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
1029                  <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
1030              <?php endif; ?>
1031          </h1>
1032  
1033          <?php // If the user has just made a change to an activity item, display the status messages. ?>
1034          <?php if ( !empty( $messages ) ) : ?>
1035              <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
1036          <?php endif; ?>
1037  
1038          <?php // Display each activity on its own row. ?>
1039          <?php $bp_activity_list_table->views(); ?>
1040  
1041          <form id="bp-activities-form" action="" method="get">
1042              <?php $bp_activity_list_table->search_box( __( 'Search all Activity', 'buddypress' ), 'bp-activity' ); ?>
1043              <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
1044              <?php $bp_activity_list_table->display(); ?>
1045          </form>
1046  
1047          <?php // This markup is used for the reply form. ?>
1048          <table style="display: none;">
1049              <tr id="bp-activities-container" style="display: none;">
1050                  <td colspan="4">
1051                      <form method="get" action="">
1052  
1053                          <h3 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h3>
1054                          <label for="bp-activities" class="screen-reader-text"><?php
1055                              /* translators: accessibility text */
1056                              _e( 'Reply', 'buddypress' );
1057                          ?></label>
1058                          <?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?>
1059  
1060                          <p id="bp-replysubmit" class="submit">
1061                              <a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a>
1062                              <a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a>
1063  
1064                              <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
1065                              <span class="error" style="display:none;"></span>
1066                              <br class="clear" />
1067                          </p>
1068  
1069                          <?php wp_nonce_field( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply', false ); ?>
1070  
1071                      </form>
1072                  </td>
1073              </tr>
1074          </table>
1075      </div>
1076  
1077  <?php
1078  }


Generated: Tue Jul 16 01:01:43 2019 Cross-referenced by PHPXref 0.7.1