[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/groups/ -> create.php (source)

   1  <?php
   2  /**
   3   * BuddyPress - Groups Create
   4   *
   5   * @package BuddyPress
   6   * @subpackage bp-legacy
   7   * @version 3.0.0
   8   */
   9  
  10  /**
  11   * Fires at the top of the groups creation template file.
  12   *
  13   * @since 1.7.0
  14   */
  15  do_action( 'bp_before_create_group_page' ); ?>
  16  
  17  <div id="buddypress">
  18  
  19      <?php
  20  
  21      /**
  22       * Fires before the display of group creation content.
  23       *
  24       * @since 1.6.0
  25       */
  26      do_action( 'bp_before_create_group_content_template' ); ?>
  27  
  28      <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
  29  
  30          <?php
  31  
  32          /**
  33           * Fires before the display of group creation.
  34           *
  35           * @since 1.2.0
  36           */
  37          do_action( 'bp_before_create_group' ); ?>
  38  
  39          <div class="item-list-tabs no-ajax" id="group-create-tabs">
  40              <ul>
  41  
  42                  <?php bp_group_creation_tabs(); ?>
  43  
  44              </ul>
  45          </div>
  46  
  47          <div id="template-notices" role="alert" aria-atomic="true">
  48              <?php
  49  
  50              /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
  51              do_action( 'template_notices' ); ?>
  52  
  53          </div>
  54  
  55          <div class="item-body" id="group-create-body">
  56  
  57              <?php /* Group creation step 1: Basic group details */ ?>
  58              <?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?>
  59  
  60                  <h2 class="bp-screen-reader-text"><?php
  61                      /* translators: accessibility text */
  62                      _e( 'Group Details', 'buddypress' );
  63                  ?></h2>
  64  
  65                  <?php
  66  
  67                  /**
  68                   * Fires before the display of the group details creation step.
  69                   *
  70                   * @since 1.1.0
  71                   */
  72                  do_action( 'bp_before_group_details_creation_step' ); ?>
  73  
  74                  <div>
  75                      <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
  76                      <input type="text" name="group-name" id="group-name" aria-required="true" value="<?php echo esc_attr( bp_get_new_group_name() ); ?>" />
  77                  </div>
  78  
  79                  <div>
  80                      <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
  81                      <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea>
  82                  </div>
  83  
  84                  <?php
  85  
  86                  /**
  87                   * Fires after the display of the group details creation step.
  88                   *
  89                   * @since 1.1.0
  90                   */
  91                  do_action( 'bp_after_group_details_creation_step' );
  92                  do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
  93  
  94                  wp_nonce_field( 'groups_create_save_group-details' ); ?>
  95  
  96              <?php endif; ?>
  97  
  98              <?php /* Group creation step 2: Group settings */ ?>
  99              <?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?>
 100  
 101                  <h2 class="bp-screen-reader-text"><?php
 102                      /* translators: accessibility text */
 103                      _e( 'Group Settings', 'buddypress' );
 104                  ?></h2>
 105  
 106                  <?php
 107  
 108                  /**
 109                   * Fires before the display of the group settings creation step.
 110                   *
 111                   * @since 1.1.0
 112                   */
 113                  do_action( 'bp_before_group_settings_creation_step' ); ?>
 114  
 115                  <fieldset class="group-create-privacy">
 116  
 117                      <legend><?php _e( 'Privacy Options', 'buddypress' ); ?></legend>
 118  
 119                      <div class="radio">
 120  
 121                          <label for="group-status-public"><input type="radio" name="group-status" id="group-status-public" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="public-group-description" /> <?php _e( 'This is a public group', 'buddypress' ); ?></label>
 122  
 123                          <ul id="public-group-description">
 124                              <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
 125                              <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
 126                              <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
 127                          </ul>
 128  
 129                          <label for="group-status-private"><input type="radio" name="group-status" id="group-status-private" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="private-group-description" /> <?php _e( 'This is a private group', 'buddypress' ); ?></label>
 130  
 131                          <ul id="private-group-description">
 132                              <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
 133                              <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
 134                              <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
 135                          </ul>
 136  
 137                          <label for="group-status-hidden"><input type="radio" name="group-status" id="group-status-hidden" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="hidden-group-description" /> <?php _e('This is a hidden group', 'buddypress' ); ?></label>
 138  
 139                          <ul id="hidden-group-description">
 140                              <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
 141                              <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
 142                              <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
 143                          </ul>
 144  
 145                      </div>
 146  
 147                  </fieldset>
 148  
 149                  <?php // Group type selection ?>
 150                  <?php if ( $group_types = bp_groups_get_group_types( array( 'show_in_create_screen' => true ), 'objects' ) ): ?>
 151  
 152                      <fieldset class="group-create-types">
 153                          <legend><?php _e( 'Group Types', 'buddypress' ); ?></legend>
 154  
 155                          <p><?php _e( 'Select the types this group should be a part of.', 'buddypress' ); ?></p>
 156  
 157                          <?php foreach ( $group_types as $type ) : ?>
 158                              <div class="checkbox">
 159                                  <label for="<?php printf( 'group-type-%s', $type->name ); ?>"><input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php echo esc_attr( $type->name ); ?>" <?php checked( true, ! empty( $type->create_screen_checked ) ); ?> /> <?php echo esc_html( $type->labels['name'] ); ?>
 160                                      <?php
 161                                          if ( ! empty( $type->description ) ) {
 162                                              /* translators: Group type description shown when creating a group. */
 163                                              printf( __( '&ndash; %s', 'buddypress' ), '<span class="bp-group-type-desc">' . esc_html( $type->description ) . '</span>' );
 164                                          }
 165                                      ?>
 166                                  </label>
 167                              </div>
 168  
 169                          <?php endforeach; ?>
 170  
 171                      </fieldset>
 172  
 173                  <?php endif; ?>
 174  
 175                  <?php if ( bp_is_active( 'groups', 'invitations' ) ): ?>
 176  
 177                      <fieldset class="group-create-invitations">
 178  
 179                          <legend><?php _e( 'Group Invitations', 'buddypress' ); ?></legend>
 180  
 181                          <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
 182  
 183                          <div class="radio">
 184  
 185                              <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label>
 186  
 187                              <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label>
 188  
 189                              <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label>
 190  
 191                          </div>
 192  
 193                      </fieldset>
 194  
 195                  <?php endif; ?>
 196  
 197                  <?php
 198  
 199                  /**
 200                   * Fires after the display of the group settings creation step.
 201                   *
 202                   * @since 1.1.0
 203                   */
 204                  do_action( 'bp_after_group_settings_creation_step' ); ?>
 205  
 206                  <?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
 207  
 208              <?php endif; ?>
 209  
 210              <?php /* Group creation step 3: Avatar Uploads */ ?>
 211              <?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?>
 212  
 213                  <h2 class="bp-screen-reader-text"><?php
 214                      /* translators: accessibility text */
 215                      _e( 'Group Avatar', 'buddypress' );
 216                  ?></h2>
 217  
 218                  <?php
 219  
 220                  /**
 221                   * Fires before the display of the group avatar creation step.
 222                   *
 223                   * @since 1.1.0
 224                   */
 225                  do_action( 'bp_before_group_avatar_creation_step' ); ?>
 226  
 227                  <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
 228  
 229                      <div class="left-menu">
 230  
 231                          <?php bp_new_group_avatar(); ?>
 232  
 233                      </div><!-- .left-menu -->
 234  
 235                      <div class="main-column">
 236                          <p><?php _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>
 237  
 238                          <p>
 239                              <label for="file" class="bp-screen-reader-text"><?php
 240                                  /* translators: accessibility text */
 241                                  _e( 'Select an image', 'buddypress' );
 242                              ?></label>
 243                              <input type="file" name="file" id="file" />
 244                              <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" />
 245                              <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
 246                          </p>
 247  
 248                          <p><?php _e( 'To skip the group profile photo upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
 249                      </div><!-- .main-column -->
 250  
 251                      <?php
 252                      /**
 253                       * Load the Avatar UI templates
 254                       *
 255                       * @since 2.3.0
 256                       */
 257                      bp_avatar_get_templates(); ?>
 258  
 259                  <?php endif; ?>
 260  
 261                  <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
 262  
 263                      <h4><?php _e( 'Crop Group Profile Photo', 'buddypress' ); ?></h4>
 264  
 265                      <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" />
 266  
 267                      <div id="avatar-crop-pane">
 268                          <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" />
 269                      </div>
 270  
 271                      <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" />
 272  
 273                      <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
 274                      <input type="hidden" name="upload" id="upload" />
 275                      <input type="hidden" id="x" name="x" />
 276                      <input type="hidden" id="y" name="y" />
 277                      <input type="hidden" id="w" name="w" />
 278                      <input type="hidden" id="h" name="h" />
 279  
 280                  <?php endif; ?>
 281  
 282                  <?php
 283  
 284                  /**
 285                   * Fires after the display of the group avatar creation step.
 286                   *
 287                   * @since 1.1.0
 288                   */
 289                  do_action( 'bp_after_group_avatar_creation_step' ); ?>
 290  
 291                  <?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
 292  
 293              <?php endif; ?>
 294  
 295              <?php /* Group creation step 4: Cover image */ ?>
 296              <?php if ( bp_is_group_creation_step( 'group-cover-image' ) ) : ?>
 297  
 298                  <h2 class="bp-screen-reader-text"><?php
 299                      /* translators: accessibility text */
 300                      _e( 'Cover Image', 'buddypress' );
 301                  ?></h2>
 302  
 303                  <?php
 304  
 305                  /**
 306                   * Fires before the display of the group cover image creation step.
 307                   *
 308                   * @since 2.4.0
 309                   */
 310                  do_action( 'bp_before_group_cover_image_creation_step' ); ?>
 311  
 312                  <div id="header-cover-image"></div>
 313  
 314                  <p><?php _e( 'The Cover Image will be used to customize the header of your group.', 'buddypress' ); ?></p>
 315  
 316                  <?php bp_attachments_get_template_part( 'cover-images/index' ); ?>
 317  
 318                  <?php
 319  
 320                  /**
 321                   * Fires after the display of the group cover image creation step.
 322                   *
 323                   * @since 2.4.0
 324                   */
 325                  do_action( 'bp_after_group_cover_image_creation_step' ); ?>
 326  
 327                  <?php wp_nonce_field( 'groups_create_save_group-cover-image' ); ?>
 328  
 329              <?php endif; ?>
 330  
 331              <?php /* Group creation step 5: Invite friends to group */ ?>
 332              <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?>
 333  
 334                  <h2 class="bp-screen-reader-text"><?php
 335                      /* translators: accessibility text */
 336                      _e( 'Group Invites', 'buddypress' );
 337                  ?></h2>
 338  
 339                  <?php
 340  
 341                  /**
 342                   * Fires before the display of the group invites creation step.
 343                   *
 344                   * @since 1.1.0
 345                   */
 346                  do_action( 'bp_before_group_invites_creation_step' ); ?>
 347  
 348                  <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
 349  
 350                      <div class="left-menu">
 351  
 352                          <div id="invite-list">
 353                              <ul>
 354                                  <?php bp_new_group_invite_friend_list(); ?>
 355                              </ul>
 356  
 357                              <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
 358                          </div>
 359  
 360                      </div><!-- .left-menu -->
 361  
 362                      <div class="main-column">
 363  
 364                          <div id="message" class="info">
 365                              <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p>
 366                          </div>
 367  
 368                          <?php /* The ID 'friend-list' is important for AJAX support. */ ?>
 369                          <ul id="friend-list" class="item-list">
 370  
 371                          <?php if ( bp_group_has_invites() ) : ?>
 372  
 373                              <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
 374  
 375                                  <li id="<?php bp_group_invite_item_id(); ?>">
 376  
 377                                      <?php bp_group_invite_user_avatar(); ?>
 378  
 379                                      <h4><?php bp_group_invite_user_link(); ?></h4>
 380                                      <span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
 381  
 382                                      <div class="action">
 383                                          <a class="remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a>
 384                                      </div>
 385                                  </li>
 386  
 387                              <?php endwhile; ?>
 388  
 389                              <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
 390  
 391                          <?php endif; ?>
 392  
 393                          </ul>
 394  
 395                      </div><!-- .main-column -->
 396  
 397                  <?php else : ?>
 398  
 399                      <div id="message" class="info">
 400                          <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p>
 401                      </div>
 402  
 403                  <?php endif; ?>
 404  
 405                  <?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
 406  
 407                  <?php
 408  
 409                  /**
 410                   * Fires after the display of the group invites creation step.
 411                   *
 412                   * @since 1.1.0
 413                   */
 414                  do_action( 'bp_after_group_invites_creation_step' ); ?>
 415  
 416              <?php endif; ?>
 417  
 418              <?php
 419  
 420              /**
 421               * Fires inside the group admin template.
 422               *
 423               * Allows plugins to add custom group creation steps.
 424               *
 425               * @since 1.1.0
 426               */
 427              do_action( 'groups_custom_create_steps' ); ?>
 428  
 429              <?php
 430  
 431              /**
 432               * Fires before the display of the group creation step buttons.
 433               *
 434               * @since 1.1.0
 435               */
 436              do_action( 'bp_before_group_creation_step_buttons' ); ?>
 437  
 438              <?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
 439  
 440                  <div class="submit" id="previous-next">
 441  
 442                      <?php /* Previous Button */ ?>
 443                      <?php if ( !bp_is_first_group_creation_step() ) : ?>
 444  
 445                          <input type="button" value="<?php esc_attr_e( 'Back to Previous Step', 'buddypress' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" />
 446  
 447                      <?php endif; ?>
 448  
 449                      <?php /* Next Button */ ?>
 450                      <?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?>
 451  
 452                          <input type="submit" value="<?php esc_attr_e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" />
 453  
 454                      <?php endif;?>
 455  
 456                      <?php /* Create Button */ ?>
 457                      <?php if ( bp_is_first_group_creation_step() ) : ?>
 458  
 459                          <input type="submit" value="<?php esc_attr_e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" />
 460  
 461                      <?php endif; ?>
 462  
 463                      <?php /* Finish Button */ ?>
 464                      <?php if ( bp_is_last_group_creation_step() ) : ?>
 465  
 466                          <input type="submit" value="<?php esc_attr_e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" />
 467  
 468                      <?php endif; ?>
 469                  </div>
 470  
 471              <?php endif;?>
 472  
 473              <?php
 474  
 475              /**
 476               * Fires after the display of the group creation step buttons.
 477               *
 478               * @since 1.1.0
 479               */
 480              do_action( 'bp_after_group_creation_step_buttons' ); ?>
 481  
 482              <?php /* Don't leave out this hidden field */ ?>
 483              <input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
 484  
 485              <?php
 486  
 487              /**
 488               * Fires and displays the groups directory content.
 489               *
 490               * @since 1.1.0
 491               */
 492              do_action( 'bp_directory_groups_content' ); ?>
 493  
 494          </div><!-- .item-body -->
 495  
 496          <?php
 497  
 498          /**
 499           * Fires after the display of group creation.
 500           *
 501           * @since 1.2.0
 502           */
 503          do_action( 'bp_after_create_group' ); ?>
 504  
 505      </form>
 506  
 507      <?php
 508  
 509      /**
 510       * Fires after the display of group creation content.
 511       *
 512       * @since 1.6.0
 513       */
 514      do_action( 'bp_after_create_group_content_template' ); ?>
 515  
 516  </div>
 517  
 518  <?php
 519  
 520  /**
 521   * Fires at the bottom of the groups creation template file.
 522   *
 523   * @since 1.7.0
 524   */
 525  do_action( 'bp_after_create_group_page' );


Generated: Sun Nov 28 01:01:00 2021 Cross-referenced by PHPXref 0.7.1