13.5 Configuration du site, la page ne se recharge plus après un changement d'onglet.

Le dernier onglet vu avant un submit est mémorisé.
This commit is contained in:
Fred Tempez 2024-12-21 22:46:56 +01:00
parent a1c7457a1d
commit 3ef6d5b1e7
3 changed files with 19 additions and 26 deletions

View File

@ -31,7 +31,6 @@ class config extends common
'logDownload' => self::GROUP_ADMIN,
'blacklistReset' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN,
'register' => self::GROUP_ADMIN,
'testmail' => self::GROUP_ADMIN,
];
@ -503,6 +502,17 @@ class config extends common
]
]);
// Sauvegarde la position des onglets de la vue de l'utilisateur courant
$this->setData([
'user',
$this->getUser('id'),
'view',
[
'config' => $this->getInput('containerSelected'),
'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']),
]
]);
// Efface les fichiers de backup lorsque l'option est désactivée
if ($this->getInput('configFileBackup', helper::FILTER_BOOLEAN) === false) {
$path = realpath('site/data');
@ -922,26 +932,6 @@ class config extends common
}
}
/**
* Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite
* @return never
*/
public function register(): void
{
$this->setData([
'user',
$this->getUser('id'),
'view',
[
'config' => $this->getUrl(2),
'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']),
]
]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'config/' . $this->getUrl(2),
]);
}
/**
* Envoi un message de test

View File

@ -162,6 +162,7 @@ $(document).ready(function () {
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").show();
document.getElementById("containerSelected").value = "setup";
$("#configSetupButton").addClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
@ -172,6 +173,7 @@ $(document).ready(function () {
$("#setupContainer").hide();
$("#networkContainer").hide();
$("#socialContainer").show();
document.getElementById("containerSelected").value = "social";
$("#configSetupButton").removeClass("activeButton");
$("#configSocialButton").addClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
@ -182,6 +184,7 @@ $(document).ready(function () {
$("#socialContainer").hide();
$("#networkContainer").hide();
$("#connectContainer").show();
document.getElementById("containerSelected").value = "connect";
$("#configSetupButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").addClass("activeButton");
@ -192,6 +195,7 @@ $(document).ready(function () {
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").show();
document.getElementById("containerSelected").value = "network";
$("#configSetupButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");

View File

@ -22,26 +22,25 @@
<?php echo template::button('configSetupButton', [
'value' => 'Configuration',
'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/setup'
]); ?>
<?php echo template::button('configSocialButton', [
'value' => 'Référencement',
'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/social'
]); ?>
<?php echo template::button('configConnectButton', [
'value' => 'Connexion',
'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/connect'
]); ?>
<?php echo template::button('configNetworkButton', [
'value' => 'Réseau',
'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/network'
]); ?>
</div>
<!-- Champ caché pour transmettre l'onglet-->
<?php echo template::hidden('containerSelected'); ?>
<!-- Pages de formulaires -->
<?php include('core/module/config/view/setup/setup.php') ?>
<?php include('core/module/config/view/social/social.php') ?>
<?php include('core/module/config/view/connect/connect.php') ?>