diff --git a/admin-dev/themes/default/js/bundle/module/module.js b/admin-dev/themes/default/js/bundle/module/module.js index c91feeee94383..79eba38e766ef 100644 --- a/admin-dev/themes/default/js/bundle/module/module.js +++ b/admin-dev/themes/default/js/bundle/module/module.js @@ -19,7 +19,6 @@ var AdminModuleController = function() { this.pstaggerInput = null; this.lastBulkAction = null; this.isUploadStarted = false; - this.baseAdminDir = ''; /** * Loaded modules list. @@ -175,13 +174,11 @@ var AdminModuleController = function() { }; this.ajaxLoadPage = function() { - var token = window.location.search; - var urlToCall = this.baseAdminDir+'module/catalog/refresh' + token; var self = this; $.ajax({ method: 'GET', - url: urlToCall + url: moduleURLs.catalogRefresh }).done(function (response) { if (response.status === true) { if (typeof response.domElements === 'undefined') response.domElements = null; @@ -512,7 +509,7 @@ var AdminModuleController = function() { // @see: dropzone.js var dropzoneOptions = { - url: 'import' + window.location.search, + url: moduleURLs.moduleImport, acceptedFiles: '.zip, .tar', // The name that will be used to transfer the file paramName: 'file_uploaded', @@ -567,7 +564,7 @@ var AdminModuleController = function() { self.animateEndUpload(function() { if (result.status === true) { if (result.is_configurable === true) { - var configureLink = self.baseAdminDir + 'module/manage/action/configure/' + result.module_name + window.location.search; + var configureLink = moduleURLs.configurationPage.replace('1', result.module_name); $(self.moduleImportSuccessConfigureBtnSelector).attr('href', configureLink); $(self.moduleImportSuccessConfigureBtnSelector).show(); } @@ -643,13 +640,6 @@ var AdminModuleController = function() { this.loadVariables = function () { this.initCurrentDisplay(); - - // If index.php found in the current URL, we need it also in the baseAdminDir - //noinspection JSUnresolvedVariable - this.baseAdminDir = baseAdminDir; - if (window.location.href.indexOf('index.php') != -1) { - this.baseAdminDir += 'index.php/'; - } }; this.getModuleItemSelector = function () { @@ -668,7 +658,7 @@ var AdminModuleController = function() { return; } var token = window.location.search; - var urlToCall = this.baseAdminDir+'module/notifications/count' + token; + var urlToCall = moduleURLs.notificationsCount; $.getJSON(urlToCall, function(badge) { // TODO: This HTML code comes from an already specific template. @@ -759,9 +749,6 @@ var AdminModuleController = function() { 'bulk-reset': 'reset' }; - // char is used only to be easy to replace by the end of this function - var baseActionUrl = this.baseAdminDir + 'module/manage/action/@/'; - // Note no grid selector used yet since we do not needed it at dev time // Maybe useful to implement this kind of things later if intended to // use this functionality elsewhere but "manage my module" section @@ -788,7 +775,6 @@ var AdminModuleController = function() { var moduleTechName = data.techName; var urlActionSegment = bulkActionToUrl[requestedBulkAction]; - baseActionUrl.replace('@', urlActionSegment); if (typeof module_card_controller !== 'undefined') { // We use jQuery to get the specific link for this action. If found, we send it. diff --git a/src/PrestaShopBundle/Resources/views/Admin/Module/catalog.html.twig b/src/PrestaShopBundle/Resources/views/Admin/Module/catalog.html.twig index 28757f078e120..9ca843fc5ffa6 100644 --- a/src/PrestaShopBundle/Resources/views/Admin/Module/catalog.html.twig +++ b/src/PrestaShopBundle/Resources/views/Admin/Module/catalog.html.twig @@ -22,14 +22,10 @@ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA *#} -{% extends '@PrestaShop/Admin/layout.html.twig' %} +{% extends '@PrestaShop/Admin/Module/common.html.twig' %} {% block javascripts %} {{ parent() }} - - - - {% if app.request.get('filterCategoryTab') %} + + + + +{% endblock %} diff --git a/src/PrestaShopBundle/Resources/views/Admin/Module/manage.html.twig b/src/PrestaShopBundle/Resources/views/Admin/Module/manage.html.twig index 261d1d3d9a452..c92e225c2aecd 100644 --- a/src/PrestaShopBundle/Resources/views/Admin/Module/manage.html.twig +++ b/src/PrestaShopBundle/Resources/views/Admin/Module/manage.html.twig @@ -22,15 +22,7 @@ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA *#} -{% extends '@PrestaShop/Admin/layout.html.twig' %} - -{% block javascripts %} - {{ parent() }} - - - - -{% endblock %} +{% extends '@PrestaShop/Admin/Module/common.html.twig' %} {% block content %}
diff --git a/src/PrestaShopBundle/Resources/views/Admin/Module/notifications.html.twig b/src/PrestaShopBundle/Resources/views/Admin/Module/notifications.html.twig index dfd0872c0365b..bca52c7e70fd3 100644 --- a/src/PrestaShopBundle/Resources/views/Admin/Module/notifications.html.twig +++ b/src/PrestaShopBundle/Resources/views/Admin/Module/notifications.html.twig @@ -22,15 +22,7 @@ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA *#} -{% extends '@PrestaShop/Admin/layout.html.twig' %} - -{% block javascripts %} - {{ parent() }} - - - - -{% endblock %} +{% extends '@PrestaShop/Admin/Module/common.html.twig' %} {% block content %} {# Addons connect modal #}