From ebe76fad2a7b5a97198870dafd1e6dc89a9775df Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 21 Jan 2022 10:58:13 +0100 Subject: [PATCH] =?UTF-8?q?Aide=20sur=20les=20boutons=20d'ic=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/addon/addon.php | 15 ++-- core/module/addon/view/store/store.php | 2 +- core/module/translate/view/index/index.php | 2 +- core/module/user/user.php | 6 +- core/vendor/tippy/init.js | 81 ++++++++++++---------- module/blog/blog.php | 9 ++- module/blog/view/config/config.php | 6 +- module/form/view/config/config.php | 6 +- module/form/view/data/data.php | 17 +++-- module/form/view/option/option.php | 7 +- module/gallery/gallery.php | 6 +- module/gallery/view/config/config.php | 3 +- module/gallery/view/gallery/gallery.php | 5 +- module/gallery/view/theme/theme.php | 2 +- module/news/view/config/config.php | 14 ++-- 15 files changed, 105 insertions(+), 76 deletions(-) diff --git a/core/module/addon/addon.php b/core/module/addon/addon.php index 3c528df4..1e9b0f6e 100644 --- a/core/module/addon/addon.php +++ b/core/module/addon/addon.php @@ -302,15 +302,18 @@ class addon extends common { // Module non installé $ico = template::ico('download'); $class = ''; + $help = 'Installer le module'; // Le module est installé if (array_key_exists($key,$infoModules) === true) { $class = 'buttonGreen'; $ico = template::ico('update'); + $help = 'Mettre à jour ce module'; } // Le module est installé et utilisé if (in_array($key,$inPages) === true) { $class = 'buttonRed'; $ico = template::ico('update'); + $help = 'Mettre à jour le module'; } self::$storeList [] = [ $store[$key]['category'], @@ -323,7 +326,8 @@ class addon extends common { template::button('moduleExport' . $key, [ 'class' => $class, 'href' => helper::baseUrl(). $this->getUrl(0) . '/uploadItem/' . $key.'/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre - 'value' => $ico + 'value' => $ico, + 'help' => $help ]) ]; } @@ -380,19 +384,22 @@ class addon extends common { ? template::button('moduleDelete' . $key, [ 'class' => 'moduleDelete buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') + 'value' => template::ico('cancel'), + 'help' => 'Supprimer le module '. $key ]) : '', implode(', ',array_keys($inPages,$key)) !== '' ? template::button('moduleExport' . $key, [ 'href' => helper::baseUrl(). $this->getUrl(0) . '/export/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre - 'value' => template::ico('download') + 'value' => template::ico('download'), + 'help' => 'Exporter les données du module avec sa page' ]) : '', implode(', ',array_keys($inPages,$key)) === '' ? template::button('moduleExport' . $key, [ 'href' => helper::baseUrl(). $this->getUrl(0) . '/import/' . $key . '/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre - 'value' => template::ico('upload') + 'value' => template::ico('upload'), + 'help' => 'Importer les données du module avec sa page' ]) : '' ]; diff --git a/core/module/addon/view/store/store.php b/core/module/addon/view/store/store.php index ba0e292c..8646d8cf 100644 --- a/core/module/addon/view/store/store.php +++ b/core/module/addon/view/store/store.php @@ -8,7 +8,7 @@ - Mettre à jour']); ?> + \ No newline at end of file diff --git a/core/module/translate/view/index/index.php b/core/module/translate/view/index/index.php index 719a5bbd..777a920d 100644 --- a/core/module/translate/view/index/index.php +++ b/core/module/translate/view/index/index.php @@ -21,7 +21,7 @@ 'href' => helper::baseUrl() . 'translate/copy', 'value' => template::ico('cogs'), 'disabled' => $module::$siteTranslate, - 'help' => 'Utilitaire de copie de site inter-langues' + 'help' => 'Copie de sites inter-langues' ]); ?>
diff --git a/core/module/user/user.php b/core/module/user/user.php index 82a22882..dab81c76 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -346,12 +346,14 @@ class user extends common { self::$groups[$this->getData(['user', $userId, 'group'])], template::button('userEdit' . $userId, [ 'href' => helper::baseUrl() . 'user/edit/' . $userId . '/back/'. $_SESSION['csrf'], - 'value' => template::ico('pencil') + 'value' => template::ico('pencil'), + 'help' => 'Editer ' . $userId ]), template::button('userDelete' . $userId, [ 'class' => 'userDelete buttonRed', 'href' => helper::baseUrl() . 'user/delete/' . $userId. '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') + 'value' => template::ico('cancel'), + 'help' => 'Supprimer ' . $userId ]) ]; } diff --git a/core/vendor/tippy/init.js b/core/vendor/tippy/init.js index 976da1e6..210a5f14 100755 --- a/core/vendor/tippy/init.js +++ b/core/vendor/tippy/init.js @@ -1,38 +1,49 @@ /** * Initialisation de Tippy */ -$(document).ready(function() { - // Tooltip des aides - tippy(".helpButton", { - arrow: true, - arrowType: "round", - placement: "top" - }); - // Tooltip des attributs title - tippy("[data-tippy-content]", { - arrow: true, - placement: "top" - }); - // Pour les images map, pas de flèche, bulle haut suivant le curseur - - tippy('img[title], a[title], area[title]', { - - content(reference) { - const title = reference.getAttribute('title') - reference.removeAttribute('title') - return title - }, - - placement: "top", - followCursor: true, - animation: "fade", - animateFill: true - }); - // Pour les images map, pas de flèche, bulle haut suivant le curseur - tippy("#image-map", { - placement: "top", - followCursor: true, - animation: "fade", - animateFill: true - }); -}); +$(document).ready(function () { + + // Tooltip des attributs title + tippy("[data-tippy-content]", { + arrow: true, + placement: "top" + }); + + // Pour les images map, pas de flèche, bulle haut suivant le curseur + tippy('img[title], a[title]:not(.button), area[title]', { + + content(reference) { + const title = reference.getAttribute('title') + reference.removeAttribute('title') + return title + }, + + placement: "top", + followCursor: true, + animation: "fade", + animateFill: true + }); + + // Tooltip des aides + tippy('a.button[title]', { + content(reference) { + const title = reference.getAttribute('title') + reference.removeAttribute('title') + return title + }, + delay: [1000,250], + placement: "bottom", + followCursor: false, + arrow: true, + animateFill: true, + arrowType: "round", + }); + + // Pour les images map, pas de flèche, bulle haut suivant le curseur + tippy("#image-map", { + placement: "top", + followCursor: true, + animation: "fade", + animateFill: true + }); +}); \ No newline at end of file diff --git a/module/blog/blog.php b/module/blog/blog.php index c2f98d2c..b25c4b0f 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -462,16 +462,19 @@ class blog extends common { template::button('blogConfigComment' . $articleIds[$i], [ 'class' => ($toApprove || $approved ) > 0 ? '' : 'buttonGrey' , 'href' => ($toApprove || $approved ) > 0 ? helper::baseUrl() . $this->getUrl(0) . '/comment/' . $articleIds[$i] : '', - 'value' => $toApprove > 0 ? $toApprove . '/' . $approved : $approved + 'value' => $toApprove > 0 ? $toApprove . '/' . $approved : $approved, + 'help' => ($toApprove || $approved ) > 0 ? 'Editer / Approuver les commentaires' : '' ]), template::button('blogConfigEdit' . $articleIds[$i], [ 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleIds[$i] . '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil') + 'value' => template::ico('pencil'), + 'help' => 'Editer l\'article' ]), template::button('blogConfigDelete' . $articleIds[$i], [ 'class' => 'blogConfigDelete buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $articleIds[$i] . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') + 'value' => template::ico('cancel'), + 'help' => 'Effacer l\'article' ]) ]; } diff --git a/module/blog/view/config/config.php b/module/blog/view/config/config.php index b08d8c7b..0a34ab28 100644 --- a/module/blog/view/config/config.php +++ b/module/blog/view/config/config.php @@ -10,14 +10,16 @@
helper::baseUrl() . $this->getUrl(0) . '/option', - 'value' => template::ico('cogs') + 'value' => template::ico('cogs'), + 'help' => 'Options de configuration' ]); ?>
helper::baseUrl() . $this->getUrl(0) . '/add', - 'value' => template::ico('plus') + 'value' => template::ico('plus'), + 'help' => 'Rédiger un article' ]); ?>
diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 44e663b5..4da4e856 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -60,13 +60,15 @@
helper::baseUrl() . $this->getUrl(0) . '/data', - 'value' => template::ico('code') + 'value' => template::ico('code'), + 'help' => 'Voir et exporter les données du formulaire' ]); ?>
helper::baseUrl() . $this->getUrl(0) . '/option', - 'value' => template::ico('cogs') + 'value' => template::ico('cogs'), + 'help' => 'Options de configuration' ]); ?>
diff --git a/module/form/view/data/data.php b/module/form/view/data/data.php index d0a22868..147548a7 100644 --- a/module/form/view/data/data.php +++ b/module/form/view/data/data.php @@ -1,25 +1,24 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'formDataDeleteAll buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'], - 'ico' => 'cancel', - 'value' => 'Tout effacer' + 'value' => template::ico('cancel'), + 'help' => 'Effacer toutes les données' ]); ?>
-
+
helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'], - 'ico' => 'download', - 'value' => 'Export CSV' + 'value' => template::ico('download'), + 'help' => 'Exporter toutes les données' ]); ?>
diff --git a/module/form/view/option/option.php b/module/form/view/option/option.php index 47fb53e1..fe479465 100644 --- a/module/form/view/option/option.php +++ b/module/form/view/option/option.php @@ -1,14 +1,13 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 67483a83..e2d99e61 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -346,12 +346,14 @@ class gallery extends common { $gallery['config']['directory'], template::button('galleryConfigEdit' . $galleryId , [ 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil') + 'value' => template::ico('pencil'), + 'help' => 'Configuration de la galerie ' ]), template::button('galleryConfigDelete' . $galleryId, [ 'class' => 'galleryConfigDelete buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $galleryId . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') + 'value' => template::ico('cancel'), + 'help' => 'Supprimer cette galerie' ]) ]; // Tableau des id des galleries pour le drag and drop diff --git a/module/gallery/view/config/config.php b/module/gallery/view/config/config.php index acf5c757..526cdaab 100644 --- a/module/gallery/view/config/config.php +++ b/module/gallery/view/config/config.php @@ -10,7 +10,8 @@
helper::baseUrl() . $this->getUrl(0) . '/theme/' . $_SESSION['csrf'], - 'value' => template::ico('brush') + 'value' => template::ico('brush'), + 'help' => 'Thème de cette galerie' ]); ?>
diff --git a/module/gallery/view/gallery/gallery.php b/module/gallery/view/gallery/gallery.php index 9e617583..235aac0d 100644 --- a/module/gallery/view/gallery/gallery.php +++ b/module/gallery/view/gallery/gallery.php @@ -1,10 +1,9 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0), - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
diff --git a/module/gallery/view/theme/theme.php b/module/gallery/view/theme/theme.php index a585cc73..a66c589d 100644 --- a/module/gallery/view/theme/theme.php +++ b/module/gallery/view/theme/theme.php @@ -5,7 +5,7 @@ 'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'value' => template::ico('cancel') + 'value' => template::ico('left') ]); ?>
diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 0a855f6e..5341b1c8 100644 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -8,15 +8,17 @@ ]); ?>
- helper::baseUrl() . $this->getUrl(0) . '/add', - 'value' => template::ico('plus') + helper::baseUrl() . $this->getUrl(0) . '/option', + 'value' => template::ico('cogs'), + 'help' => 'Options de configuration' ]); ?>
- helper::baseUrl() . $this->getUrl(0) . '/option', - 'value' => template::ico('brush') + helper::baseUrl() . $this->getUrl(0) . '/add', + 'value' => template::ico('plus'), + 'help' => 'Rédiger une news' ]); ?>