core = $core; } /** * Affiche le consentement aux cookies */ public function showCookies() { // La gestion des cookies est externalisée if ($this->getData(['config', 'cookieConsent']) === false) { return; } // Le cookie est déjà validé if ($this->getInput('ZWII_COOKIE_CONSENT') === 'true') { return; } $item = '
'; // Bouton de fermeture $item .= '
'; $item .= template::ico('cancel'); $item .= '
'; // Texte de la popup $item .= '

' . $this->getData(['locale', 'cookies', 'titleLabel']) . '

'; $item .= '

' . $this->getData(['locale', 'cookies', 'mainLabel']) . '

'; // Formulaire de réponse if ( $this->getData(['locale', 'homePageId']) === $this->getUrl(0) ) { $item .= '
'; } else { $item .= ''; } $item .= '

'; $item .= ''; $item .= '
'; // mentions légales si la page est définie $legalPage = $this->getData(['locale', 'legalPageId']); if ($legalPage !== 'none') { $item .= '

' . $this->getData(['locale', 'cookies', 'linkLegalLabel']) . '

'; } $item .= '
'; echo $item; } /** * Formate le contenu de la page selon les gabarits * @param Page par defaut */ public function showSection() { echo '
'; // Récupérer la config de la page courante $blocks = is_null($this->getData(['page', $this->getUrl(0), 'block'])) ? '12' : $this->getData(['page', $this->getUrl(0), 'block']); $blocks = explode('-', $blocks); // Initialiser $blockleft = ''; $blockright = ''; switch (sizeof($blocks)) { case 1: // une colonne $content = 'col' . $blocks[0]; break; case 2: // 2 blocs if ($blocks[0] < $blocks[1]) { // détermine la position de la colonne $blockleft = 'col' . $blocks[0]; $content = 'col' . $blocks[1]; } else { $content = 'col' . $blocks[0]; $blockright = 'col' . $blocks[1]; } break; case 3: // 3 blocs $blockleft = 'col' . $blocks[0]; $content = 'col' . $blocks[1]; $blockright = 'col' . $blocks[2]; } // Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog $pattern = ['config', 'edit', 'add', 'comment', 'data']; if ( (sizeof($blocks) === 1 || in_array($this->getUrl(1), $pattern)) ) { // Pleine page en mode configuration $this->showContent(); } else { echo '
'; /** * Barre gauche */ if ($blockleft !== "") { echo '
"; } /** * Contenu de page */ echo '
'; $this->showContent(); echo '
'; /** * Barre droite */ if ($blockright !== "") { echo '
'; } echo '
'; } echo '
'; } /** * Affiche le contenu * @param Page par défaut */ public function showContent() { if ( $this->core->output['title'] and ($this->getData(['page', $this->getUrl(0)]) === null or $this->getData(['page', $this->getUrl(0), 'hideTitle']) === false or $this->getUrl(1) === 'config' ) ) { echo '

' . $this->core->output['title'] . '

'; } echo $this->core->output['content']; } /** * Affiche le pied de page */ public function showFooter() { // Déterminer la position $positionFixed = ''; if ( $this->getData(['theme', 'footer', 'position']) === 'site' // Affiche toujours le pied de page pour l'édition du thème or ($this->getData(['theme', 'footer', 'position']) === 'hide' and $this->getUrl(0) === 'theme' ) ) { $position = 'site'; } else { $position = 'body'; if ($this->getData(['theme', 'footer', 'fixed']) === true) { $positionFixed = ' footerbodyFixed'; } // Sortir de la division précédente echo ''; } echo $this->getData(['theme', 'footer', 'position']) === 'hide' ? '