image-heberg/template/js/js.php
2019-10-27 22:12:18 +01:00

37 lines
No EOL
1.4 KiB
PHP

<?php
/*
* Copyright 2008-2019 Anael Mobilia
*
* This file is part of image-heberg.fr.
*
* image-heberg.fr is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* image-heberg.fr is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with image-heberg.fr. If not, see <http://www.gnu.org/licenses/>
*/
require '../../config/config.php';
$visiteur = new sessionObject();
// Utilisateur non connecté : Menu mon-compte caché + bouton pour l'afficher
if ($visiteur->getLevel() === utilisateurObject::levelGuest) :
header('Content-Type: application/javascript');
?>
// Cache les champs liés à l'espace membre
$("#monCompte").hide();
// Au clic sur le bouton, affichage
$("#buttonMonCompteGestion").click(function() {
$("#monCompteGestion").hide();
$("#monCompte").show();
});
// J'empêche l'envoi du pseudo formulaire...
$("#monCompteGestion").on("submit", function(e){
e.preventDefault();
});
<?php endif; ?>