diff --git a/core/class/template.class.php b/core/class/template.class.php
index d18b2d62..f2784a55 100644
--- a/core/class/template.class.php
+++ b/core/class/template.class.php
@@ -417,10 +417,14 @@ class template {
/**
* Crée un icône
+ * @Array :
* @param string $ico Classe de l'icône
* @param string $margin Ajoute un margin autour de l'icône (choix : left, right, all)
* @param bool $animate Ajoute une animation à l'icône
* @param string $fontSize Taille de la police
+ * @param string $href lien vers une url
+ * @param string $help popup d'aide
+ * @param string $id de l'élement
* @return string
*/
// public static function ico($ico, $margin = '', $animate = false, $fontSize = '1em') {
@@ -428,10 +432,17 @@ class template {
// Attributs par défaut
$attributes = array_merge([
'margin' => '',
- 'animate' => false,
- 'fontSize' => '1em'
+ 'animate' => false,
+ 'fontSize' => '1em',
+ 'href' => '',
+ 'attr' => '',
+ 'help' => '',
+ 'id' => ''
], $attributes);
- return '';
+ $item = $attributes['href'] ? '' : '';
+ $item .= '';
+ $item .= ($attributes['href']) ? '' : '';
+ return $item;
}
/**
diff --git a/core/core.php b/core/core.php
index 7cd68115..f3a219b3 100644
--- a/core/core.php
+++ b/core/core.php
@@ -1520,21 +1520,43 @@ class common {
)
OR $this->getUrl(0) === 'theme'
) {
- $items .= '';
+ $items .= '';
}
// Affichage de la barre de membre simple
if ( $this->getUser('group') === self::GROUP_MEMBER
&& $this->getData(['theme','footer','memberBar']) === true
) {
$items .= '';
}
// Fermeture du bloc copyright
@@ -1638,19 +1660,37 @@ class common {
)
OR $this->getUrl(0) === 'theme'
) {
- $itemsRight .= '
';
+ $itemsRight .= '';
}
// Commandes pour les membres simples
if($this->getUser('group') == self::GROUP_MEMBER
&& $this->getData(['theme','menu','memberBar']) === true
) {
- if( $this->getData(['user', $this->getUser('id') , 'files']) === true) $itemsRight .= '' . template::ico('folder') . '';
- $itemsRight .= '' . template::ico('user', ['margin' => 'right']) . '';
- $itemsRight .= '' . template::ico('logout') . '';
+ if (
+ $this->getData(['user', $this->getUser('id') , 'files']) === true
+ ) {
+ $itemsRight .= '' . template::ico('folder', [
+ 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json'),
+ 'attr' => 'data-lity',
+ 'help' => 'Fichiers du site'
+ ]). '';
+ }
+ $itemsRight .= '' . template::ico('user', [
+ 'help' => 'Mon compte',
+ 'margin' => 'right',
+ 'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id'). '/' . $_SESSION['csrf']
+ ]) . '';
+ $itemsRight .= '' .
+ template::ico('logout', [
+ 'help' => 'Déconnecter',
+ 'href' => helper::baseUrl() . 'user/logout',
+ 'id' => 'barLogout'
+ ]) . '';
}
// Retourne les items du menu
echo '' . $itemsRight;
@@ -2018,7 +2058,10 @@ class common {
}
$leftItems .= '';
$leftItems .= '';
- $leftItems .= '- ' . template::ico('plus') . '
';
+ $leftItems .= '- ' . template::ico('plus', [
+ 'href' => helper::baseUrl() . 'page/add',
+ 'help' => 'Nouvelle page ou
nouvelle barre latérale'
+ ]) . ' ';
if(
// Sur un module de page qui autorise le bouton de modification de la page
$this->output['showBarEditButton']
@@ -2029,12 +2072,28 @@ class common {
// Sur une page d'accueil
OR $this->getUrl(0) === ''
) {
- $leftItems .= '- ' . template::ico('pencil') . '
';
+ $leftItems .= '- ' . template::ico('pencil', [
+ 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
+ 'help' => 'Editer la page'
+ ]) . '
';
if ($this->getData(['page', $this->getUrl(0),'moduleId'])) {
- $leftItems .= '- ' . template::ico('gear') . '
';
+ $leftItems .= '- ' . template::ico('gear', [
+ 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
+ 'help' => 'Module de la page'
+ ]) . '
';
}
- $leftItems .= '- ' . template::ico('clone') . '
';
- $leftItems .= '- ' . template::ico('trash') . '
';
+ $leftItems .= '- ' . template::ico('clone', [
+ 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'],
+ 'help' => 'Cloner la page'
+ ])
+ . '
';
+
+ $leftItems .= '- ' . template::ico('trash', [
+ 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'],
+ 'help' => 'Supprimer la page',
+ 'id' => 'pageDelete'
+ ])
+ . '
';
}
}
// Items de droite
@@ -2043,13 +2102,26 @@ class common {
$rightItems .= '- ' . template::ico('folder') . '
';
}
if($this->getUser('group') >= self::GROUP_ADMIN) {
- $rightItems .= '- ' . template::ico('brush') . '
';
- $rightItems .= '- ' . template::ico('puzzle') . '
';
- if ($this->getData(['config', 'i18n', 'enable']) === true) {
- $rightItems .= '- ' . template::ico('flag') . '
';
- }
- $rightItems .= '- ' . template::ico('cog-alt') . '
';
- $rightItems .= '- ' . template::ico('users') . '
';
+ $rightItems .= '- ' . template::ico('brush', [
+ 'help' => 'Thème',
+ 'href' => helper::baseUrl() . 'theme'
+ ]) . '
';
+ $rightItems .= '- ' . template::ico('puzzle', [
+ 'help' => 'Gérer les modules',
+ 'href' => helper::baseUrl() . 'plugin'
+ ]) . '
';
+ $rightItems .= '- ' . template::ico('flag', [
+ 'help' => 'Traduction',
+ 'href' => helper::baseUrl() . 'translate'
+ ]) . '
';
+ $rightItems .= '- ' . template::ico('cog-alt', [
+ 'help' => 'Configuration',
+ 'href' => helper::baseUrl() . 'config'
+ ]) . '
';
+ $rightItems .= '- ' . template::ico('users', [
+ 'help' => 'Utilisateurs',
+ 'href' => helper::baseUrl() . 'user'
+ ]) . '
';
// Mise à jour automatique
$today = mktime(0, 0, 0);
@@ -2073,7 +2145,11 @@ class common {
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$rightItems .= '- ' . template::ico('user', ['margin' => 'right']) . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
';
}
- $rightItems .= '- ' . template::ico('logout') . '
';
+ $rightItems .= '- ' . template::ico('logout', [
+ 'help' => 'Déconnecter',
+ 'href' => helper::baseUrl() . 'user/logout',
+ 'id' => 'barLogout'
+ ]) . '
';
// Barre de membre
echo '';
}