[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-nouveau/buddypress/groups/single/admin/ -> group-avatar.php (source)

   1  <?php
   2  /**
   3   * BP Nouveau Group's avatar template.
   4   *
   5   * @since 3.0.0
   6   * @version 3.1.0
   7   */
   8  ?>
   9  
  10  <?php if ( bp_is_group_create() ) : ?>
  11  
  12      <h3 class="bp-screen-title creation-step-name">
  13          <?php esc_html_e( 'Upload Group profile photo', 'buddypress' ); ?>
  14      </h3>
  15  
  16  <?php else : ?>
  17  
  18      <h2 class="bp-screen-title">
  19          <?php esc_html_e( 'Change Group profile photo', 'buddypress' ); ?>
  20      </h2>
  21  
  22  <?php endif; ?>
  23  
  24  <?php if ( ! bp_is_group_create() ) : ?>
  25      <?php if ( ! bp_get_group_has_avatar() ) : ?>
  26          <p class="bp-help-text"><?php esc_html_e( 'Add an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.', 'buddypress' ); ?></p>
  27      <?php else : ?>
  28          <p class="bp-help-text"><?php esc_html_e( 'Edit or update your avatar image for this group.', 'buddypress' ); ?></p>
  29      <?php endif; ?>
  30  <?php endif; ?>
  31  
  32  
  33  <?php if ( 'upload-image' === bp_get_avatar_admin_step() ) : ?>
  34      <?php if ( bp_is_group_create() ) : ?>
  35  
  36  
  37          <div class="left-menu">
  38  
  39              <?php bp_new_group_avatar(); ?>
  40  
  41          </div><!-- .left-menu -->
  42  
  43          <div class="main-column">
  44      <?php endif; ?>
  45  
  46              <p class="bp-help-text"><?php esc_html_e( 'Upload an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.', 'buddypress' ); ?></p>
  47  
  48              <p>
  49                  <label for="file" class="bp-screen-reader-text"><?php esc_html_e( 'Select an image', 'buddypress' ); ?></label>
  50                  <input type="file" name="file" id="file" />
  51                  <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" />
  52                  <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
  53              </p>
  54  
  55      <?php if ( bp_is_group_create() ) : ?>
  56              <p class="bp-help-text"><?php esc_html_e( 'To skip the group profile photo upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
  57          </div><!-- .main-column -->
  58  
  59      <?php elseif ( bp_get_group_has_avatar() ) : ?>
  60  
  61          <p><?php esc_html_e( "If you'd like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.", 'buddypress' ); ?></p>
  62  
  63          <?php
  64          bp_button(
  65              array(
  66                  'id'         => 'delete_group_avatar',
  67                  'component'  => 'groups',
  68                  'wrapper_id' => 'delete-group-avatar-button',
  69                  'link_class' => 'edit',
  70                  'link_href'  => bp_get_group_avatar_delete_link(),
  71                  'link_title' => __( 'Delete Group Profile Photo', 'buddypress' ),
  72                  'link_text'  => __( 'Delete Group Profile Photo', 'buddypress' ),
  73              )
  74          );
  75          ?>
  76  
  77      <?php
  78      endif;
  79  
  80      /**
  81       * Load the Avatar UI templates
  82       *
  83       * @since 2.3.0
  84       */
  85      bp_avatar_get_templates();
  86  
  87      if ( ! bp_is_group_create() ) {
  88          wp_nonce_field( 'bp_avatar_upload' );
  89      }
  90      ?>
  91  
  92  <?php
  93  endif;
  94  
  95  if ( 'crop-image' === bp_get_avatar_admin_step() ) :
  96  ?>
  97  
  98      <h2><?php esc_html_e( 'Crop Group Profile Photo', 'buddypress' ); ?></h2>
  99  
 100      <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" />
 101  
 102      <div id="avatar-crop-pane">
 103          <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" />
 104      </div>
 105  
 106      <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" />
 107  
 108      <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
 109      <input type="hidden" id="x" name="x" />
 110      <input type="hidden" id="y" name="y" />
 111      <input type="hidden" id="w" name="w" />
 112      <input type="hidden" id="h" name="h" />
 113  
 114      <?php
 115      if ( ! bp_is_group_create() ) {
 116          wp_nonce_field( 'bp_avatar_cropstore' );
 117      }
 118      ?>
 119  
 120  <?php
 121  endif;


Generated: Thu Dec 5 01:00:58 2024 Cross-referenced by PHPXref 0.7.1