[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/groups/single/ -> send-invites.php (source)

   1  <?php
   2  /**
   3   * BuddyPress - Groups Send Invites
   4   *
   5   * @package BuddyPress
   6   * @subpackage bp-legacy
   7   * @version 3.0.0
   8   */
   9  
  10  /**
  11   * Fires before the send invites content.
  12   *
  13   * @since 1.1.0
  14   */
  15  do_action( 'bp_before_group_send_invites_content' ); ?>
  16  
  17  <?php if ( ! bp_is_active( 'friends' ) ) : ?>
  18      <div id="message" class="info">
  19          <p class="notice"><?php esc_html_e( 'Group invitations can only be extended to friends.', 'buddypress' ); ?></p>
  20      </div>
  21  <?php
  22  /* Does the user have friends that could be invited to the group? */
  23  elseif ( bp_get_new_group_invite_friend_list() ) : ?>
  24  
  25      <h2 class="bp-screen-reader-text"><?php _e( 'Send invites', 'buddypress' ); ?></h2>
  26  
  27      <?php /* 'send-invite-form' is important for AJAX support */ ?>
  28      <form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form">
  29  
  30          <div class="invite" aria-live="polite" aria-atomic="false" aria-relevant="all">
  31              <?php bp_get_template_part( 'groups/single/invites-loop' ); ?>
  32          </div>
  33  
  34          <div class="submit">
  35              <input type="submit" name="submit" id="submit" value="<?php esc_attr_e( 'Send Invites', 'buddypress' ); ?>" />
  36          </div>
  37  
  38          <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
  39  
  40          <?php /* This is important, don't forget it */ ?>
  41          <input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id(); ?>" />
  42  
  43      </form><!-- #send-invite-form -->
  44  
  45  <?php
  46  /* No eligible friends? Maybe the user doesn't have any friends yet. */
  47  elseif ( 0 == bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
  48  
  49      <div id="message" class="info">
  50          <p class="notice"><?php _e( 'Group invitations can only be extended to friends.', 'buddypress' ); ?></p>
  51          <p class="message-body"><?php _e( "Once you've made some friendships, you'll be able to invite those members to this group.", 'buddypress' ); ?></p>
  52      </div>
  53  
  54  <?php
  55  /* The user does have friends, but none are eligible to be invited to this group. */
  56  else : ?>
  57  
  58      <div id="message" class="info">
  59          <p class="notice"><?php _e( 'All of your friends already belong to this group.', 'buddypress' ); ?></p>
  60      </div>
  61  
  62  <?php endif; ?>
  63  
  64  <?php
  65  
  66  /**
  67   * Fires after the send invites content.
  68   *
  69   * @since 1.2.0
  70   */
  71  do_action( 'bp_after_group_send_invites_content' );


Generated: Fri Apr 26 01:01:11 2024 Cross-referenced by PHPXref 0.7.1