diff --git a/plugins/CoreAdminHome/javascripts/generalSettings.js b/plugins/CoreAdminHome/javascripts/generalSettings.js index 2efa037fd99e4d7ba25665f5fcbdeb74bb1cdb3e..50f3e3b05ac42066ecdb173ad3626fde5c8d6912 100644 --- a/plugins/CoreAdminHome/javascripts/generalSettings.js +++ b/plugins/CoreAdminHome/javascripts/generalSettings.js @@ -123,6 +123,13 @@ $(document).ready(function () { var frameContent = $(uploadFrame.contents()).find('body').html(); frameContent = $.trim(frameContent); + if ('0' === frameContent) { + $('.uploaderror').show(); + setTimeout(function(){ + $('.uploaderror').fadeOut(); + }, 5000); + } + if ('1' === frameContent || '0' === frameContent) { uploadFrame.remove(); } diff --git a/plugins/CoreAdminHome/lang/en.json b/plugins/CoreAdminHome/lang/en.json index 5be7675fb9a6f0a0ccbb696f2761f30eb08e6c33..cd88aca4f0a918979bdf7f204284b210cf30871a 100644 --- a/plugins/CoreAdminHome/lang/en.json +++ b/plugins/CoreAdminHome/lang/en.json @@ -49,6 +49,7 @@ "JSTrackingIntro5": "If you want to do more than track page views, please check out the %1$sPiwik Javascript Tracking documentation%2$s for the list of available functions. Using these functions you can track goals, custom variables, ecommerce orders, abandoned carts and more.", "LogoNotWriteableInstruction": "To use your custom logo instead of the default Piwik logo, give write permission to this directory: %1$s Piwik needs write access for your logos stored in the files %2$s.", "FileUploadDisabled": "Uploading files is not enabled in your PHP configuration. To upload your custom logo please set %s in php.ini and restart your webserver.", + "LogoUploadFailed": "The uploaded file couldn't be processed. Please check if the file has a valid format.", "LogoUpload": "Select a Logo to upload", "FaviconUpload": "Select a Favicon to upload", "LogoUploadHelp": "Please upload a file in %s formats with a minimum height of %s pixels.", diff --git a/plugins/CoreAdminHome/templates/generalSettings.twig b/plugins/CoreAdminHome/templates/generalSettings.twig index c3cd7c95008e69f8508b466312b63b7bc8ef76b4..e70d537472ebe2277abe996997cbcd2d1fa1a52c 100644 --- a/plugins/CoreAdminHome/templates/generalSettings.twig +++ b/plugins/CoreAdminHome/templates/generalSettings.twig @@ -204,6 +204,9 @@ <input type="hidden" name="token_auth" value="{{ token_auth }}"/> {% if logosWriteable %} + <div class="alert alert-warning uploaderror" style="display:none;"> + {{ 'CoreAdminHome_LogoUploadFailed'|translate }} + </div> <div class="form-group"> <label for="customLogo">{{ 'CoreAdminHome_LogoUpload'|translate }}</label> <div class="form-help">{{ 'CoreAdminHome_LogoUploadHelp'|translate("JPG / PNG / GIF", 110) }}</div>