diff --git a/view/unicaen-authentification/auth/login-tabs.phtml b/view/unicaen-authentification/auth/login-tabs.phtml index 059a3e707decc9f1514a0a65cfbd9c49562e46e6..5a89ff4cbdb7ce657df590f63acfb9cf488f2360 100644 --- a/view/unicaen-authentification/auth/login-tabs.phtml +++ b/view/unicaen-authentification/auth/login-tabs.phtml @@ -1,8 +1,8 @@ <?php -use UnicaenAuth\Authentication\Adapter; -use UnicaenAuth\Form\LoginForm; -use UnicaenAuth\View\Helper\AbstractConnectViewHelper; +use UnicaenAuthentification\Authentication\Adapter; +use UnicaenAuthentification\Form\LoginForm; +use UnicaenAuthentification\View\Helper\AbstractConnectViewHelper; /** * Génération des différents types de formulaire de connexion activés. @@ -26,7 +26,6 @@ $form->setAttributes([ $helpers = []; foreach ($types as $t => $config) { $helpers[$t] = $this->connect($t, $form); - /** @see \UnicaenAuth\View\Helper\ConnectViewHelper */ } $activeHelper = null; @@ -37,9 +36,11 @@ $activeHelper = null; <ul class="nav nav-tabs card-header-tabs" role="tablist"> <?php foreach ($helpers as $key => $helper): ?> <?php + $query = $redirect ? ['redirect' => $redirect] : []; if ($key === $type) { $activeClass = 'active'; $ariaSelected = 'true'; + $activeHelper = $helper; } else { if (isset($forms[$key]) && $forms[$key]->isHidden()) { continue; @@ -49,27 +50,25 @@ $activeHelper = null; } ?> <li role="presentation" class="nav-item"> - <button class="nav-link <?= $activeClass ?>" id="<?= $key ?>-tab" data-bs-toggle="tab" - data-bs-target="#<?= $key ?>" type="button" - role="tab" aria-controls="<?= $key ?>" aria-selected="<?= $ariaSelected ?>"> + <a class="nav-link <?= $activeClass ?>" type="button" + role="tab" aria-selected="<?= $ariaSelected ?>" + href="<?= $this->url('zfcuser/login', ['type' => $key], ['query' => $query]) ?>" + > <?= $helper->getTitle() ?> - </button> + </a> </li> <?php endforeach ?> </ul> </div> <div class="card-body tab-content"> - <?php foreach ($helpers as $key => $helper): ?> - <?php $activeClass = ($key === $type) ? 'active' : '';?> - <div class="tab-pane <?= $activeClass ?>" id="<?= $key ?>" role="tabpanel" - aria-labelledby="<?= $key ?>-tab"> - <?php - $title = $helper->getTitle(); - $helper->setTitle(""); // pour éviter que le title soit répété - ?> - <?= (string) $helper ?> - </div> - <?php endforeach ?> + <div class="tab-pane active" role="tabpanel"> + <?php if (isset($activeHelper)) { + $activeHelper->setTitle(""); // pour éviter que le title soit répété + echo $activeHelper; + } + ?> + </div> </div> </div> + diff --git a/view/unicaen-authentification/auth/login.phtml b/view/unicaen-authentification/auth/login.phtml index b886d55a95701ee47842a86f475c2087fd5c5b98..ad8f20749a8117aba963f8ec905a582d3dbd3460 100644 --- a/view/unicaen-authentification/auth/login.phtml +++ b/view/unicaen-authentification/auth/login.phtml @@ -8,11 +8,11 @@ * @var string $redirect URL demandée nécessitant authentification * @var bool $enableRegistration * - * @see \UnicaenAuth\Controller\AuthController::loginAction() + * @see \UnicaenAuthentification\Controller\AuthController::loginAction() */ use Application\View\Renderer\PhpRenderer; -use UnicaenAuth\Form\LoginForm; +use UnicaenAuthentification\Form\LoginForm; use Laminas\Form\Form; $this->headTitle("Connexion") ?> @@ -44,4 +44,4 @@ $this->headTitle("Connexion") ?> }); if ($input.length) $input.get(0).focus(); }); -</script> \ No newline at end of file +</script>