Overview
Comment: | Refactor homepage controller |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
4f7a33917eb5210b6cc33011fbbc6394 |
User & Date: | bohwaz on 2020-12-13 00:30:57 |
Other Links: | branch diff | manifest | tags |
Context
2020-12-13
| ||
00:31 | Fix config constructor check-in: 755dee3526 user: bohwaz tags: dev | |
00:30 | Refactor homepage controller check-in: 4f7a33917e user: bohwaz tags: dev | |
00:28 | You should be able to get the session object again, using a singleton check-in: ed012f894f user: bohwaz tags: dev | |
Changes
Modified src/templates/admin/index.tpl from [8ad9228981] to [8e64b12bbb].
1 2 | {include file="admin/_head.tpl" title="Bonjour %s !"|args:$user.identite current="home"} | | | | | | | | | | | | > > > > > | | | | | | | | | | > | | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | {include file="admin/_head.tpl" title="Bonjour %s !"|args:$user.identite current="home"} {$banner|raw} <nav class="tabs"> <ul> <li><a href="{$admin_url}mes_infos.php">Modifier mes informations personnelles</a></li> <li><a href="{$admin_url}my_services.php">Suivi de mes activités et cotisations</a></li> </ul> </nav> <aside class="describe"> <h3>{$config.nom_asso}</h3> {if !empty($config.adresse_asso)} <p> {$config.adresse_asso|escape|nl2br} </p> {/if} {if !empty($config.telephone_asso)} <p> Tél. : <a href="tel:{$config.telephone_asso}">{$config.telephone_asso}</a> </p> {/if} {if !empty($config.email_asso)} <p> E-Mail : <a href="mailto:{$config.email_asso}">{$config.email_asso}</a> </p> {/if} {if !empty($config.site_asso)} <p> Web : <a href="{$config.site_asso}" target="_blank">{$config.site_asso}</a> </p> {/if} </aside> {if $homepage} <article class="web"> {$homepage->render()} </article> {/if} {include file="admin/_foot.tpl"} |
Modified src/www/admin/_inc.php from [d6f6a6d40f] to [37f9d2a893].
︙ | ︙ | |||
41 42 43 44 45 46 47 | $tpl = Template::getInstance(); $tpl->assign('admin_url', ADMIN_URL); $form = new Form; $tpl->assign_by_ref('form', $form); | | > | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | $tpl = Template::getInstance(); $tpl->assign('admin_url', ADMIN_URL); $form = new Form; $tpl->assign_by_ref('form', $form); $session = Session::getInstance(); $config = Config::getInstance(); $tpl->assign('session', $session); $tpl->assign('config', $config->getConfig()); if (!defined('Garradin\LOGIN_PROCESS')) { if (!$session->isLogged()) { if ($session->isOTPRequired()) { |
︙ | ︙ |
Modified src/www/admin/index.php from [7e32fa08cc] to [d909595888].
1 2 3 4 5 6 7 8 9 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $cats = new Membres\Categories; $categorie = $cats->get($user->id_categorie); | < | < < < < < | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $cats = new Membres\Categories; $categorie = $cats->get($user->id_categorie); $homepage = Config::getInstance()->get('admin_homepage'); $banner = null; Plugin::fireSignal('accueil.banniere', ['user' => $user, 'session' => $session], $banner); $tpl->assign(compact('categorie', 'homepage', 'banner')); $tpl->display('admin/index.tpl'); flush(); // Si pas de cron on réalise les tâches automatisées à ce moment-là // c'est pas idéal mais mieux que rien if (!USE_CRON) { require_once ROOT . '/scripts/cron.php'; } |