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, 'logDownload' => self::GROUP_ADMIN,
'blacklistReset' => self::GROUP_ADMIN, 'blacklistReset' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN, 'blacklistDownload' => self::GROUP_ADMIN,
'register' => self::GROUP_ADMIN,
'testmail' => 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 // Efface les fichiers de backup lorsque l'option est désactivée
if ($this->getInput('configFileBackup', helper::FILTER_BOOLEAN) === false) { if ($this->getInput('configFileBackup', helper::FILTER_BOOLEAN) === false) {
$path = realpath('site/data'); $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 * Envoi un message de test

View File

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

View File

@ -22,26 +22,25 @@
<?php echo template::button('configSetupButton', [ <?php echo template::button('configSetupButton', [
'value' => 'Configuration', 'value' => 'Configuration',
'class' => 'buttonTab', 'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/setup'
]); ?> ]); ?>
<?php echo template::button('configSocialButton', [ <?php echo template::button('configSocialButton', [
'value' => 'Référencement', 'value' => 'Référencement',
'class' => 'buttonTab', 'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/social'
]); ?> ]); ?>
<?php echo template::button('configConnectButton', [ <?php echo template::button('configConnectButton', [
'value' => 'Connexion', 'value' => 'Connexion',
'class' => 'buttonTab', 'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/connect'
]); ?> ]); ?>
<?php echo template::button('configNetworkButton', [ <?php echo template::button('configNetworkButton', [
'value' => 'Réseau', 'value' => 'Réseau',
'class' => 'buttonTab', 'class' => 'buttonTab',
'href' => helper::baseUrl() . 'config/register/network'
]); ?> ]); ?>
</div> </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/setup/setup.php') ?>
<?php include('core/module/config/view/social/social.php') ?> <?php include('core/module/config/view/social/social.php') ?>
<?php include('core/module/config/view/connect/connect.php') ?> <?php include('core/module/config/view/connect/connect.php') ?>