From f2c01e7e9fb37b917057db63a47245e8ed8ce080 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 8 Dec 2019 16:48:42 +0100 Subject: [PATCH] =?UTF-8?q?[9.2.15]=20Affichage=20d'une=20page=20Lity=20sa?= =?UTF-8?q?ns=20la=20structure=20du=20site=20(manue,=20banni=C3=A8re,=20fo?= =?UTF-8?q?oter)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 +++ core/core.php | 68 ++++++++++++++++++++--------------- core/layout/popup.php | 83 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 28 deletions(-) create mode 100644 core/layout/popup.php diff --git a/CHANGES.md b/CHANGES.md index ccecd6c7..5f0f22b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## version 9.2.15 +- Amélioration : + - Affichage du contenu seul d'une page du site dans une popup Lity sans menu, bannière et pied de page + ## version 9.2.14 - Mise à jour : - Script d'upload du gestionnaire de fichiers diff --git a/core/core.php b/core/core.php index 7f0e5222..1c53ae58 100644 --- a/core/core.php +++ b/core/core.php @@ -21,6 +21,7 @@ class common { const DISPLAY_LAYOUT_BLANK = 2; const DISPLAY_LAYOUT_MAIN = 3; const DISPLAY_LAYOUT_LIGHT = 4; + const DISPLAY_LAYOUT_POPUP = 5; const GROUP_BANNED = -1; const GROUP_VISITOR = 0; const GROUP_MEMBER = 1; @@ -69,6 +70,7 @@ class common { 'notification' => '', 'redirect' => '', 'script' => '', + 'targetLity' => false, 'showBarEditButton' => false, 'showPageContent' => false, 'state' => false, @@ -1302,7 +1304,8 @@ class core extends common { 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'contentRight' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'content']), - 'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']) + 'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']), + 'targetLity' => is_null($this->getData(['page', $this->getUrl(0), 'targetLity'])) ? false : $this->getData(['page', $this->getUrl(0), 'targetLity']) ]); } // Importe le module @@ -1319,7 +1322,8 @@ class core extends common { 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'contentRight' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'content']), - 'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']) + 'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']), + 'targetLity' => is_null($this->getData(['page', $this->getUrl(0), 'targetLity'])) ? false : $this->getData(['page', $this->getUrl(0), 'targetLity']) ]); $pageContent = $this->getData(['page', $this->getUrl(0), 'content']); } @@ -1397,13 +1401,13 @@ class core extends common { header('Location:' . $output['redirect']); exit(); } - } + } // Données en sortie applicables même lorsqu'une notice est présente // Affichage - if($output['display']) { + if($output['display']) { $this->addOutput([ 'display' => $output['display'] - ]); + ]); } // Contenu brut if($output['content']) { @@ -1523,29 +1527,37 @@ class core extends common { 'metaDescription' => $this->getData(['config', 'metaDescription']) ]); } - // Choix du type d'affichage - switch($this->output['display']) { - // Layout vide - case self::DISPLAY_LAYOUT_BLANK: - require 'core/layout/blank.php'; - break; - // Affichage en JSON - case self::DISPLAY_JSON: - header('Content-Type: application/json'); - echo json_encode($this->output['content']); - break; - // Layout alléger - case self::DISPLAY_LAYOUT_LIGHT: - require 'core/layout/light.php'; - break; - // Layout principal - case self::DISPLAY_LAYOUT_MAIN: - require 'core/layout/main.php'; - break; - // Layout brut - case self::DISPLAY_RAW: - echo $this->output['content']; - break; + + if($this->output['targetLity']) { + require 'core/layout/popup.php'; + } else { + switch($this->output['display']) { + // Layout vide + case self::DISPLAY_LAYOUT_BLANK: + require 'core/layout/blank.php'; + break; + // Affichage en JSON + case self::DISPLAY_JSON: + header('Content-Type: application/json'); + echo json_encode($this->output['content']); + break; + // Layout alléger + case self::DISPLAY_LAYOUT_LIGHT: + require 'core/layout/light.php'; + break; + // Layout principal + case self::DISPLAY_LAYOUT_MAIN: + require 'core/layout/main.php'; + break; + // Layout poup lity + case self::DISPLAY_LAYOUT_POPUP: + + break; + // Layout brut + case self::DISPLAY_RAW: + echo $this->output['content']; + break; + } } } diff --git a/core/layout/popup.php b/core/layout/popup.php new file mode 100644 index 00000000..5e45b3c9 --- /dev/null +++ b/core/layout/popup.php @@ -0,0 +1,83 @@ + + + + + + + showMetaTitle(); ?> + showMetaDescription(); ?> + showMetaType(); ?> + showMetaImage(); ?> + showFavicon(); ?> + showVendor(); ?> + showAnalytics(); ?> + + + + showStyle(); ?> + + + + +
+ getData(['page',$this->getUrl(0),'block'])); + // Initialiser + $blockleft=$blockright=""; + switch (sizeof($blocks)) { + case 1 : // une colonne + $content = 'col'. $blocks[0] ; + break; + case 2 : // 2 blocks + 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 blocks + $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'affichae 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 + $layout->showContent(); + if (file_exists('site/data/body.inc.html')) { + include('site/data/body.inc.html'); + } + } else { + ?> +
+ +
showBarContentLeft(); ?>
+ +
showContent(); + if (file_exists('site/data/body.inc.html')) { + include('site/data/body.inc.html'); + } + ?> +
+ +
showBarContentRight(); ?>
+ +
+ +
+ +
+ showScript();?> + +