Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/01/2009 09:35:03 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Group avatar upload adjustments. Fix empty avatar src by checking for uploaded avatar first, and show gravatar (or no_grav) if no upload exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-sn-parent/groups/single/admin.php

    r1905 r2069  
    99        </div>
    1010
    11         <div id="content"> 
     11        <div id="content">
    1212
    1313                <?php do_action( 'template_notices' ) // (error/success feedback) ?>
     
    4040                            <input type="radio" name="group-notify-members" value="0" checked="checked" /> <?php _e( 'No', 'buddypress' ); ?>&nbsp;
    4141                        </p>
    42                
     42
    4343                        <?php do_action( 'bp_after_group_details_admin' ); ?>
    4444
     
    5656
    5757                        <?php if ( function_exists('bp_wire_install') ) : ?>
    58                    
     58
    5959                            <div class="checkbox">
    6060                                <label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php bp_group_show_wire_setting() ?>/> <?php _e( 'Enable comment wire', 'buddypress' ) ?></label>
    6161                            </div>
    62                    
     62
    6363                        <?php endif; ?>
    6464
    6565                        <?php if ( function_exists('bp_forums_setup') ) : ?>
    66                    
     66
    6767                            <?php if ( bp_forums_is_installed_correctly() ) : ?>
    68                        
     68
    6969                                <div class="checkbox">
    7070                                    <label><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>
    7171                                </div>
    72                        
     72
    7373                            <?php endif; ?>
    74                    
    75                         <?php endif; ?>
    76    
     74
     75                        <?php endif; ?>
     76
    7777                        <h3><?php _e( 'Privacy Options', 'buddypress' ); ?></h3>
    7878
    7979                        <div class="radio">
    8080                            <label>
    81                                 <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting('public') ?> /> 
     81                                <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting('public') ?> />
    8282                                <strong><?php _e( 'This is a public group', 'buddypress' ) ?></strong>
    8383                                <ul>
     
    8787                                </ul>
    8888                            </label>
    89                
     89
    9090                            <label>
    9191                                <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting('private') ?> />
     
    9797                                </ul>
    9898                            </label>
    99                
     99
    100100                            <label>
    101101                                <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting('hidden') ?> />
     
    108108                            </label>
    109109                        </div>
    110                
     110
    111111                        <?php do_action( 'bp_after_group_settings_admin' ); ?>
    112                
     112
    113113                        <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?> &raquo;" id="save" name="save" /></p>
    114114                        <?php wp_nonce_field( 'groups_edit_group_settings' ) ?>
    115115
    116116                    <?php endif; ?>
    117            
     117
    118118                    <?php /* Group Avatar Settings */ ?>
    119119                    <?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?>
     
    121121                        <h2><?php _e( 'Group Avatar', 'buddypress' ); ?></h2>
    122122
    123                         <div class="left-menu">
    124                             <?php bp_group_avatar( 'type=full' ) ?>
    125                            
    126                             <?php if ( bp_get_group_has_avatar() ) : ?>
    127                                 <div class="generic-button" id="delete-group-avatar-button">
    128                                     <a class="edit" href="<?php bp_group_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
    129                                 </div>
    130                             <?php endif; ?>
    131                         </div>
    132                
    133                         <div class="main-column">
    134                
    135123                        <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
    136    
    137                             <p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress') ?></p>
    138        
    139                             <p>
    140                                 <input type="file" name="file" id="file" />
    141                                 <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
    142                                 <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
    143                             </p>       
    144 
    145                             <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
    146                
    147                         <?php endif; ?>
    148            
     124
     125                            <div class="left-menu">
     126                                <?php bp_group_avatar( 'type=full' ) ?>
     127
     128                                <?php if ( bp_get_group_has_avatar() ) : ?>
     129                                    <div class="generic-button" id="delete-group-avatar-button">
     130                                        <a class="edit" href="<?php bp_group_avatar_delete_link() ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ) ?>"><?php _e( 'Delete Avatar', 'buddypress' ) ?></a>
     131                                    </div>
     132                                <?php endif; ?>
     133                            </div>
     134
     135                            <div class="main-column">
     136
     137                                <p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress') ?></p>
     138
     139                                <p>
     140                                    <input type="file" name="file" id="file" />
     141                                    <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
     142                                    <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     143                                </p>
     144
     145                                <?php wp_nonce_field( 'bp_avatar_upload' ) ?>
     146
     147                            </div>
     148                        <?php endif; ?>
     149
    149150                        <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
    150            
     151
    151152                            <h3><?php _e( 'Crop Avatar', 'buddypress' ) ?></h3>
    152                
     153
    153154                            <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
    154                
     155
    155156                            <div id="avatar-crop-pane">
    156157                                <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
     
    158159
    159160                            <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
    160                
     161
    161162                            <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
    162163                            <input type="hidden" id="x" name="x" />
     
    166167
    167168                            <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
    168                
    169                         <?php endif; ?>
    170                
    171                         </div>
    172 
    173                     <?php endif; ?>
    174        
     169
     170                        <?php endif; ?>
     171
     172                    <?php endif; ?>
     173
    175174                    <?php /* Manage Group Members */ ?>
    176175                    <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
    177176
    178177                        <h2><?php _e( 'Manage Members', 'buddypress' ); ?></h2>
    179                            
     178
    180179                        <?php do_action( 'bp_before_group_manage_members_admin' ); ?>
    181                            
     180
    182181                        <div class="bp-widget">
    183182                            <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4>
    184183                            <?php bp_group_admin_memberlist( true ) ?>
    185184                        </div>
    186        
     185
    187186                        <?php if ( bp_group_has_moderators() ) : ?>
    188187
     
    193192
    194193                        <?php endif; ?>
    195        
     194
    196195                        <div class="bp-widget">
    197196                            <h4><?php _e("Members", "buddypress"); ?></h4>
    198            
     197
    199198                            <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?>
    200199
    201200                                <?php if ( bp_group_member_needs_pagination() ) : ?>
    202        
     201
    203202                                    <div class="pagination">
    204        
     203
    205204                                        <div id="member-count" class="pag-count">
    206205                                            <?php bp_group_member_pagination_count() ?>
     
    210209                                            <?php bp_group_member_admin_pagination() ?>
    211210                                        </div>
    212                                
     211
    213212                                    </div>
    214                                
     213
    215214                                <?php endif; ?>
    216            
     215
    217216                                <ul id="members-list" class="item-list single-line">
    218217                                    <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
    219                            
     218
    220219                                        <?php if ( bp_get_group_member_is_banned() ) : ?>
    221                                
     220
    222221                                            <li class="banned-user">
    223222                                                <?php bp_group_member_avatar_mini() ?>
    224223
    225224                                                <h5><?php bp_group_member_link() ?> <?php _e( '(banned)', 'buddypress') ?> <span class="small"> &mdash; <a href="<?php bp_group_member_unban_link() ?>" class="confirm" title="<?php _e( 'Kick and ban this member', 'buddypress' ) ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a> </h5>
    226                        
     225
    227226                                        <?php else : ?>
    228                            
     227
    229228                                            <li>
    230229                                                <?php bp_group_member_avatar_mini() ?>
     
    232231
    233232                                        <?php endif; ?>
    234                            
     233
    235234                                                <?php do_action( 'bp_group_manage_members_admin_item' ); ?>
    236235                                            </li>
    237                                
     236
    238237                                    <?php endwhile; ?>
    239238                                </ul>
    240                        
     239
    241240                            <?php else: ?>
    242241
     
    246245
    247246                            <?php endif; ?>
    248                    
     247
    249248                        </div>
    250                
     249
    251250                        <?php do_action( 'bp_after_group_manage_members_admin' ); ?>
    252            
     251
    253252                    <?php endif; ?>
    254253
     
    257256
    258257                        <h2><?php _e( 'Membership Requests', 'buddypress' ); ?></h2>
    259                
     258
    260259                        <?php do_action( 'bp_before_group_membership_requests_admin' ); ?>
    261                
     260
    262261                        <?php if ( bp_group_has_membership_requests() ) : ?>
    263                    
     262
    264263                            <ul id="request-list" class="item-list">
    265264                                <?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?>
    266                        
     265
    267266                                    <li>
    268267                                        <?php bp_group_request_user_avatar_thumb() ?>
    269268                                        <h4><?php bp_group_request_user_link() ?> <span class="comments"><?php bp_group_request_comment() ?></span></h4>
    270269                                        <span class="activity"><?php bp_group_request_time_since_requested() ?></span>
    271                                
     270
    272271                                        <?php do_action( 'bp_group_membership_requests_admin_item' ); ?>
    273                                
     272
    274273                                        <div class="action">
    275                    
     274
    276275                                            <div class="generic-button accept">
    277                                                 <a href="<?php bp_group_request_accept_link() ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> 
     276                                                <a href="<?php bp_group_request_accept_link() ?>"><?php _e( 'Accept', 'buddypress' ); ?></a>
    278277                                            </div>
    279                
    280                                          &nbsp; 
     278
     279                                         &nbsp;
    281280
    282281                                            <div class="generic-button reject">
    283                                                 <a href="<?php bp_group_request_reject_link() ?>"><?php _e( 'Reject', 'buddypress' ); ?></a> 
     282                                                <a href="<?php bp_group_request_reject_link() ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
    284283                                            </div>
    285                                    
     284
    286285                                            <?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
    287                    
     286
    288287                                        </div>
    289288                                    </li>
    290                        
     289
    291290                                <?php endwhile; ?>
    292291                            </ul>
    293                    
     292
    294293                        <?php else: ?>
    295294
     
    299298
    300299                        <?php endif; ?>
    301                
     300
    302301                        <?php do_action( 'bp_after_group_membership_requests_admin' ); ?>
    303                
    304                     <?php endif; ?>
    305            
     302
     303                    <?php endif; ?>
     304
    306305                    <?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?>
    307            
     306
    308307                    <?php /* Delete Group Option */ ?>
    309308                    <?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?>
    310309
    311310                        <h2><?php _e( 'Delete Group', 'buddypress' ); ?></h2>
    312            
     311
    313312                        <?php do_action( 'bp_before_group_delete_admin' ); ?>
    314            
     313
    315314                        <div id="message" class="info">
    316315                            <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>
    317316                        </div>
    318            
     317
    319318                        <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' ); ?>
    320                
     319
    321320                        <?php do_action( 'bp_after_group_delete_admin' ); ?>
    322                
     321
    323322                        <p><input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ) ?> &raquo;" id="delete-group-button" name="delete-group-button" /></p>
    324        
     323
    325324                        <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
    326            
     325
    327326                        <?php wp_nonce_field( 'groups_delete_group' ) ?>
    328                
    329                     <?php endif; ?>
    330                            
     327
     328                    <?php endif; ?>
     329
    331330                    <?php /* This is important, don't forget it */ ?>
    332331                    <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id() ?>" />
    333                        
     332
    334333                </form>
    335        
     334
    336335                <?php do_action( 'bp_after_group_admin_content' ) ?>
    337336        </div>
Note: See TracChangeset for help on using the changeset viewer.