Skip to content
Extraits de code Groupes Projets
Valider bc1db791 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #607 make sure user uploads a ZIP file

parent b636f6dc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -718,7 +718,8 @@
"MenuExtend": "Extend",
"PluginNotCompatibleWith": "%1$s plugin is not compatible with %2$s.",
"PluginAskDevToUpdate": "If you enjoyed this plugin, maybe you can ask the developers to update it to work on the latest Piwik. ",
"UninstallConfirm": "You are about to uninstall a plugin %s. The plugin will be completely removed from your platform and it won't be recoverable. Are you sure you want to do this?"
"UninstallConfirm": "You are about to uninstall a plugin %s. The plugin will be completely removed from your platform and it won't be recoverable. Are you sure you want to do this?",
"NoZipFileSelected": "Please select a ZIP file."
},
"CoreUpdater": {
"PluginDescription": "Piwik updating mechanism",
......
......@@ -30,6 +30,7 @@ class CorePluginsAdmin extends \Piwik\Plugin
'AssetManager.getJsFiles' => 'getJsFiles',
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'TaskScheduler.getScheduledTasks' => 'getScheduledTasks',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys'
);
}
......@@ -93,4 +94,9 @@ class CorePluginsAdmin extends \Piwik\Plugin
$jsFiles[] = "plugins/CorePluginsAdmin/javascripts/pluginExtend.js";
}
public function getClientSideTranslationKeys(&$translations)
{
$translations[] = 'CorePluginsAdmin_NoZipFileSelected';
}
}
......@@ -19,11 +19,12 @@ $(document).ready(function () {
$('#uploadPluginForm').submit(function (event) {
$zipFile = $('[name=pluginZip]');
var $zipFile = $('[name=pluginZip]');
var fileName = $zipFile.val();
if (!$zipFile.val()) {
if (!fileName || '.zip' != fileName.slice(-4)) {
event.preventDefault();
alert('Please select a ZIP file.');
alert(_pk_translate('CorePluginsAdmin_NoZipFileSelected'));
}
});
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter