From ebb3f6544fcae65aa35da7b74659ce516263ac52 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 14 Jun 2021 18:37:45 +0200 Subject: [PATCH] layout in common --- core/core.php | 2769 ++++++++++++++++++++--------------------- core/layout/blank.php | 21 +- core/layout/light.php | 23 +- core/layout/main.php | 64 +- 4 files changed, 1434 insertions(+), 1443 deletions(-) diff --git a/core/core.php b/core/core.php index ca007a06..0b7097d8 100755 --- a/core/core.php +++ b/core/core.php @@ -186,6 +186,7 @@ class common { * Constructeur commun */ public function __construct() { + // Extraction des données http if(isset($_POST)) { $this->input['_POST'] = $_POST; @@ -352,6 +353,7 @@ class common { ); stream_context_set_default($context); } + } /** @@ -1111,1550 +1113,1541 @@ class common { } $zip->close(); } -} -class core extends common { + // Layout remplace la classe précédente /** - * Constructeur du coeur + * Affiche le script Google Analytics */ - public function __construct() { - parent::__construct(); - // Token CSRF - if(empty($_SESSION['csrf'])) { - $_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(32)); + public function showAnalytics() { + if($code = $this->getData(['config', 'analyticsId']) + AND $this->getInput('ZWII_COOKIE_CONSENT') === 'true') { + echo ' + + '; } - // Fuseau horaire - self::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper - date_default_timezone_set(self::$timezone); - // Supprime les fichiers temporaires - $lastClearTmp = mktime(0, 0, 0); - if($lastClearTmp > $this->getData(['core', 'lastClearTmp']) + 86400) { - $iterator = new DirectoryIterator(self::TEMP_DIR); - foreach($iterator as $fileInfos) { - if( $fileInfos->isFile() && - $fileInfos->getBasename() !== '.htaccess' && - $fileInfos->getBasename() !== '.gitkeep' - ) { - @unlink($fileInfos->getPathname()); - } - } - // Date de la dernière suppression - $this->setData(['core', 'lastClearTmp', $lastClearTmp]); - // Enregistre les données - //$this->SaveData(); + } + + /** + * Affiche le contenu + * @param Page par défaut + */ + public function showContent() { + if ($this->getData(['config', 'i18n', 'active']) === true) { + echo $this->showi18n('Site'); } - // Backup automatique des données - $lastBackup = mktime(0, 0, 0); if( - $this->getData(['config', 'autoBackup']) - AND $lastBackup > $this->getData(['core', 'lastBackup']) + 86400 - AND $this->getData(['user']) // Pas de backup pendant l'installation + $this->output['title'] + AND ( + $this->getData(['page', $this->getUrl(0)]) === null + OR $this->getData(['page', $this->getUrl(0), 'hideTitle']) === false + OR $this->getUrl(1) === 'config' + ) ) { - // Copie des fichier de données - helper::autoBackup(self::BACKUP_DIR,['backup','tmp','file']); - // Date du dernier backup - $this->setData(['core', 'lastBackup', $lastBackup]); - // Supprime les backups de plus de 30 jours - $iterator = new DirectoryIterator(self::BACKUP_DIR); - foreach($iterator as $fileInfos) { - if( - $fileInfos->isFile() - AND $fileInfos->getBasename() !== '.htaccess' - AND $fileInfos->getMTime() + (86400 * 30) < time() - ) { - @unlink($fileInfos->getPathname()); - } - } - } - // Crée le fichier de personnalisation avancée - if(file_exists(self::DATA_DIR.'custom.css') === false) { - file_put_contents(self::DATA_DIR.'custom.css', file_get_contents('core/module/theme/resource/custom.css')); - chmod(self::DATA_DIR.'custom.css', 0755); + echo '

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

'; } - // Crée le fichier de personnalisation - if(file_exists(self::DATA_DIR.'theme.css') === false) { - file_put_contents(self::DATA_DIR.'theme.css', ''); - chmod(self::DATA_DIR.'theme.css', 0755); - } - // Crée le fichier de personnalisation de l'administration - if(file_exists(self::DATA_DIR.'admin.css') === false) { - file_put_contents(self::DATA_DIR.'admin.css', ''); - chmod(self::DATA_DIR.'admin.css', 0755); - } - // Check la version rafraichissement du theme - $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR.'theme.css')); - if(empty($cssVersion[1]) OR $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) { - // Version - $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; - // Import des polices de caractères - $css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");'; - // Fond du body - $colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor'])); - // Body - $css .= 'body{font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; - if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) { - // Image dans html pour éviter les déformations. - $css .= 'html, .mce-menu.mce-in.mce-animate {background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; - // Couleur du body transparente - $css .= 'body, .mce-menu.mce-in.mce-animate{background-color: rgba(0,0,0,0)}'; - } else { - // Pas d'image couleur du body - $css .= 'html, .mce-menu.mce-in.mce-animate{background-color:' . $colors['normal'] . ';}'; - // Même couleur dans le fond de l'éditeur - $css .= 'div.mce-edit-area {background-color:' . $colors['normal'] . ' !important}'; - } - // Icône BacktoTop - $css .= '#backToTop {background-color:' .$this->getData(['theme', 'body', 'toTopbackgroundColor']). ';color:'.$this->getData(['theme', 'body', 'toTopColor']).';}'; - // Site - $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor'])); - $css .= 'a{color:' . $colors['normal'] . '}'; - // Couleurs de site dans TinyMCe - $css .= 'div.mce-edit-area {font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; - // Site dans TinyMCE - $css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}'; - //$css .= 'a:hover:not(.inputFile, button){color:' . $colors['darken'] . '}'; - $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; - $css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; - $css .= 'select,input[type=\'password\'],input[type=\'email\'],input[type=\'text\'],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) .';background-color:'.$this->getData(['theme', 'site', 'backgroundColor']).';}'; - // spécifiques au module de blog - $css .= '.blogDate {color:' . $this->getData(['theme', 'text', 'textColor']) . ';}.blogPicture img{border:1px solid ' . $this->getData(['theme', 'text', 'textColor']) . '; box-shadow: 1px 1px 5px ' . $this->getData(['theme', 'text', 'textColor']) . ';}'; - // Couleur fixée dans admin.css - //$css .= '.button.buttonGrey,.button.buttonGrey:hover{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; - $css .= '.container, .helpDisplayContent{max-width:' . $this->getData(['theme', 'site', 'width']) . '}'; - $margin = $this->getData(['theme', 'site', 'margin']) ? '0' : '20px'; - // Marge supplémentaire lorsque le pied de page est fixe - if ( $this->getData(['theme', 'footer', 'fixed']) === true && - $this->getData(['theme', 'footer', 'position']) === 'body') { - //$css .= '@media (min-width: 769px) { #site {margin-bottom: ' . ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 31 ) . 'px}}'; - //$css .= '@media (max-width: 768px) { #site {margin-bottom: ' . ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 93 ) . 'px}}'; - $marginBottomLarge = ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 31 ) . 'px'; - $marginBottomSmall = ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 93 ) . 'px'; - } else { - $marginBottomSmall = $margin; - $marginBottomLarge = $margin; - } - $css .= $this->getData(['theme', 'site', 'width']) === '100%' - ? '@media (min-width: 769px) {#site{margin:0 auto ' . $marginBottomLarge . ' 0 !important;}}@media (max-width: 768px) {#site{margin:0 auto ' . $marginBottomSmall . ' 0 !important;}}#site.light{margin:5% auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}' - : '@media (min-width: 769px) {#site{margin: ' . $margin . ' auto ' . $marginBottomLarge . ' auto !important;}}@media (max-width: 768px) {#site{margin: ' . $margin . ' auto ' . $marginBottomSmall . ' auto !important;}}#site.light{margin: 5% auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} '; - $css .= $this->getData(['theme', 'site', 'width']) === '750px' - ? '.button, button{font-size:0.8em;}' - : ''; - $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}'; - $colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor'])); - $css .= '.speechBubble,.button,.button:hover,button[type=\'submit\'],.pagination a,.pagination a:hover,input[type=\'checkbox\']:checked + label:before,input[type=\'radio\']:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}'; - $css .= '.helpButton span{color:' . $colors['normal'] . '}'; - $css .= 'input[type=\'text\']:hover,input[type=\'password\']:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}'; - $css .= '.speechBubble:before{border-color:' . $colors['normal'] . ' transparent transparent transparent}'; - $css .= '.button:hover,button[type=\'submit\']:hover,.pagination a:hover,input[type=\'checkbox\']:not(:active):checked:hover + label:before,input[type=\'checkbox\']:active + label:before,input[type=\'radio\']:checked:hover + label:before,input[type=\'radio\']:not(:checked):active + label:before{background-color:' . $colors['darken'] . '}'; - $css .= '.helpButton span:hover{color:' . $colors['darken'] . '}'; - $css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}'; - $colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor'])); - $css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'title', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}'; - $css .= 'h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:' . $colors['darken'] . '}'; - // Les blocs - $colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor'])); - $css .= '.block {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) . ';}.block h4 {background-color:'. $colors['normal'] . ';color:' . $colors['text'] .';}'; - $css .= '.mce-tinymce {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) .' !important;}'; - // Bannière - $colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor'])); - if($this->getData(['theme', 'header', 'margin'])) { - if($this->getData(['theme', 'menu', 'position']) === 'site-first') { - $css .= 'header{margin:0 20px}'; - } - else { - $css .= 'header{margin:20px 20px 0 20px}'; - } - } - $css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}'; - $css .= 'header{background-color:' . $colors['normal']; - // Valeur de hauteur traditionnelle - $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ; - - $css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; - if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) { - $css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}'; - } - $colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor'])); - $css .= 'header span{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'header', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}'; - // Menu - $colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColor'])); - $css .= 'nav,nav.navMain a{background-color:' . $colors['normal'] . '}'; - $css .= 'nav a,#toggle span,nav a:hover{color:' . $this->getData(['theme', 'menu', 'textColor']) . '}'; - $css .= 'nav a:hover{background-color:' . $colors['darken'] . '}'; - $css .= 'nav a.active{color:' . $this->getData(['theme','menu','activeTextColor']) . ';}'; - if ($this->getData(['theme','menu','activeColorAuto']) === true) { - $css .= 'nav a.active{background-color:' . $colors['veryDarken'] . '}'; - } else { - $css .= 'nav a.active{background-color:' . $this->getData(['theme','menu','activeColor']) . '}'; - /*$color2 = helper::colorVariants($this->getData(['theme', 'menu', 'textColor'])); - $css .= 'nav a.active{color:' . $color2['text'] . '}';*/ - } - $css .= 'nav #burgerText{color:' . $colors['text'] . '}'; - // Sous menu - $colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColorSub'])); - $css .= 'nav .navSub a{background-color:' . $colors['normal'] . '}'; - $css .= 'nav .navMain a.active {border-radius:' . $this->getData(['theme', 'menu', 'radius']) . '}'; - $css .= '#menu{text-align:' . $this->getData(['theme', 'menu', 'textAlign']) . '}'; - if($this->getData(['theme', 'menu', 'margin'])) { - if( - $this->getData(['theme', 'menu', 'position']) === 'site-first' - OR $this->getData(['theme', 'menu', 'position']) === 'site-second' - ) { - $css .= 'nav{padding:10px 10px 0 10px;}'; - } - else { - $css .= 'nav{padding:0 10px}'; - } - } else { - $css .= 'nav{margin:0}'; - } - if( - $this->getData(['theme', 'menu', 'position']) === 'top' - ) { - $css .= 'nav{padding:0 10px;}'; - } + echo $this->output['content']; - $css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'menu', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}'; - // Pied de page + /** + * Affiche les crédits, conditions requis : + * La traduction est active et le site n'est pas en français. + * La fonction est activée. + */ + if ( $this->getData(['config', 'i18n', 'active']) === true + AND $this->getData(['config', 'i18n','scriptGoogle']) === true + AND $this->getData(['config', 'i18n','showCredits']) === true + AND + // et la traduction n'est pas manuelle + ( $this->getInput('ZWII_I18N_SCRIPT') + AND $this->getData(['config', 'i18n', $this->getInput('ZWII_I18N_SCRIPT')]) === 'script' + ) + ) + { + echo ''; + } + } - $colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor'])); - if($this->getData(['theme', 'footer', 'margin'])) { - $css .= 'footer{padding:0 20px;}'; - } else { - $css .= 'footer{padding:0}'; - } - $css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'footer', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}'; - $css .= 'footer {background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; - $css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; - $css .= 'footer #footersite > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; - $css .= 'footer #footerbody > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; - $css .= '@media (max-width: 768px) {footer #footerbody > div { padding: 2px }}'; - $css .= '#footerSocials{text-align:' . $this->getData(['theme', 'footer', 'socialsAlign']) . '}'; - $css .= '#footerText > p {text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}'; - $css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}'; - - // Enregistre la personnalisation - file_put_contents(self::DATA_DIR.'theme.css', $css); - // Effacer le cache pour tenir compte de la couleur de fond TinyMCE - header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - } - // Check la version rafraichissement du theme admin - $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR.'admin.css')); - if(empty($cssVersion[1]) OR $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) { - // Version - $css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColor'])); - $css .= '#site{background-color:' . $colors['normal']. ';}'; - $css .= '.row > div {font:' . $this->getData(['admin','fontSize']) . ' "' . $this->getData(['admin','fontText']) . '", sans-serif;}'; - $css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $this->getData(['admin','fontTitle' ]) . ', sans-serif;color:' . $this->getData(['admin','colorTitle' ]) . ';}'; - $css .= 'body:not(.editorWysiwyg),span .zwiico-help {color:' . $this->getData(['admin','colorText']) . ';}'; - $css .= 'table thead tr, table thead tr .zwiico-help{ background-color:'.$this->getData(['admin','colorText']).'; color:'.$colors['normal'].';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColorButton'])); - $css .= 'input[type="checkbox"]:checked + label::before,.speechBubble{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; - $css .= '.speechBubble::before {border-color:' . $colors['normal'] . ' transparent transparent transparent;}'; - $css .= '.button {background-color:' . $colors['normal'] . ';color:' . $colors['text'] . ';}.button:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGrey'])); - $css .= '.button.buttonGrey {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGrey:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonGrey:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonRed'])); - $css .= '.button.buttonRed {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonRed:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonRed:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonHelp'])); - $css .= '.button.buttonHelp {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonHelp:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonHelp:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGreen'])); - $css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] .';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' .$colors['text'] .';}'; - $colors = helper::colorVariants($this->getData(['admin','backgroundBlockColor'])); - $css .= '.block {border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}.block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; - $css .= 'table tr,input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}'; - // Bordure du contour TinyMCE - $css .= '.mce-tinymce{border: 1px solid '. $this->getData(['admin','borderBlockColor']) . '!important;}'; - // Enregistre la personnalisation - file_put_contents(self::DATA_DIR.'admin.css', $css); + /** + * Affiche le contenu de la barre gauche + * + */ + public function showBarContentLeft() { + // Détermine si le menu est présent + if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) === 'none') { + // Pas de menu + echo $this->output['contentLeft']; + } else { + // $mark contient 0 le menu est positionné à la fin du contenu + $contentLeft = str_replace ('[]','[MENU]',$this->output['contentLeft']); + $contentLeft = str_replace ('[menu]','[MENU]',$contentLeft); + $mark = strrpos($contentLeft,'[MENU]') !== false ? strrpos($contentLeft,'[MENU]') : strlen($contentLeft); + echo substr($contentLeft,0,$mark); + echo ''; + echo substr($contentLeft,$mark+6,strlen($contentLeft)); } } + /** - * Auto-chargement des classes - * @param string $className Nom de la classe à charger + * Affiche le contenu de la barre droite */ - public static function autoload($className) { - - $classPath = strtolower($className) . '/' . strtolower($className) . '.php'; - // Module du coeur - if(is_readable('core/module/' . $classPath)) { - require 'core/module/' . $classPath; - } - // Module - elseif(is_readable('module/' . $classPath)) { - require 'module/' . $classPath; - } - // Librairie - elseif(is_readable('core/vendor/' . $classPath)) { - require 'core/vendor/' . $classPath; + public function showBarContentRight() { + // Détermine si le menu est présent + if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) === 'none') { + // Pas de menu + echo $this->output['contentRight']; + } else { + // $mark contient 0 le menu est positionné à la fin du contenu + $contentRight = str_replace ('[]','[MENU]',$this->output['contentRight']); + $contentRight = str_replace ('[menu]','[MENU]',$contentRight); + $mark = strrpos($contentRight,'[MENU]') !== false ? strrpos($contentRight,'[MENU]') : strlen($contentRight); + echo substr($contentRight,0,$mark); + echo ''; + echo substr($contentRight,$mark+6,strlen($contentRight)); } } /** - * Routage des modules + * Affiche le texte du footer */ - public function router() { - // Installation - if( - $this->getData(['user']) === [] - AND $this->getUrl(0) !== 'install' - ) { - http_response_code(302); - header('Location:' . helper::baseUrl() . 'install'); - exit(); + public function showFooterText() { + if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { + echo '
' . $footerText . '
'; } - // Journalisation - $dataLog = mb_detect_encoding(strftime('%d/%m/%y',time()), 'UTF-8', true) - ? strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';' - : utf8_encode(strftime('%d/%m/%y',time())) . ';' . utf8_encode(strftime('%R',time())) . ';' ; - $dataLog .= helper::getIp() . ';'; - $dataLog .= $this->getUser('id') ? $this->getUser('id') . ';' : 'anonyme' . ';'; - $dataLog .= $this->getUrl(); - $dataLog .= PHP_EOL; - if ($this->getData(['config','connect','log'])) { - file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND); + } + + /** + * Affiche le copyright + */ + public function showCopyright() { + // Ouverture Bloc copyright + $items = '
'; + $items .= ''; + // Affichage de motorisé par + $items .= 'getData(['theme','footer','displayCopyright']) === false ? 'class="displayNone"' : ''; + $items .= '>Motorisé par '; + // Toujours afficher le nom du CMS + $items .= ''; + $items .= 'ZwiiCMS'; + $items .= ''; + // Affichage du numéro de version + $items .= 'getData(['theme','footer','displayVersion']) === false ? ' class="displayNone"' : ''; + $items .= '> '. common::ZWII_VERSION ; + $items .= ''; + // Affichage du sitemap + $items .= 'getData(['theme','footer','displaySiteMap']) === false ? ' class="displayNone"' : ''; + $items .= '> | Plan du site'; + $items .= ''; + // Affichage du module de recherche + $items .= 'getData(['theme','footer','displaySearch']) === false ? ' class="displayNone" >' : '>'; + if ($this->getData(['locale','searchPageId']) !== 'none') { + $items .= ' | Recherche'; } - // Force la déconnexion des membres bannis ou d'une seconde session - if ( - $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND ( $this->getUser('group') === self::GROUP_BANNED - OR ( $_SESSION['csrf'] !== $this->getData(['user',$this->getUser('id'),'accessCsrf']) - AND $this->getData(['config','autoDisconnect']) === true) - ) - ) { - $user = new user; - $user->logout(); + $items .= ''; + // Affichage des mentions légales + $items .= 'getData(['theme','footer','displayLegal']) === false ? ' class="displayNone" >' : '>'; + if ($this->getData(['locale','legalPageId']) !== 'none') { + $items .= ' | Mentions légales'; } - // Mode maintenance + $items .= ''; + // Affichage du lien de connexion if( - $this->getData(['config', 'maintenance']) - AND in_array($this->getUrl(0), ['maintenance', 'user']) === false - AND $this->getUrl(1) !== 'login' - AND ( - $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - OR ( - $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') < self::GROUP_ADMIN - ) - ) - ) { - // Déconnexion - $user = new user; - $user->logout(); - // Redirection - http_response_code(302); - header('Location:' . helper::baseUrl() . 'maintenance'); - exit(); + ( + $this->getData(['theme', 'footer', 'loginLink']) + AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') + ) + OR $this->getUrl(0) === 'theme' + ) { + $items .= 'getUrl(0) === 'theme' ? 'class="displayNone"' : '') . + '> | ' . template::ico('login') .''; } - // Check l'accès à la page - $access = null; - $accessInfo['userName'] = ''; - $accessInfo['pageId'] = ''; - if($this->getData(['page', $this->getUrl(0)]) !== null) { - if( - $this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR - OR ( - $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group']) - ) + // Affichage de la barre de membre simple + if ( $this->getUser('group') === self::GROUP_MEMBER + && $this->getData(['theme','footer','displayMemberBar']) === true ) { - $access = true; - } - else { - if($this->getUrl(0) === $this->getData(['locale', 'homePageId'])) { - $access = 'login'; - } - else { - $access = false; - } - } - // Empêcher l'accès aux pages désactivées par URL directe - if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true - AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - ) OR ( - $this->getData(['page', $this->getUrl(0),'disable']) === true - AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') < self::GROUP_MODERATOR - ) - ){ - $access = false; - } + $items .= 'getData(['theme','footer','displaymemberAccount']) === false ? ' class="displayNone"' : ''; + $items .= '> | ' . template::ico('user', 'all') . ''; + if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $items .= '' . template::ico('folder') . ''; + $items .= '' . template::ico('logout','left') . ''; + $items .= ''; } + // Fermeture du bloc copyright + $items .= '
'; + echo $items; + } - /** - * Contrôle si la page demandée est en édition ou accès à la gestion du site - * conditions de blocage : - * - Les deux utilisateurs qui accèdent à la même page sont différents - * - les URLS sont identiques - * - Une partie de l'URL fait partie de la liste de filtrage (édition d'un module etc..) - * - L'édition est ouverte depuis un temps dépassé, on considère que la page est restée ouverte et qu'elle ne sera pas validée - */ - foreach($this->getData(['user']) as $userId => $userIds){ - $t = explode('/',$this->getData(['user', $userId, 'accessUrl'])); - if ( $this->getUser('id') && - $userId !== $this->getUser('id') && - $this->getData(['user', $userId,'accessUrl']) === $this->getUrl() && - array_intersect($t,self::$accessList) && - array_intersect($t,self::$accessExclude) !== false && - time() < $this->getData(['user', $userId,'accessTimer']) + self::ACCESS_TIMER - ) { - $access = false; - $accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']); - $accessInfo['pageId'] = end($t); + + /** + * Affiche les réseaux sociaux + */ + public function showSocials() { + $socials = ''; + foreach($this->getData(['config', 'social']) as $socialName => $socialId) { + switch($socialName) { + case 'facebookId': + $socialUrl = 'https://www.facebook.com/'; + $title = 'Facebook'; + break; + case 'linkedinId': + $socialUrl = 'https://fr.linkedin.com/in/'; + $title = 'Linkedin'; + break; + case 'instagramId': + $socialUrl = 'https://www.instagram.com/'; + $title = 'Instagram'; + break; + case 'pinterestId': + $socialUrl = 'https://pinterest.com/'; + $title = 'Pinterest'; + break; + case 'twitterId': + $socialUrl = 'https://twitter.com/'; + $title = 'Twitter'; + break; + case 'youtubeId': + $socialUrl = 'https://www.youtube.com/channel/'; + $title = 'Chaîne YouTube'; + break; + case 'youtubeUserId': + $socialUrl = 'https://www.youtube.com/user/'; + $title = 'YouTube'; + break; + case 'githubId': + $socialUrl = 'https://www.github.com/'; + $title = 'Github'; + break; + default: + $socialUrl = ''; + } + if($socialId !== '') { + $socials .= '' . template::ico(substr(str_replace('User','',$socialName), 0, -2)) . ''; } } - // Accès concurrent stocke la page visitée - if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('id') ) { - $this->setData(['user',$this->getUser('id'),'accessUrl',$this->getUrl()]); - $this->setData(['user',$this->getUser('id'),'accessTimer',time()]); + if($socials !== '') { + echo '
' . $socials . '
'; } - // Breadcrumb - $title = $this->getData(['page', $this->getUrl(0), 'title']); - if (!empty($this->getData(['page', $this->getUrl(0), 'parentPageId'])) && - $this->getData(['page', $this->getUrl(0), 'breadCrumb'])) { - $title = '' . - ucfirst($this->getData(['page',$this->getData(['page', $this->getUrl(0), 'parentPageId']), 'title'])) . - ' › '. - $this->getData(['page', $this->getUrl(0), 'title']); + } + + + + /** + * Affiche le favicon + */ + public function showFavicon() { + // Light scheme + $favicon = $this->getData(['config', 'favicon']); + if($favicon && + file_exists(self::FILE_DIR.'source/' . $favicon) + ) { + echo ''; + } else { + echo ''; } - // Importe la page - if( - $this->getData(['page', $this->getUrl(0)]) !== null - AND $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' - AND $access + // Dark scheme + $faviconDark = $this->getData(['config', 'faviconDark']); + if(!empty($faviconDark) && + file_exists(self::FILE_DIR.'source/' . $faviconDark) ) { - $this->addOutput([ - 'title' => $title, - 'content' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])), - 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), - 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), - 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), - 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), - 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), - 'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight']) ? - file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content'])) - : '', - 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) ? - file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) - : '', - ]); + echo ''; + //echo ''; + echo ''; } - // Importe le module - else { - // Id du module, et valeurs en sortie de la page si il s'agit d'un module de page + } - if($access AND $this->getData(['page', $this->getUrl(0), 'moduleId'])) { - $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); - $this->addOutput([ - 'title' => $title, - // Meta description = 160 premiers caractères de l'article - 'metaDescription' => $this->getData(['page',$this->getUrl(0),'moduleId']) === 'blog' && !empty($this->getUrl(1)) - ? strip_tags(substr($this->getData(['module',$this->getUrl(0),'posts',$this->getUrl(1),'content']) ,0,159)) - : $this->getData(['page', $this->getUrl(0), 'metaDescription']), - 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), - 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), - 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), - 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), - 'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight']) ? - file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content'])) - : '', - 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) ? - file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) - : '', - ]); - $pageContent = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])); + /** + * Affiche le menu + */ + public function showMenu() { + // Met en forme les items du menu + $itemsLeft = ''; + $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); + foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) { + // Passer les entrées masquées + // Propriétés de l'item + $active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? 'active ' : ''; + $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; + // Mise en page de l'item + $itemsLeft .= '
  • '; + + if ( ( $this->getData(['page',$parentPageId,'disable']) === true + AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') + ) OR ( + $this->getData(['page',$parentPageId,'disable']) === true + AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND $this->getUser('group') < self::GROUP_MODERATOR + ) + ){ + $itemsLeft .= ''; + } else { + $itemsLeft .= ''; } - else { - $moduleId = $this->getUrl(0); - $pageContent = ''; - } - // Check l'existence du module - if(class_exists($moduleId)) { - /** @var common $module */ - $module = new $moduleId; - // Check l'existence de l'action - $action = ''; - $ignore = true; - foreach(explode('-', $this->getUrl(1)) as $actionPart) { - if($ignore) { - $action .= $actionPart; - $ignore = false; - } - else { - $action .= ucfirst($actionPart); - } - } - $action = array_key_exists($action, $module::$actions) ? $action : 'index'; - if(array_key_exists($action, $module::$actions)) { - $module->$action(); - $output = $module->output; - // Check le groupe de l'utilisateur - if( - ( - $module::$actions[$action] === self::GROUP_VISITOR - OR ( - $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') >= $module::$actions[$action] - ) + switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { + case '' : + $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); + break; + case 'text' : + $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); + break; + case 'icon' : + if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { + $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'title']).''; + } else { + $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); + } + break; + case 'icontitle' : + if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { + $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'title']).''; + } else { + $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); + } + break; + } + // Cas où les pages enfants enfant sont toutes masquées dans le menu + // ne pas afficher de symbole lorsqu'il n'y a rien à afficher + $totalChild = 0; + $disableChild = 0; + foreach($childrenPageIds as $childKey) { + $totalChild += 1; + } + if($childrenPageIds && $disableChild !== $totalChild && + $this->getdata(['page',$parentPageId,'hideMenuChildren']) === false) { + $itemsLeft .= template::ico('down', 'left'); + } + // ------------------------------------------------ + $itemsLeft .= ''; + if ($this->getdata(['page',$parentPageId,'hideMenuChildren']) === true || + empty($childrenPageIds)) { + continue; + } + $itemsLeft .= ''; } - - // Chargement de la bibliothèque googtrans - - // Le script de traduction est sélectionné - if ($this->getData(['config', 'i18n', 'active']) === true) { - if ( $this->getData(['config', 'i18n','scriptGoogle']) === true - // et la traduction de la langue courante est automatique - AND ( $this->getInput('ZWII_I18N_SCRIPT') !== '' - // Ou traduction automatique - OR $this->getData(['config', 'i18n','autoDetect']) === true - ) - // Cas des pages d'administration - // Pas connecté + // Lien de connexion + $itemsRight = ''; + if( + ( + $this->getData(['theme', 'menu', 'loginLink']) AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUrl(1) !== 'login' - // Ou connecté avec option active - OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getData(['config', 'i18n','admin']) === true - ) + ) + OR $this->getUrl(0) === 'theme' + ) { + $itemsRight .= '
  • '; + } + // Commandes pour les membres simples + if($this->getUser('group') == self::GROUP_MEMBER + && ( $this->getData(['theme','menu','memberBar']) === true + || $this->getData(['theme','footer','displayMemberBar']) === false + ) + ) { + if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $itemsRight .= '
  • ' . template::ico('folder') . '
  • '; + $itemsRight .= '
  • ' . template::ico('user', 'right') . '
  • '; + $itemsRight .= '
  • ' . template::ico('logout') . '
  • '; + } + // Retourne les items du menu + echo ''; + if ($this->getData(['config', 'i18n', 'active']) === true) { + echo $this->showi18n('Nav'); + } + } - ) { - // Paramètre du script - setrawcookie("googtrans", '/fr/'. $this->getInput('ZWII_I18N_SCRIPT') , time() + 3600, helper::baseUrl()); - // Chargement de la librairie - $this->addOutput([ - 'vendor' => array_merge($this->output['vendor'], ['i18n']) - ]); + /** + * Générer un menu pour la barre latérale + * Uniquement texte + * @param onlyChildren n'affiche les sous-pages de la page actuelle + */ + public function showMenuSide($onlyChildren = null) { + // Met en forme les items du menu + $items = ''; + // Nom de la page courante + $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); + // Nom de la page parente + $currentParentPageId = $this->getData(['page',$currentPageId,'parentPageId']); + // Détermine si on affiche uniquement le parent et les enfants + // Filtre contient le nom de la page parente + if ($onlyChildren === true) { + if (empty($currentParentPageId)) { + $filterCurrentPageId = $currentPageId; + } else { + $filterCurrentPageId = $currentParentPageId; } + } else { + $items .= ''; } + // Retourne les items du menu + echo $items; } -} -class layout extends common { - private $core; /** - * Constructeur du layout + * Affiche le meta titre */ - public function __construct(core $core) { - parent::__construct(); - $this->core = $core; + public function showMetaTitle() { + echo '' . $this->output['metaTitle'] . ''; + echo ''; + echo ''; } /** - * Affiche le script Google Analytics + * Affiche la meta description */ - public function showAnalytics() { - if($code = $this->getData(['config', 'analyticsId']) - AND $this->getInput('ZWII_COOKIE_CONSENT') === 'true') { - echo ' - - '; - } + public function showMetaDescription() { + echo ''; + echo ''; } /** - * Affiche le contenu - * @param Page par défaut + * Affiche le meta type */ - public function showContent() { - if ($this->getData(['config', 'i18n', 'active']) === true) { - echo $this->showi18n('Site'); - } - 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 les crédits, conditions requis : - * La traduction est active et le site n'est pas en français. - * La fonction est activée. - */ - if ( $this->getData(['config', 'i18n', 'active']) === true - AND $this->getData(['config', 'i18n','scriptGoogle']) === true - AND $this->getData(['config', 'i18n','showCredits']) === true - AND - // et la traduction n'est pas manuelle - ( $this->getInput('ZWII_I18N_SCRIPT') - AND $this->getData(['config', 'i18n', $this->getInput('ZWII_I18N_SCRIPT')]) === 'script' - ) - ) - { - echo ''; - } + public function showMetaType() { + echo ''; } - - /** - * Affiche le contenu de la barre gauche - * + * Affiche la meta image (site screenshot) */ - public function showBarContentLeft() { - // Détermine si le menu est présent - if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) === 'none') { - // Pas de menu - echo $this->core->output['contentLeft']; - } else { - // $mark contient 0 le menu est positionné à la fin du contenu - $contentLeft = str_replace ('[]','[MENU]',$this->core->output['contentLeft']); - $contentLeft = str_replace ('[menu]','[MENU]',$contentLeft); - $mark = strrpos($contentLeft,'[MENU]') !== false ? strrpos($contentLeft,'[MENU]') : strlen($contentLeft); - echo substr($contentLeft,0,$mark); - echo ''; - echo substr($contentLeft,$mark+6,strlen($contentLeft)); - } + public function showMetaImage() { + echo ''; } + + /** - * Affiche le contenu de la barre droite + * Affiche la notification */ - public function showBarContentRight() { - // Détermine si le menu est présent - if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) === 'none') { - // Pas de menu - echo $this->core->output['contentRight']; - } else { - // $mark contient 0 le menu est positionné à la fin du contenu - $contentRight = str_replace ('[]','[MENU]',$this->core->output['contentRight']); - $contentRight = str_replace ('[menu]','[MENU]',$contentRight); - $mark = strrpos($contentRight,'[MENU]') !== false ? strrpos($contentRight,'[MENU]') : strlen($contentRight); - echo substr($contentRight,0,$mark); - echo ''; - echo substr($contentRight,$mark+6,strlen($contentRight)); + public function showNotification() { + if (common::$importNotices) { + $notification = common::$importNotices [0]; + $notificationClass = 'notificationSuccess'; + } + if(common::$inputNotices) { + $notification = 'Impossible de soumettre le formulaire, car il contient des erreurs'; + $notificationClass = 'notificationError'; + } + if (common::$coreNotices) { + $notification = 'Données absentes, restauration de

    | '; + foreach (common::$coreNotices as $item) $notification .= $item . ' | '; + $notificationClass = 'notificationError'; + } + elseif(empty($_SESSION['ZWII_NOTIFICATION_SUCCESS']) === false) { + $notification = $_SESSION['ZWII_NOTIFICATION_SUCCESS']; + $notificationClass = 'notificationSuccess'; + unset($_SESSION['ZWII_NOTIFICATION_SUCCESS']); + } + elseif(empty($_SESSION['ZWII_NOTIFICATION_ERROR']) === false) { + $notification = $_SESSION['ZWII_NOTIFICATION_ERROR']; + $notificationClass = 'notificationError'; + unset($_SESSION['ZWII_NOTIFICATION_ERROR']); + } + elseif(empty($_SESSION['ZWII_NOTIFICATION_OTHER']) === false) { + $notification = $_SESSION['ZWII_NOTIFICATION_OTHER']; + $notificationClass = 'notificationOther'; + unset($_SESSION['ZWII_NOTIFICATION_OTHER']); + } + if(isset($notification) AND isset($notificationClass)) { + echo '

    ' . $notification . '' . template::ico('cancel') . '
    '; } } /** - * Affiche le texte du footer + * Affiche la barre de membre */ - public function showFooterText() { - if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { - echo '
    ' . $footerText . '
    '; - } - } - - /** - * Affiche le copyright - */ - public function showCopyright() { - // Ouverture Bloc copyright - $items = '
    '; - $items .= ''; - // Affichage de motorisé par - $items .= 'getData(['theme','footer','displayCopyright']) === false ? 'class="displayNone"' : ''; - $items .= '>Motorisé par '; - // Toujours afficher le nom du CMS - $items .= ''; - $items .= 'ZwiiCMS'; - $items .= ''; - // Affichage du numéro de version - $items .= 'getData(['theme','footer','displayVersion']) === false ? ' class="displayNone"' : ''; - $items .= '> '. common::ZWII_VERSION ; - $items .= ''; - // Affichage du sitemap - $items .= 'getData(['theme','footer','displaySiteMap']) === false ? ' class="displayNone"' : ''; - $items .= '> | Plan du site'; - $items .= ''; - // Affichage du module de recherche - $items .= 'getData(['theme','footer','displaySearch']) === false ? ' class="displayNone" >' : '>'; - if ($this->getData(['locale','searchPageId']) !== 'none') { - $items .= ' | Recherche'; - } - $items .= ''; - // Affichage des mentions légales - $items .= 'getData(['theme','footer','displayLegal']) === false ? ' class="displayNone" >' : '>'; - if ($this->getData(['locale','legalPageId']) !== 'none') { - $items .= ' | Mentions légales'; - } - $items .= ''; - // Affichage du lien de connexion - if( - ( - $this->getData(['theme', 'footer', 'loginLink']) - AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - ) - OR $this->getUrl(0) === 'theme' - ) { - $items .= 'getUrl(0) === 'theme' ? 'class="displayNone"' : '') . - '> | ' . template::ico('login') .''; - } - // Affichage de la barre de membre simple - if ( $this->getUser('group') === self::GROUP_MEMBER - && $this->getData(['theme','footer','displayMemberBar']) === true - ) { - $items .= 'getData(['theme','footer','displaymemberAccount']) === false ? ' class="displayNone"' : ''; - $items .= '> | ' . template::ico('user', 'all') . ''; - if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $items .= '' . template::ico('folder') . ''; - $items .= '' . template::ico('logout','left') . ''; - $items .= ''; + public function showBar() { + if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) { + // Items de gauche + $leftItems = ''; + if($this->getUser('group') >= self::GROUP_MODERATOR) { + $leftItems .= '
  • '; + $leftItems .= '
  • ' . template::ico('plus') . '
  • '; + if( + // Sur un module de page qui autorise le bouton de modification de la page + $this->output['showBarEditButton'] + // Sur une page sans module + OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' + // Sur une page d'accueil + OR $this->getUrl(0) === '' + ) { + $leftItems .= '
  • ' . template::ico('pencil') . '
  • '; + if ($this->getData(['page', $this->getUrl(0),'moduleId'])) { + $leftItems .= '
  • ' . template::ico('gear') . '
  • '; + } + $leftItems .= '
  • ' . template::ico('clone') . '
  • '; + $leftItems .= '
  • ' . template::ico('trash') . '
  • '; + } + } + // Items de droite + $rightItems = ''; + if($this->getUser('group') >= self::GROUP_MODERATOR) { + $rightItems .= '
  • ' . template::ico('folder') . '
  • '; + } + if($this->getUser('group') >= self::GROUP_ADMIN) { + if ($this->getData(['config', 'i18n', 'active']) === true) { + $rightItems .= '
  • ' . template::ico('flag') . '
  • '; + } + $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; + $rightItems .= '
  • ' . template::ico('brush') . '
  • '; + $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; + // Mise à jour automatique + $today = mktime(0, 0, 0); + // Une mise à jour est disponible + recherche auto activée + 1 jour de délais + if ( $this->getData(['config','autoUpdate']) === true + AND $today > $this->getData(['core','lastAutoUpdate']) + 86400 ) { + if ( helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL) ) { + $this->setData(['core','updateAvailable', true]); + $this->setData(['core','lastAutoUpdate',$today]); + } + } + // Afficher le bouton : Mise à jour détectée + activée + if ( $this->getData(['core','updateAvailable']) === true && + $this->getData(['config','autoUpdate']) === true ) { + $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; + } + $rightItems .= '
  • ' . template::ico('users') . '
  • '; + } + $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; + $rightItems .= '
  • ' . template::ico('logout') . '
  • '; + // Barre de membre + echo '
      ' . $leftItems . '
      ' . $rightItems . '
    '; } - // Fermeture du bloc copyright - $items .= '
    '; - echo $items; } - /** - * Affiche les réseaux sociaux + * Affiche le script */ - public function showSocials() { - $socials = ''; - foreach($this->getData(['config', 'social']) as $socialName => $socialId) { - switch($socialName) { - case 'facebookId': - $socialUrl = 'https://www.facebook.com/'; - $title = 'Facebook'; - break; - case 'linkedinId': - $socialUrl = 'https://fr.linkedin.com/in/'; - $title = 'Linkedin'; - break; - case 'instagramId': - $socialUrl = 'https://www.instagram.com/'; - $title = 'Instagram'; - break; - case 'pinterestId': - $socialUrl = 'https://pinterest.com/'; - $title = 'Pinterest'; - break; - case 'twitterId': - $socialUrl = 'https://twitter.com/'; - $title = 'Twitter'; - break; - case 'youtubeId': - $socialUrl = 'https://www.youtube.com/channel/'; - $title = 'Chaîne YouTube'; - break; - case 'youtubeUserId': - $socialUrl = 'https://www.youtube.com/user/'; - $title = 'YouTube'; - break; - case 'githubId': - $socialUrl = 'https://www.github.com/'; - $title = 'Github'; - break; - default: - $socialUrl = ''; - } - if($socialId !== '') { - $socials .= '' . template::ico(substr(str_replace('User','',$socialName), 0, -2)) . ''; - } - } - if($socials !== '') { - echo '
    ' . $socials . '
    '; - } + public function showScript() { + ob_start(); + require 'core/core.js.php'; + $coreScript = ob_get_clean(); + echo ''; } - - /** - * Affiche le favicon + * Affiche le style */ - public function showFavicon() { - // Light scheme - $favicon = $this->getData(['config', 'favicon']); - if($favicon && - file_exists(self::FILE_DIR.'source/' . $favicon) - ) { - echo ''; - } else { - echo ''; - } - // Dark scheme - $faviconDark = $this->getData(['config', 'faviconDark']); - if(!empty($faviconDark) && - file_exists(self::FILE_DIR.'source/' . $faviconDark) - ) { - echo ''; - //echo ''; - echo ''; + public function showStyle() { + if($this->output['style']) { + echo ''; + if (strpos($this->output['style'], 'admin.css') >= 1 ) { + echo ''; + } + echo ''; } } - /** - * Affiche le menu + * Affiche l'import des librairies */ - public function showMenu() { - // Met en forme les items du menu - $itemsLeft = ''; - $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); - foreach($this->getHierarchy() as $parentPageId => $childrenPageIds) { - // Passer les entrées masquées - // Propriétés de l'item - $active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? 'active ' : ''; - $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; - // Mise en page de l'item - $itemsLeft .= '
  • '; - - if ( ( $this->getData(['page',$parentPageId,'disable']) === true - AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - ) OR ( - $this->getData(['page',$parentPageId,'disable']) === true - AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') < self::GROUP_MODERATOR - ) - ){ - $itemsLeft .= ''; - } else { - $itemsLeft .= ''; - } - - switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { - case '' : - $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); - break; - case 'text' : - $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); - break; - case 'icon' : - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'title']).''; - } else { - $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); - } - break; - case 'icontitle' : - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'title']).''; - } else { - $itemsLeft .= $this->getData(['page', $parentPageId, 'title']); - } - break; - } - // Cas où les pages enfants enfant sont toutes masquées dans le menu - // ne pas afficher de symbole lorsqu'il n'y a rien à afficher - $totalChild = 0; - $disableChild = 0; - foreach($childrenPageIds as $childKey) { - $totalChild += 1; + public function showVendor() { + // Variables partagées + $vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';'; + $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; + if( + $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND $this->getUser('group') >= self::GROUP_MODERATOR + ) { + $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';'; + } + echo ''; + // Librairies + $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); + foreach($this->output['vendor'] as $vendorName) { + // Coeur + if(file_exists('core/vendor/' . $vendorName . '/inc.json')) { + $vendorPath = 'core/vendor/' . $vendorName . '/'; } - if($childrenPageIds && $disableChild !== $totalChild && - $this->getdata(['page',$parentPageId,'hideMenuChildren']) === false) { - $itemsLeft .= template::ico('down', 'left'); + // Module + elseif( + $moduleId + AND in_array($moduleId, self::$coreModuleIds) === false + AND file_exists('module/' . $moduleId . '/vendor/' . $vendorName . '/inc.json') + ) { + $vendorPath = 'module/' . $moduleId . '/vendor/' . $vendorName . '/'; } - // ------------------------------------------------ - $itemsLeft .= ''; - if ($this->getdata(['page',$parentPageId,'hideMenuChildren']) === true || - empty($childrenPageIds)) { + // Sinon continue + else { continue; } - $itemsLeft .= ''; - } - // Lien de connexion - $itemsRight = ''; - if( - ( - $this->getData(['theme', 'menu', 'loginLink']) - AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - ) - OR $this->getUrl(0) === 'theme' - ) { - $itemsRight .= '
  • '; } - // Commandes pour les membres simples - if($this->getUser('group') == self::GROUP_MEMBER - && ( $this->getData(['theme','menu','memberBar']) === true - || $this->getData(['theme','footer','displayMemberBar']) === false + } + /** + * Affiche le cadre avec les drapeaux sélectionnés + */ + public function showi18n($id) { + echo '
    '; } +} + +class core extends common { /** - * Générer un menu pour la barre latérale - * Uniquement texte - * @param onlyChildren n'affiche les sous-pages de la page actuelle + * Constructeur du coeur */ - public function showMenuSide($onlyChildren = null) { - // Met en forme les items du menu - $items = ''; - // Nom de la page courante - $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); - // Nom de la page parente - $currentParentPageId = $this->getData(['page',$currentPageId,'parentPageId']); - // Détermine si on affiche uniquement le parent et les enfants - // Filtre contient le nom de la page parente - - if ($onlyChildren === true) { - if (empty($currentParentPageId)) { - $filterCurrentPageId = $currentPageId; - } else { - $filterCurrentPageId = $currentParentPageId; - } - } else { - $items .= ''; + // Crée le fichier de personnalisation avancée + if(file_exists(self::DATA_DIR.'custom.css') === false) { + file_put_contents(self::DATA_DIR.'custom.css', file_get_contents('core/module/theme/resource/custom.css')); + chmod(self::DATA_DIR.'custom.css', 0755); } - // Retourne les items du menu - echo $items; - } - - + // Crée le fichier de personnalisation + if(file_exists(self::DATA_DIR.'theme.css') === false) { + file_put_contents(self::DATA_DIR.'theme.css', ''); + chmod(self::DATA_DIR.'theme.css', 0755); + } + // Crée le fichier de personnalisation de l'administration + if(file_exists(self::DATA_DIR.'admin.css') === false) { + file_put_contents(self::DATA_DIR.'admin.css', ''); + chmod(self::DATA_DIR.'admin.css', 0755); + } + // Check la version rafraichissement du theme + $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR.'theme.css')); + if(empty($cssVersion[1]) OR $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) { + // Version + $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; + // Import des polices de caractères + $css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");'; + // Fond du body + $colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor'])); + // Body + $css .= 'body{font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; + if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) { + // Image dans html pour éviter les déformations. + $css .= 'html, .mce-menu.mce-in.mce-animate {background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; + // Couleur du body transparente + $css .= 'body, .mce-menu.mce-in.mce-animate{background-color: rgba(0,0,0,0)}'; + } else { + // Pas d'image couleur du body + $css .= 'html, .mce-menu.mce-in.mce-animate{background-color:' . $colors['normal'] . ';}'; + // Même couleur dans le fond de l'éditeur + $css .= 'div.mce-edit-area {background-color:' . $colors['normal'] . ' !important}'; + } + // Icône BacktoTop + $css .= '#backToTop {background-color:' .$this->getData(['theme', 'body', 'toTopbackgroundColor']). ';color:'.$this->getData(['theme', 'body', 'toTopColor']).';}'; + // Site + $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor'])); + $css .= 'a{color:' . $colors['normal'] . '}'; + // Couleurs de site dans TinyMCe + $css .= 'div.mce-edit-area {font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; + // Site dans TinyMCE + $css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}'; + //$css .= 'a:hover:not(.inputFile, button){color:' . $colors['darken'] . '}'; + $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; + $css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; + $css .= 'select,input[type=\'password\'],input[type=\'email\'],input[type=\'text\'],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) .';background-color:'.$this->getData(['theme', 'site', 'backgroundColor']).';}'; + // spécifiques au module de blog + $css .= '.blogDate {color:' . $this->getData(['theme', 'text', 'textColor']) . ';}.blogPicture img{border:1px solid ' . $this->getData(['theme', 'text', 'textColor']) . '; box-shadow: 1px 1px 5px ' . $this->getData(['theme', 'text', 'textColor']) . ';}'; + // Couleur fixée dans admin.css + //$css .= '.button.buttonGrey,.button.buttonGrey:hover{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; + $css .= '.container, .helpDisplayContent{max-width:' . $this->getData(['theme', 'site', 'width']) . '}'; + $margin = $this->getData(['theme', 'site', 'margin']) ? '0' : '20px'; + // Marge supplémentaire lorsque le pied de page est fixe + if ( $this->getData(['theme', 'footer', 'fixed']) === true && + $this->getData(['theme', 'footer', 'position']) === 'body') { + //$css .= '@media (min-width: 769px) { #site {margin-bottom: ' . ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 31 ) . 'px}}'; + //$css .= '@media (max-width: 768px) { #site {margin-bottom: ' . ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 93 ) . 'px}}'; + $marginBottomLarge = ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 31 ) . 'px'; + $marginBottomSmall = ((str_replace ('px', '', $this->getData(['theme', 'footer', 'height']) ) * 2 ) + 93 ) . 'px'; + } else { + $marginBottomSmall = $margin; + $marginBottomLarge = $margin; + } + $css .= $this->getData(['theme', 'site', 'width']) === '100%' + ? '@media (min-width: 769px) {#site{margin:0 auto ' . $marginBottomLarge . ' 0 !important;}}@media (max-width: 768px) {#site{margin:0 auto ' . $marginBottomSmall . ' 0 !important;}}#site.light{margin:5% auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}' + : '@media (min-width: 769px) {#site{margin: ' . $margin . ' auto ' . $marginBottomLarge . ' auto !important;}}@media (max-width: 768px) {#site{margin: ' . $margin . ' auto ' . $marginBottomSmall . ' auto !important;}}#site.light{margin: 5% auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} '; + $css .= $this->getData(['theme', 'site', 'width']) === '750px' + ? '.button, button{font-size:0.8em;}' + : ''; + $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}'; + $colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor'])); + $css .= '.speechBubble,.button,.button:hover,button[type=\'submit\'],.pagination a,.pagination a:hover,input[type=\'checkbox\']:checked + label:before,input[type=\'radio\']:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}'; + $css .= '.helpButton span{color:' . $colors['normal'] . '}'; + $css .= 'input[type=\'text\']:hover,input[type=\'password\']:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}'; + $css .= '.speechBubble:before{border-color:' . $colors['normal'] . ' transparent transparent transparent}'; + $css .= '.button:hover,button[type=\'submit\']:hover,.pagination a:hover,input[type=\'checkbox\']:not(:active):checked:hover + label:before,input[type=\'checkbox\']:active + label:before,input[type=\'radio\']:checked:hover + label:before,input[type=\'radio\']:not(:checked):active + label:before{background-color:' . $colors['darken'] . '}'; + $css .= '.helpButton span:hover{color:' . $colors['darken'] . '}'; + $css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}'; + $colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor'])); + $css .= 'h1,h2,h3,h4,h5,h6,h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'title', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}'; + $css .= 'h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover{color:' . $colors['darken'] . '}'; + // Les blocs + $colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor'])); + $css .= '.block {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) . ';}.block h4 {background-color:'. $colors['normal'] . ';color:' . $colors['text'] .';}'; + $css .= '.mce-tinymce {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) .' !important;}'; + // Bannière + $colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor'])); + if($this->getData(['theme', 'header', 'margin'])) { + if($this->getData(['theme', 'menu', 'position']) === 'site-first') { + $css .= 'header{margin:0 20px}'; + } + else { + $css .= 'header{margin:20px 20px 0 20px}'; + } + } + $css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}'; + $css .= 'header{background-color:' . $colors['normal']; - /** - * Affiche le meta titre - */ - public function showMetaTitle() { - echo '' . $this->core->output['metaTitle'] . ''; - echo ''; - echo ''; - } + // Valeur de hauteur traditionnelle + $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ; - /** - * Affiche la meta description - */ - public function showMetaDescription() { - echo ''; - echo ''; - } + $css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; + if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) { + $css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}'; + } + $colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor'])); + $css .= 'header span{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'header', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}'; + // Menu + $colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColor'])); + $css .= 'nav,nav.navMain a{background-color:' . $colors['normal'] . '}'; + $css .= 'nav a,#toggle span,nav a:hover{color:' . $this->getData(['theme', 'menu', 'textColor']) . '}'; + $css .= 'nav a:hover{background-color:' . $colors['darken'] . '}'; + $css .= 'nav a.active{color:' . $this->getData(['theme','menu','activeTextColor']) . ';}'; + if ($this->getData(['theme','menu','activeColorAuto']) === true) { + $css .= 'nav a.active{background-color:' . $colors['veryDarken'] . '}'; + } else { + $css .= 'nav a.active{background-color:' . $this->getData(['theme','menu','activeColor']) . '}'; + /*$color2 = helper::colorVariants($this->getData(['theme', 'menu', 'textColor'])); + $css .= 'nav a.active{color:' . $color2['text'] . '}';*/ + } + $css .= 'nav #burgerText{color:' . $colors['text'] . '}'; + // Sous menu + $colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColorSub'])); + $css .= 'nav .navSub a{background-color:' . $colors['normal'] . '}'; + $css .= 'nav .navMain a.active {border-radius:' . $this->getData(['theme', 'menu', 'radius']) . '}'; + $css .= '#menu{text-align:' . $this->getData(['theme', 'menu', 'textAlign']) . '}'; + if($this->getData(['theme', 'menu', 'margin'])) { + if( + $this->getData(['theme', 'menu', 'position']) === 'site-first' + OR $this->getData(['theme', 'menu', 'position']) === 'site-second' + ) { + $css .= 'nav{padding:10px 10px 0 10px;}'; + } + else { + $css .= 'nav{padding:0 10px}'; + } + } else { + $css .= 'nav{margin:0}'; + } + if( + $this->getData(['theme', 'menu', 'position']) === 'top' + ) { + $css .= 'nav{padding:0 10px;}'; + } - /** - * Affiche le meta type - */ - public function showMetaType() { - echo ''; - } + $css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) .';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'menu', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}'; + // Pied de page - /** - * Affiche la meta image (site screenshot) - */ - public function showMetaImage() { - echo ''; - } + $colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor'])); + if($this->getData(['theme', 'footer', 'margin'])) { + $css .= 'footer{padding:0 20px;}'; + } else { + $css .= 'footer{padding:0}'; + } + $css .= 'footer span, #footerText > p {color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'footer', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}'; + $css .= 'footer {background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; + $css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; + $css .= 'footer #footersite > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; + $css .= 'footer #footerbody > div {margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; + $css .= '@media (max-width: 768px) {footer #footerbody > div { padding: 2px }}'; + $css .= '#footerSocials{text-align:' . $this->getData(['theme', 'footer', 'socialsAlign']) . '}'; + $css .= '#footerText > p {text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}'; + $css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}'; - /** - * Affiche la notification - */ - public function showNotification() { - if (common::$importNotices) { - $notification = common::$importNotices [0]; - $notificationClass = 'notificationSuccess'; - } - if(common::$inputNotices) { - $notification = 'Impossible de soumettre le formulaire, car il contient des erreurs'; - $notificationClass = 'notificationError'; - } - if (common::$coreNotices) { - $notification = 'Données absentes, restauration de

    | '; - foreach (common::$coreNotices as $item) $notification .= $item . ' | '; - $notificationClass = 'notificationError'; + // Enregistre la personnalisation + file_put_contents(self::DATA_DIR.'theme.css', $css); + // Effacer le cache pour tenir compte de la couleur de fond TinyMCE + header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); } - elseif(empty($_SESSION['ZWII_NOTIFICATION_SUCCESS']) === false) { - $notification = $_SESSION['ZWII_NOTIFICATION_SUCCESS']; - $notificationClass = 'notificationSuccess'; - unset($_SESSION['ZWII_NOTIFICATION_SUCCESS']); + // Check la version rafraichissement du theme admin + $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR.'admin.css')); + if(empty($cssVersion[1]) OR $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) { + // Version + $css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColor'])); + $css .= '#site{background-color:' . $colors['normal']. ';}'; + $css .= '.row > div {font:' . $this->getData(['admin','fontSize']) . ' "' . $this->getData(['admin','fontText']) . '", sans-serif;}'; + $css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $this->getData(['admin','fontTitle' ]) . ', sans-serif;color:' . $this->getData(['admin','colorTitle' ]) . ';}'; + $css .= 'body:not(.editorWysiwyg),span .zwiico-help {color:' . $this->getData(['admin','colorText']) . ';}'; + $css .= 'table thead tr, table thead tr .zwiico-help{ background-color:'.$this->getData(['admin','colorText']).'; color:'.$colors['normal'].';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColorButton'])); + $css .= 'input[type="checkbox"]:checked + label::before,.speechBubble{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; + $css .= '.speechBubble::before {border-color:' . $colors['normal'] . ' transparent transparent transparent;}'; + $css .= '.button {background-color:' . $colors['normal'] . ';color:' . $colors['text'] . ';}.button:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGrey'])); + $css .= '.button.buttonGrey {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGrey:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonGrey:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonRed'])); + $css .= '.button.buttonRed {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonRed:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonRed:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonHelp'])); + $css .= '.button.buttonHelp {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonHelp:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonHelp:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGreen'])); + $css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] .';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' .$colors['text'] .';}'; + $colors = helper::colorVariants($this->getData(['admin','backgroundBlockColor'])); + $css .= '.block {border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}.block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; + $css .= 'table tr,input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}'; + // Bordure du contour TinyMCE + $css .= '.mce-tinymce{border: 1px solid '. $this->getData(['admin','borderBlockColor']) . '!important;}'; + // Enregistre la personnalisation + file_put_contents(self::DATA_DIR.'admin.css', $css); } - elseif(empty($_SESSION['ZWII_NOTIFICATION_ERROR']) === false) { - $notification = $_SESSION['ZWII_NOTIFICATION_ERROR']; - $notificationClass = 'notificationError'; - unset($_SESSION['ZWII_NOTIFICATION_ERROR']); + } + /** + * Auto-chargement des classes + * @param string $className Nom de la classe à charger + */ + public static function autoload($className) { + + $classPath = strtolower($className) . '/' . strtolower($className) . '.php'; + // Module du coeur + if(is_readable('core/module/' . $classPath)) { + require 'core/module/' . $classPath; } - elseif(empty($_SESSION['ZWII_NOTIFICATION_OTHER']) === false) { - $notification = $_SESSION['ZWII_NOTIFICATION_OTHER']; - $notificationClass = 'notificationOther'; - unset($_SESSION['ZWII_NOTIFICATION_OTHER']); + // Module + elseif(is_readable('module/' . $classPath)) { + require 'module/' . $classPath; } - if(isset($notification) AND isset($notificationClass)) { - echo '

    ' . $notification . '' . template::ico('cancel') . '
    '; + // Librairie + elseif(is_readable('core/vendor/' . $classPath)) { + require 'core/vendor/' . $classPath; } + } /** - * Affiche la barre de membre + * Routage des modules */ - public function showBar() { - if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) { - // Items de gauche - $leftItems = ''; - if($this->getUser('group') >= self::GROUP_MODERATOR) { - $leftItems .= '
  • '; - $leftItems .= '
  • ' . template::ico('plus') . '
  • '; - if( - // Sur un module de page qui autorise le bouton de modification de la page - $this->core->output['showBarEditButton'] - // Sur une page sans module - OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' - // Sur une page d'accueil - OR $this->getUrl(0) === '' - ) { - $leftItems .= '
  • ' . template::ico('pencil') . '
  • '; - if ($this->getData(['page', $this->getUrl(0),'moduleId'])) { - $leftItems .= '
  • ' . template::ico('gear') . '
  • '; + // Erreur 403 + else { + $access = false; } - $leftItems .= '
  • ' . template::ico('clone') . '
  • '; - $leftItems .= '
  • ' . template::ico('trash') . '
  • '; - } - } - // Items de droite - $rightItems = ''; - if($this->getUser('group') >= self::GROUP_MODERATOR) { - $rightItems .= '
  • ' . template::ico('folder') . '
  • '; - } - if($this->getUser('group') >= self::GROUP_ADMIN) { - if ($this->getData(['config', 'i18n', 'active']) === true) { - $rightItems .= '
  • ' . template::ico('flag') . '
  • '; - } - $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; - $rightItems .= '
  • ' . template::ico('brush') . '
  • '; - $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; - // Mise à jour automatique - $today = mktime(0, 0, 0); - // Une mise à jour est disponible + recherche auto activée + 1 jour de délais - if ( $this->getData(['config','autoUpdate']) === true - AND $today > $this->getData(['core','lastAutoUpdate']) + 86400 ) { - if ( helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL) ) { - $this->setData(['core','updateAvailable', true]); - $this->setData(['core','lastAutoUpdate',$today]); - } - } - // Afficher le bouton : Mise à jour détectée + activée - if ( $this->getData(['core','updateAvailable']) === true && - $this->getData(['config','autoUpdate']) === true ) { - $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } - $rightItems .= '
  • ' . template::ico('users') . '
  • '; } - $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; - $rightItems .= '
  • ' . template::ico('logout') . '
  • '; - // Barre de membre - echo '
      ' . $leftItems . '
      ' . $rightItems . '
    '; } - } - /** - * Affiche le script - */ - public function showScript() { - ob_start(); - require 'core/core.js.php'; - $coreScript = ob_get_clean(); - echo ''; - } + // Chargement de la bibliothèque googtrans + + // Le script de traduction est sélectionné + if ($this->getData(['config', 'i18n', 'active']) === true) { + if ( $this->getData(['config', 'i18n','scriptGoogle']) === true + // et la traduction de la langue courante est automatique + AND ( $this->getInput('ZWII_I18N_SCRIPT') !== '' + // Ou traduction automatique + OR $this->getData(['config', 'i18n','autoDetect']) === true + ) + // Cas des pages d'administration + // Pas connecté + AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') + AND $this->getUrl(1) !== 'login' + // Ou connecté avec option active + OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND $this->getData(['config', 'i18n','admin']) === true + ) + + ) { + // Paramètre du script + setrawcookie("googtrans", '/fr/'. $this->getInput('ZWII_I18N_SCRIPT') , time() + 3600, helper::baseUrl()); + // Chargement de la librairie + $this->addOutput([ + 'vendor' => array_merge($this->output['vendor'], ['i18n']) + ]); - /** - * Affiche le style - */ - public function showStyle() { - if($this->core->output['style']) { - echo ''; - if (strpos($this->core->output['style'], 'admin.css') >= 1 ) { - echo ''; } - echo ''; } - } - - /** - * Affiche l'import des librairies - */ - public function showVendor() { - // Variables partagées - $vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';'; - $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; - if( - $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getUser('group') >= self::GROUP_MODERATOR - ) { - $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';'; + // Erreurs + if($access === 'login') { + http_response_code(302); + header('Location:' . helper::baseUrl() . 'user/login/'); + exit(); } - echo ''; - // Librairies - $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); - foreach($this->core->output['vendor'] as $vendorName) { - // Coeur - if(file_exists('core/vendor/' . $vendorName . '/inc.json')) { - $vendorPath = 'core/vendor/' . $vendorName . '/'; + if($access === false) { + http_response_code(403); + if ($accessInfo['userName']) { + $this->addOutput([ + 'title' => 'Accès verrouillé', + 'content' => template::speech('La page ' . $accessInfo['pageId'] . ' est ouverte par l\'utilisateur ' . $accessInfo['userName'] . '') + ]); + } else { + if ( $this->getData(['locale','page403']) !== 'none' + AND $this->getData(['page',$this->getData(['locale','page403'])])) + { + header('Location:' . helper::baseUrl() . $this->getData(['locale','page403'])); + } else { + $this->addOutput([ + 'title' => 'Accès interdit', + 'content' => template::speech('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)') + ]); + } } - // Module - elseif( - $moduleId - AND in_array($moduleId, self::$coreModuleIds) === false - AND file_exists('module/' . $moduleId . '/vendor/' . $vendorName . '/inc.json') - ) { - $vendorPath = 'module/' . $moduleId . '/vendor/' . $vendorName . '/'; + } elseif ($this->output['content'] === '') { + http_response_code(404); + if ( $this->getData(['locale','page404']) !== 'none' + AND $this->getData(['page',$this->getData(['locale','page404'])])) + { + header('Location:' . helper::baseUrl() . $this->getData(['locale','page404'])); + } else { + $this->addOutput([ + 'title' => 'Page indisponible', + 'content' => template::speech('Oups ! La page demandée n\'existe pas ou est introuvable (erreur 404)') + ]); } - // Sinon continue - else { - continue; + } + // Mise en forme des métas + if($this->output['metaTitle'] === '') { + if($this->output['title']) { + $this->addOutput([ + 'metaTitle' => strip_tags($this->output['title']) . ' - ' . $this->getData(['locale', 'title']) + ]); } - // Détermine le type d'import en fonction de l'extension de la librairie - $vendorFiles = json_decode(file_get_contents($vendorPath . 'inc.json')); - foreach($vendorFiles as $vendorFile) { - switch(pathinfo($vendorFile, PATHINFO_EXTENSION)) { - case 'css': - // Force le rechargement lors d'une mise à jour du jeu d'icônes - $reload = $vendorPath === 'core/vendor/zwiico/' - ? '?' . md5_file('core/vendor/zwiico/css/zwiico-codes.css') - : ''; - echo ''; - break; - case 'js': - echo ''; - break; - } + else { + $this->addOutput([ + 'metaTitle' => $this->getData(['locale', 'title']) + ]); } } - } - /** - * Affiche le cadre avec les drapeaux sélectionnés - */ - public function showi18n($id) { - echo '
    '; } } diff --git a/core/layout/blank.php b/core/layout/blank.php index ae92b811..ed8baa32 100644 --- a/core/layout/blank.php +++ b/core/layout/blank.php @@ -1,23 +1,22 @@ - + - showMetaTitle(); ?> - showMetaDescription(); ?> - showMetaType(); ?> - showMetaImage(); ?> - showFavicon(); ?> - showVendor(); ?> - showStyle(); ?> + showMetaTitle(); ?> + showMetaDescription(); ?> + showMetaType(); ?> + showMetaImage(); ?> + showFavicon(); ?> + showVendor(); ?> + showStyle(); ?> -showContent(); ?> -showScript(); ?> +showContent(); ?> +showScript(); ?> \ No newline at end of file diff --git a/core/layout/light.php b/core/layout/light.php index a781f64e..82ae54fd 100644 --- a/core/layout/light.php +++ b/core/layout/light.php @@ -1,27 +1,26 @@ - + - showMetaTitle(); ?> - showMetaDescription(); ?> - showMetaType(); ?> - showMetaImage(); ?> - showFavicon(); ?> - showVendor(); ?> - showStyle(); ?> + showMetaTitle(); ?> + showMetaDescription(); ?> + showMetaType(); ?> + showMetaImage(); ?> + showFavicon(); ?> + showVendor(); ?> + showStyle(); ?> -showNotification(); ?> +showNotification(); ?>
    -
    showContent(); ?>
    +
    showContent(); ?>
    -showScript(); ?> +showScript(); ?> \ No newline at end of file diff --git a/core/layout/main.php b/core/layout/main.php index 6e10f387..c046975c 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -1,16 +1,16 @@ - + - + - showMetaTitle(); ?> - showMetaDescription(); ?> - showMetaType(); ?> - showMetaImage(); ?> - showFavicon(); ?> - showVendor(); ?> - showAnalytics(); ?> + showMetaTitle(); ?> + showMetaDescription(); ?> + showMetaType(); ?> + showMetaImage(); ?> + showFavicon(); ?> + showVendor(); ?> + showAnalytics(); ?> @@ -20,16 +20,16 @@ AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?> - showStyle(); ?> + showStyle(); ?> getUser('group') > self::GROUP_MEMBER): ?> - showBar(); ?> + showBar(); ?> - showNotification(); ?> + showNotification(); ?> getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?> @@ -52,14 +52,14 @@ getData(['theme', 'header', 'position']) === 'body'): ?>
    - showi18n();?> + showi18n();?> getData(['theme','header','linkHomePage'])){ echo "" ;} ?> @@ -88,7 +88,7 @@
    getData(['locale','title']);?>
    - + @@ -101,7 +101,7 @@
    getData(['locale','title']);?>
    - + getData(['locale','title']);?> - +
    - showi18n();?> + showi18n();?> getUrl(1),$pattern) ) ) { // Pleine page en mode configuration - $layout->showContent(); + $this->showContent(); if (file_exists(self::DATA_DIR . 'body.inc.html')) { include( self::DATA_DIR . 'body.inc.html'); } @@ -192,10 +192,10 @@
    -
    +
    - showContent(); + showContent(); if (file_exists(self::DATA_DIR . 'body.inc.html')) { include(self::DATA_DIR . 'body.inc.html'); } @@ -203,7 +203,7 @@
    -
    +
    - getData(['theme', 'footer', 'textPosition']) === 'left') { $layout->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $layout->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$layout->showCopyright(); } + getData(['theme', 'footer', 'textPosition']) === 'left') { $this->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $this->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$this->showCopyright(); } ?>
    - getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); } + getData(['theme', 'footer', 'textPosition']) === 'center') { $this->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $this->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $this->showCopyright(); } ?>
    - getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); } + getData(['theme', 'footer', 'textPosition']) === 'right') { $this->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $this->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $this->showCopyright(); } ?>
    @@ -287,6 +287,6 @@ } ?>
    - showScript();?> + showScript();?>