From 5be3d0b1a7bb259e3da5fe3fc333e463d22a8d6d Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 7 Jun 2024 09:32:52 +0200 Subject: [PATCH] =?UTF-8?q?Layout=20d'=C3=A9dition=20:=20supprime=20tous?= =?UTF-8?q?=20les=20boutons=20de=20gestion=20de=20page=20comme=20pour=20le?= =?UTF-8?q?s=20pages=20avec=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/layout.class.php | 83 ++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 6c0f9b6..6d31836 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -1016,46 +1016,53 @@ class layout extends common ) // Sur une page d'accueil or $this->getUrl(0) === '' - ) { - // Bouton Editer une page - if ($this->getUser('permission', 'page', 'edit') and $this->geturl(1) !== 'edit') { - $leftItems .= '
  • ' . template::ico('pencil', [ - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Éditer la page' - ]) . '
  • '; - } - // Bouton Editer le module d'une page - if ( - $this->getUser('permission', 'page', 'module') - && $this->getData(['page', $this->getUrl(0), 'moduleId']) ) { - $leftItems .= '
  • ' . template::ico('gear', [ - 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'help' => 'Module de la page' - ]) . '
  • '; + // Bouton Editer une page + if ( + $this->getUser('permission', 'page', 'edit') + and $this->geturl(1) !== 'edit' + ) { + $leftItems .= '
  • ' . template::ico('pencil', [ + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Éditer la page' + ]) . '
  • '; + } + // Bouton Editer le module d'une page + if ( + $this->getUser('permission', 'page', 'module') + and $this->geturl(1) !== 'edit' + and $this->getData(['page', $this->getUrl(0), 'moduleId']) + ) { + $leftItems .= '
  • ' . template::ico('gear', [ + 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'help' => 'Module de la page' + ]) . '
  • '; + } + // Bouton dupliquer une page + if ( + $this->getUser('permission', 'page', 'duplicate') + and $this->geturl(1) !== 'edit' + ) { + $leftItems .= '
  • ' . template::ico('clone', [ + 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Dupliquer la page' + ]) + . '
  • '; + } + // Bouton Effacer une page + if ( + $this->getUser('permission', 'page', 'delete') + and $this->geturl(1) !== 'edit' + + ) { + $leftItems .= '
  • ' . template::ico('trash', [ + 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent, + 'help' => 'Supprimer la page', + 'id' => 'pageDelete' + ]) + . '
  • '; + } } - // Bouton dupliquer une page - if ( - $this->getUser('permission', 'page', 'duplicate') - ) { - $leftItems .= '
  • ' . template::ico('clone', [ - 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Dupliquer la page' - ]) - . '
  • '; - } - // Bouton Effacer une page - if ( - $this->getUser('permission', 'page', 'delete') - ) { - $leftItems .= '
  • ' . template::ico('trash', [ - 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent, - 'help' => 'Supprimer la page', - 'id' => 'pageDelete' - ]) - . '
  • '; - } - } } // Items de droite $rightItems = '';