Merge branch '2.0'
authorMatthias Schmidt <gravatronics@live.com>
Fri, 3 Apr 2015 06:19:40 +0000 (08:19 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 3 Apr 2015 06:19:40 +0000 (08:19 +0200)
1  2 
wcfsetup/install/files/acp/templates/userAdd.tpl

index 6aa7b3fd65693dac70d561699f8b7d1bc9ed05ab,60990fda525158f33476f0402e5b82d6c3353ac9..59225a6850c5a94d6496e259cd330bdfa9ac8e74
                                                        }
                                                        else {
                                                                $('#disableAvatarReason').attr('readonly', true);
 +                                                              $('#disableAvatarNeverExpires, #disableAvatarExpires').disable();
 +                                                              $('#disableAvatarReason, #disableAvatarNeverExpires, #disableAvatarExpires').parents('dl').addClass('disabled');
                                                        }
                                                });
 +                                              
                                                $('#disableAvatar').change();
                                                
 +                                              $('#disableAvatarNeverExpires').change(function() {
 +                                                      if ($('#disableAvatarNeverExpires').is(':checked')) {
 +                                                              $('#disableAvatarExpiresSetting').hide();
 +                                                      }
 +                                                      else {
 +                                                              $('#disableAvatarExpiresSetting').show();
 +                                                      }
 +                                              });
 +                                              
 +                                              $('#disableAvatarNeverExpires').change();
 +                                              //]]>
 +                                      </script>
 +                              {/if}
 +                              
 +                              <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Message.js?v={@LAST_UPDATE_TIME}"></script>
 +                              <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.User.js?v={@LAST_UPDATE_TIME}"></script>
 +                              <script data-relocate="true">
 +                                      //<![CDATA[
 +                                      $(function() {
                                                WCF.Language.addObject({
+                                                       'wcf.user.avatar.type.custom.crop': '{lang}wcf.user.avatar.type.custom.crop{/lang}',
                                                        'wcf.user.avatar.upload.error.invalidExtension': '{lang}wcf.user.avatar.upload.error.invalidExtension{/lang}',
                                                        'wcf.user.avatar.upload.error.tooSmall': '{lang}wcf.user.avatar.upload.error.tooSmall{/lang}',
                                                        'wcf.user.avatar.upload.error.tooLarge': '{lang}wcf.user.avatar.upload.error.tooLarge{/lang}',
                                                        'wcf.user.avatar.upload.error.uploadFailed': '{lang}wcf.user.avatar.upload.error.uploadFailed{/lang}',
                                                        'wcf.user.avatar.upload.error.badImage': '{lang}wcf.user.avatar.upload.error.badImage{/lang}',
 -                                                      'wcf.user.avatar.upload.success': '{lang}wcf.user.avatar.upload.success{/lang}',
 -                                                      'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}'
 +                                                      'wcf.user.avatar.upload.success': '{lang}wcf.user.avatar.upload.success{/lang}'
                                                });
                                                
-                                               new WCF.User.Avatar.Upload({@$user->userID});
+                                               {if $userAvatar && $userAvatar->canCrop()}
+                                                       new WCF.User.Avatar.Upload({@$user->userID}, new WCF.User.Avatar.Crop({@$userAvatar->avatarID}));
+                                               {else}
+                                                       new WCF.User.Avatar.Upload({@$user->userID});
+                                               {/if}
                                        });
                                        //]]>
                                </script>