Module plugin bug présélection des boutons

This commit is contained in:
Fred Tempez 2022-09-19 17:01:39 +02:00
parent 32048ffa12
commit fdfaee71db
2 changed files with 17 additions and 16 deletions

View File

@ -13,15 +13,16 @@
$(document).ready(function () { $(document).ready(function () {
var configLayout = getCookie("pluginLayout"); var pluginLayout = getCookie("pluginLayout");
if (configLayout == null) { if (pluginLayout == null) {
configLayout = "module"; pluginLayout = "module";
setCookie("pluginLayout", "module"); setCookie("pluginLayout", "module");
} }
console.log(pluginLayout);
$("#moduleContainer").hide(); $("#moduleContainer").hide();
$("#dataContainer").hide(); $("#dataContainer").hide();
$("#" + configLayout + "Container").show(); $("#" + pluginLayout + "Container").show();
$("#config" + capitalizeFirstLetter(pluginLayout) + "Button").addClass("activeButton"); $("#plugin" + capitalizeFirstLetter(pluginLayout) + "Button").addClass("activeButton");
}); });
@ -51,18 +52,18 @@ $(".moduleDelete").on("click", function() {
// Sélecteur de fonctions // Sélecteur de fonctions
$("#configModuleButton").on("click", function () { $("#pluginModuleButton").on("click", function () {
$("#dataContainer").hide(); $("#dataContainer").hide();
$("#moduleContainer").show(); $("#moduleContainer").show();
$("#configModuleButton").addClass("activeButton"); $("#pluginModuleButton").addClass("activeButton");
$("#configDataButton").removeClass("activeButton"); $("#pluginDataButton").removeClass("activeButton");
setCookie("pluginLayout", "module"); setCookie("pluginLayout", "module");
}); });
$("#configDataButton").on("click", function () { $("#pluginDataButton").on("click", function () {
$("#moduleContainer").hide(); $("#moduleContainer").hide();
$("#dataContainer").show(); $("#dataContainer").show();
$("#configModuleButton").removeClass("activeButton"); $("#pluginModuleButton").removeClass("activeButton");
$("#configDataButton").addClass("activeButton"); $("#pluginDataButton").addClass("activeButton");
setCookie("pluginLayout", "data"); setCookie("pluginLayout", "data");
}); });

View File

@ -7,7 +7,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('configModulesHelp', [ <?php echo template::button('pluginHelp', [
'href' => 'https://doc.zwiicms.fr/gestion-des-modules', 'href' => 'https://doc.zwiicms.fr/gestion-des-modules',
'target' => '_blank', 'target' => '_blank',
'value' => template::ico('help'), 'value' => template::ico('help'),
@ -16,14 +16,14 @@
]); ?> ]); ?>
</div> </div>
<div class="col1 offset8"> <div class="col1 offset8">
<?php echo template::button('configModulesStore', [ <?php echo template::button('pluginModulesStore', [
'href' => helper::baseUrl() . 'plugin/store', 'href' => helper::baseUrl() . 'plugin/store',
'value' => template::ico('shopping-basket'), 'value' => template::ico('shopping-basket'),
'help' => 'Installer depuis le catalogue en ligne' 'help' => 'Installer depuis le catalogue en ligne'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('configStoreUpload', [ <?php echo template::button('pluginStoreUpload', [
'href' => helper::baseUrl() . 'plugin/upload', 'href' => helper::baseUrl() . 'plugin/upload',
'value' => template::ico('file-archive'), 'value' => template::ico('file-archive'),
'help' => 'Installer depuis une archive' 'help' => 'Installer depuis une archive'
@ -31,11 +31,11 @@
</div> </div>
</div> </div>
<div class="tab"> <div class="tab">
<?php echo template::button('configModuleButton', [ <?php echo template::button('pluginModuleButton', [
'value' => 'Modules installés', 'value' => 'Modules installés',
'class' => ' buttonTab' 'class' => ' buttonTab'
]); ?> ]); ?>
<?php echo template::button('configDataButton', [ <?php echo template::button('pluginDataButton', [
'value' => 'Données des modules', 'value' => 'Données des modules',
'class' => 'buttonTab' 'class' => 'buttonTab'
]); ?> ]); ?>