Skip to:
Content

BuddyPress.org


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/single/admin.php

    r10969 r11128  
    88
    99?>
    10 <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     10<div class="item-list-tabs no-ajax" id="subnav" aria-label="<?php esc_attr_e( 'Group secondary navigation', 'buddypress' ); ?>" role="navigation">
    1111    <ul>
    1212        <?php bp_group_admin_tabs(); ?>
     
    1414</div><!-- .item-list-tabs -->
    1515
     16<?php
     17/**
     18 * Fires before the group admin form and content.
     19 *
     20 * @since 2.7.0
     21 */
     22do_action( 'bp_before_group_admin_form' ); ?>
     23
    1624<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data">
    1725
    18 <?php
     26    <?php
     27    /**
     28     * Fires inside the group admin form and before the content.
     29     *
     30     * @since 1.1.0
     31     */
     32    do_action( 'bp_before_group_admin_content' ); ?>
    1933
    20 /**
    21  * Fires inside the group admin form and before the content.
    22  *
    23  * @since 1.1.0
    24  */
    25 do_action( 'bp_before_group_admin_content' ); ?>
     34    <?php /* Fetch the template for the current admin screen being viewed */ ?>
    2635
    27 <?php /* Edit Group Details */ ?>
    28 <?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?>
     36    <?php if ( bp_is_group_admin_screen( bp_action_variable() ) ) : ?>
     37
     38        <?php bp_get_template_part( 'groups/single/admin/' . bp_action_variable() ); ?>
     39
     40    <?php endif; ?>
    2941
    3042    <?php
    3143
    3244    /**
    33      * Fires before the display of group admin details.
     45     * Fires inside the group admin template.
     46     *
     47     * Allows plugins to add custom group edit screens.
    3448     *
    3549     * @since 1.1.0
    3650     */
    37     do_action( 'bp_before_group_details_admin' ); ?>
    38 
    39     <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
    40     <input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" />
    41 
    42     <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
    43     <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea>
     51    do_action( 'groups_custom_edit_steps' ); ?>
    4452
    4553    <?php
    4654
    4755    /**
    48      * Fires after the group description admin details.
    49      *
    50      * @since 1.0.0
    51      */
    52     do_action( 'groups_custom_group_fields_editable' ); ?>
    53 
    54     <p>
    55         <label for="group-notify-members">
    56             <input type="checkbox" name="group-notify-members" id="group-notify-members" value="1" /> <?php _e( 'Notify group members of these changes via email', 'buddypress' ); ?>
    57         </label>
    58     </p>
    59 
    60     <?php
    61 
    62     /**
    63      * Fires after the display of group admin details.
     56     * Fires inside the group admin form and after the content.
    6457     *
    6558     * @since 1.1.0
    6659     */
    67     do_action( 'bp_after_group_details_admin' ); ?>
     60    do_action( 'bp_after_group_admin_content' ); ?>
    6861
    69     <p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
    70     <?php wp_nonce_field( 'groups_edit_group_details' ); ?>
    71 
    72 <?php endif; ?>
    73 
    74 <?php /* Manage Group Settings */ ?>
    75 <?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?>
    76 
    77     <?php
    78 
    79     /**
    80      * Fires before the group settings admin display.
    81      *
    82      * @since 1.1.0
    83      */
    84     do_action( 'bp_before_group_settings_admin' ); ?>
    85 
    86     <?php if ( bp_is_active( 'forums' ) ) : ?>
    87 
    88         <?php if ( bp_forums_is_installed_correctly() ) : ?>
    89 
    90             <div class="checkbox">
    91                 <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label>
    92             </div>
    93 
    94             <hr />
    95 
    96         <?php endif; ?>
    97 
    98     <?php endif; ?>
    99 
    100     <fieldset class="group-create-privacy">
    101 
    102         <legend><?php _e( 'Privacy Options', 'buddypress' ); ?></legend>
    103 
    104         <div class="radio">
    105 
    106             <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>
    107 
    108             <ul id="public-group-description">
    109                 <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
    110                 <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
    111                 <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
    112             </ul>
    113 
    114             <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>
    115 
    116             <ul id="private-group-description">
    117                 <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
    118                 <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
    119                 <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
    120             </ul>
    121 
    122             <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>
    123 
    124             <ul id="hidden-group-description">
    125                 <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
    126                 <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
    127                 <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
    128             </ul>
    129 
    130         </div>
    131 
    132     </fieldset>
    133 
    134     <fieldset class="group-create-invitations">
    135 
    136         <legend><?php _e( 'Group Invitations', 'buddypress' ); ?></legend>
    137 
    138         <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
    139 
    140         <div class="radio">
    141 
    142             <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>
    143 
    144             <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>
    145 
    146             <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>
    147 
    148         </div>
    149 
    150     </fieldset>
    151 
    152     <?php
    153 
    154     /**
    155      * Fires after the group settings admin display.
    156      *
    157      * @since 1.1.0
    158      */
    159     do_action( 'bp_after_group_settings_admin' ); ?>
    160 
    161     <p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
    162     <?php wp_nonce_field( 'groups_edit_group_settings' ); ?>
    163 
    164 <?php endif; ?>
    165 
    166 <?php /* Group Avatar Settings */ ?>
    167 <?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?>
    168 
    169     <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
    170 
    171             <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>
    172 
    173             <p>
    174                 <label for="file" class="bp-screen-reader-text"><?php
    175                     /* translators: accessibility text */
    176                     _e( 'Select an image', 'buddypress' );
    177                 ?></label>
    178                 <input type="file" name="file" id="file" />
    179                 <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" />
    180                 <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    181             </p>
    182 
    183             <?php if ( bp_get_group_has_avatar() ) : ?>
    184 
    185                 <p><?php _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>
    186 
    187                 <?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_text' => __( 'Delete Group Profile Photo', 'buddypress' ) ) ); ?>
    188 
    189             <?php endif; ?>
    190 
    191             <?php
    192             /**
    193              * Load the Avatar UI templates
    194              *
    195              * @since  2.3.0
    196              */
    197             bp_avatar_get_templates(); ?>
    198 
    199             <?php wp_nonce_field( 'bp_avatar_upload' ); ?>
    200 
    201     <?php endif; ?>
    202 
    203     <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
    204 
    205         <h4><?php _e( 'Crop Profile Photo', 'buddypress' ); ?></h4>
    206 
    207         <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" />
    208 
    209         <div id="avatar-crop-pane">
    210             <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" />
    211         </div>
    212 
    213         <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" />
    214 
    215         <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
    216         <input type="hidden" id="x" name="x" />
    217         <input type="hidden" id="y" name="y" />
    218         <input type="hidden" id="w" name="w" />
    219         <input type="hidden" id="h" name="h" />
    220 
    221         <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?>
    222 
    223     <?php endif; ?>
    224 
    225 <?php endif; ?>
    226 
    227 <?php /* Group Cover image Settings */ ?>
    228 <?php if ( bp_is_group_admin_screen( 'group-cover-image' ) ) : ?>
    229 
    230     <h4><?php _e( 'Change Cover Image', 'buddypress' ); ?></h4>
    231 
    232     <?php
    233 
    234     /**
    235      * Fires before the display of profile cover image upload content.
    236      *
    237      * @since 2.4.0
    238      */
    239     do_action( 'bp_before_group_settings_cover_image' ); ?>
    240 
    241     <p><?php _e( 'The Cover Image will be used to customize the header of your group.', 'buddypress' ); ?></p>
    242 
    243     <?php bp_attachments_get_template_part( 'cover-images/index' ); ?>
    244 
    245     <?php
    246 
    247     /**
    248      * Fires after the display of group cover image upload content.
    249      *
    250      * @since 2.4.0
    251      */
    252     do_action( 'bp_after_group_settings_cover_image' ); ?>
    253 
    254 <?php endif; ?>
    255 
    256 <?php /* Manage Group Members */ ?>
    257 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
    258 
    259     <?php
    260 
    261     /**
    262      * Fires before the group manage members admin display.
    263      *
    264      * @since 1.1.0
    265      */
    266     do_action( 'bp_before_group_manage_members_admin' ); ?>
    267 
    268     <div class="bp-widget">
    269         <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4>
    270 
    271         <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?>
    272 
    273         <ul id="admins-list" class="item-list single-line">
    274 
    275             <?php while ( bp_members() ) : bp_the_member(); ?>
    276             <li>
    277                 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>
    278                 <h5>
    279                     <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
    280                     <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?>
    281                     <span class="small">
    282                         <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a>
    283                     </span>
    284                     <?php endif; ?>
    285                 </h5>
    286             </li>
    287             <?php endwhile; ?>
    288 
    289         </ul>
    290 
    291         <?php endif; ?>
    292 
    293     </div>
    294 
    295     <?php if ( bp_group_has_moderators() ) : ?>
    296         <div class="bp-widget">
    297             <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4>
    298 
    299             <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?>
    300                 <ul id="mods-list" class="item-list single-line">
    301 
    302                     <?php while ( bp_members() ) : bp_the_member(); ?>
    303                     <li>
    304                         <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>
    305                         <h5>
    306                             <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
    307                             <span class="small">
    308                                 <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
    309                                 <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a>
    310                             </span>
    311                         </h5>
    312                     </li>
    313                     <?php endwhile; ?>
    314 
    315                 </ul>
    316 
    317             <?php endif; ?>
    318         </div>
    319     <?php endif ?>
    320 
    321 
    322     <div class="bp-widget">
    323         <h4><?php _e( "Members", 'buddypress' ); ?></h4>
    324 
    325         <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=0' ) ) : ?>
    326 
    327             <?php if ( bp_group_member_needs_pagination() ) : ?>
    328 
    329                 <div class="pagination no-ajax">
    330 
    331                     <div id="member-count" class="pag-count">
    332                         <?php bp_group_member_pagination_count(); ?>
    333                     </div>
    334 
    335                     <div id="member-admin-pagination" class="pagination-links">
    336                         <?php bp_group_member_admin_pagination(); ?>
    337                     </div>
    338 
    339                 </div>
    340 
    341             <?php endif; ?>
    342 
    343             <ul id="members-list" class="item-list single-line">
    344                 <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
    345 
    346                     <li class="<?php bp_group_member_css_class(); ?>">
    347                         <?php bp_group_member_avatar_mini(); ?>
    348 
    349                         <h5>
    350                             <?php bp_group_member_link(); ?>
    351 
    352                             <?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress' ); ?>
    353 
    354                             <span class="small">
    355 
    356                             <?php if ( bp_get_group_member_is_banned() ) : ?>
    357 
    358                                 <a href="<?php bp_group_member_unban_link(); ?>" class="button confirm member-unban" title="<?php esc_attr_e( 'Unban this member', 'buddypress' ); ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a>
    359 
    360                             <?php else : ?>
    361 
    362                                 <a href="<?php bp_group_member_ban_link(); ?>" class="button confirm member-ban"><?php _e( 'Kick &amp; Ban', 'buddypress' ); ?></a>
    363                                 <a href="<?php bp_group_member_promote_mod_link(); ?>" class="button confirm member-promote-to-mod"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a>
    364                                 <a href="<?php bp_group_member_promote_admin_link(); ?>" class="button confirm member-promote-to-admin"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a>
    365 
    366                             <?php endif; ?>
    367 
    368                                 <a href="<?php bp_group_member_remove_link(); ?>" class="button confirm"><?php _e( 'Remove from group', 'buddypress' ); ?></a>
    369 
    370                                 <?php
    371 
    372                                 /**
    373                                  * Fires inside the display of a member admin item in group management area.
    374                                  *
    375                                  * @since 1.1.0
    376                                  */
    377                                 do_action( 'bp_group_manage_members_admin_item' ); ?>
    378 
    379                             </span>
    380                         </h5>
    381                     </li>
    382 
    383                 <?php endwhile; ?>
    384             </ul>
    385 
    386             <?php if ( bp_group_member_needs_pagination() ) : ?>
    387 
    388                 <div class="pagination no-ajax">
    389 
    390                     <div id="member-count" class="pag-count">
    391                         <?php bp_group_member_pagination_count(); ?>
    392                     </div>
    393 
    394                     <div id="member-admin-pagination" class="pagination-links">
    395                         <?php bp_group_member_admin_pagination(); ?>
    396                     </div>
    397 
    398                 </div>
    399 
    400             <?php endif; ?>
    401 
    402         <?php else: ?>
    403 
    404             <div id="message" class="info">
    405                 <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p>
    406             </div>
    407 
    408         <?php endif; ?>
    409 
    410     </div>
    411 
    412     <?php
    413 
    414     /**
    415      * Fires after the group manage members admin display.
    416      *
    417      * @since 1.1.0
    418      */
    419     do_action( 'bp_after_group_manage_members_admin' ); ?>
    420 
    421 <?php endif; ?>
    422 
    423 <?php /* Manage Membership Requests */ ?>
    424 <?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?>
    425 
    426     <?php
    427 
    428     /**
    429      * Fires before the display of group membership requests admin.
    430      *
    431      * @since 1.1.0
    432      */
    433     do_action( 'bp_before_group_membership_requests_admin' ); ?>
    434 
    435         <div class="requests">
    436 
    437             <?php bp_get_template_part( 'groups/single/requests-loop' ); ?>
    438 
    439         </div>
    440 
    441     <?php
    442 
    443     /**
    444      * Fires after the display of group membership requests admin.
    445      *
    446      * @since 1.1.0
    447      */
    448     do_action( 'bp_after_group_membership_requests_admin' ); ?>
    449 
    450 <?php endif; ?>
     62</form><!-- #group-settings-form -->
    45163
    45264<?php
    453 
    45465/**
    455  * Fires inside the group admin template.
     66 * Fires after the group admin form and content.
    45667 *
    457  * Allows plugins to add custom group edit screens.
    458  *
    459  * @since 1.1.0
     68 * @since 2.7.0
    46069 */
    461 do_action( 'groups_custom_edit_steps' ); ?>
    462 
    463 <?php /* Delete Group Option */ ?>
    464 <?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?>
    465 
    466     <?php
    467 
    468     /**
    469      * Fires before the display of group delete admin.
    470      *
    471      * @since 1.1.0
    472      */
    473     do_action( 'bp_before_group_delete_admin' ); ?>
    474 
    475     <div id="message" class="info">
    476         <p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p>
    477     </div>
    478 
    479     <label for="delete-group-understand"><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?></label>
    480 
    481     <?php
    482 
    483     /**
    484      * Fires after the display of group delete admin.
    485      *
    486      * @since 1.1.0
    487      */
    488     do_action( 'bp_after_group_delete_admin' ); ?>
    489 
    490     <div class="submit">
    491         <input type="submit" disabled="disabled" value="<?php esc_attr_e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" />
    492     </div>
    493 
    494     <?php wp_nonce_field( 'groups_delete_group' ); ?>
    495 
    496 <?php endif; ?>
    497 
    498 <?php /* This is important, don't forget it */ ?>
    499     <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" />
    500 
    501 <?php
    502 
    503 /**
    504  * Fires inside the group admin form and after the content.
    505  *
    506  * @since 1.1.0
    507  */
    508 do_action( 'bp_after_group_admin_content' ); ?>
    509 
    510 </form><!-- #group-settings-form -->
     70do_action( 'bp_after_group_admin_form' ); ?>
Note: See TracChangeset for help on using the changeset viewer.