Aide sur les boutons d'icônes

This commit is contained in:
fredtempez 2022-01-21 10:58:13 +01:00
parent e094a79a24
commit 4a0848c003
15 changed files with 105 additions and 76 deletions

View File

@ -302,15 +302,18 @@ class addon extends common {
// Module non installé // Module non installé
$ico = template::ico('download'); $ico = template::ico('download');
$class = ''; $class = '';
$help = 'Installer le module';
// Le module est installé // Le module est installé
if (array_key_exists($key,$infoModules) === true) { if (array_key_exists($key,$infoModules) === true) {
$class = 'buttonGreen'; $class = 'buttonGreen';
$ico = template::ico('update'); $ico = template::ico('update');
$help = 'Mettre à jour ce module';
} }
// Le module est installé et utilisé // Le module est installé et utilisé
if (in_array($key,$inPages) === true) { if (in_array($key,$inPages) === true) {
$class = 'buttonRed'; $class = 'buttonRed';
$ico = template::ico('update'); $ico = template::ico('update');
$help = 'Mettre à jour le module';
} }
self::$storeList [] = [ self::$storeList [] = [
$store[$key]['category'], $store[$key]['category'],
@ -323,7 +326,8 @@ class addon extends common {
template::button('moduleExport' . $key, [ template::button('moduleExport' . $key, [
'class' => $class, 'class' => $class,
'href' => helper::baseUrl(). $this->getUrl(0) . '/uploadItem/' . $key.'/' . $_SESSION['csrf'],// appel de fonction vaut exécution, utiliser un paramètre '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, [ ? template::button('moduleDelete' . $key, [
'class' => 'moduleDelete buttonRed', 'class' => 'moduleDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $key . '/' . $_SESSION['csrf'], '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)) !== '' implode(', ',array_keys($inPages,$key)) !== ''
? template::button('moduleExport' . $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 '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)) === '' implode(', ',array_keys($inPages,$key)) === ''
? template::button('moduleExport' . $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 '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'
]) ])
: '' : ''
]; ];

View File

@ -8,7 +8,7 @@
</div> </div>
</div> </div>
<?php if($module::$storeList): ?> <?php if($module::$storeList): ?>
<?php echo template::table([2, 2, 1, 2, 2, 2, 1], $module::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Pages', 'Télécharger ou <br> Mettre à jour']); ?> <?php echo template::table([2, 2, 1, 2, 2, 2, 1], $module::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Pages', 'Obtenir']); ?>
<?php else: ?> <?php else: ?>
<?php echo template::speech('Le catalogue est vide.'); ?> <?php echo template::speech('Le catalogue est vide.'); ?>
<?php endif; ?> <?php endif; ?>

View File

@ -21,7 +21,7 @@
'href' => helper::baseUrl() . 'translate/copy', 'href' => helper::baseUrl() . 'translate/copy',
'value' => template::ico('cogs'), 'value' => template::ico('cogs'),
'disabled' => $module::$siteTranslate, 'disabled' => $module::$siteTranslate,
'help' => 'Utilitaire de copie de site inter-langues' 'help' => 'Copie de sites inter-langues'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">

View File

@ -346,12 +346,14 @@ class user extends common {
self::$groups[$this->getData(['user', $userId, 'group'])], self::$groups[$this->getData(['user', $userId, 'group'])],
template::button('userEdit' . $userId, [ template::button('userEdit' . $userId, [
'href' => helper::baseUrl() . 'user/edit/' . $userId . '/back/'. $_SESSION['csrf'], 'href' => helper::baseUrl() . 'user/edit/' . $userId . '/back/'. $_SESSION['csrf'],
'value' => template::ico('pencil') 'value' => template::ico('pencil'),
'help' => 'Editer ' . $userId
]), ]),
template::button('userDelete' . $userId, [ template::button('userDelete' . $userId, [
'class' => 'userDelete buttonRed', 'class' => 'userDelete buttonRed',
'href' => helper::baseUrl() . 'user/delete/' . $userId. '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . 'user/delete/' . $userId. '/' . $_SESSION['csrf'],
'value' => template::ico('cancel') 'value' => template::ico('cancel'),
'help' => 'Supprimer ' . $userId
]) ])
]; ];
} }

View File

@ -2,20 +2,15 @@
* Initialisation de Tippy * Initialisation de Tippy
*/ */
$(document).ready(function () { $(document).ready(function () {
// Tooltip des aides
tippy(".helpButton", {
arrow: true,
arrowType: "round",
placement: "top"
});
// Tooltip des attributs title // Tooltip des attributs title
tippy("[data-tippy-content]", { tippy("[data-tippy-content]", {
arrow: true, arrow: true,
placement: "top" placement: "top"
}); });
// Pour les images map, pas de flèche, bulle haut suivant le curseur
tippy('img[title], a[title], area[title]', { // Pour les images map, pas de flèche, bulle haut suivant le curseur
tippy('img[title], a[title]:not(.button), area[title]', {
content(reference) { content(reference) {
const title = reference.getAttribute('title') const title = reference.getAttribute('title')
@ -28,6 +23,22 @@ $(document).ready(function() {
animation: "fade", animation: "fade",
animateFill: true 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 // Pour les images map, pas de flèche, bulle haut suivant le curseur
tippy("#image-map", { tippy("#image-map", {
placement: "top", placement: "top",

View File

@ -462,16 +462,19 @@ class blog extends common {
template::button('blogConfigComment' . $articleIds[$i], [ template::button('blogConfigComment' . $articleIds[$i], [
'class' => ($toApprove || $approved ) > 0 ? '' : 'buttonGrey' , 'class' => ($toApprove || $approved ) > 0 ? '' : 'buttonGrey' ,
'href' => ($toApprove || $approved ) > 0 ? helper::baseUrl() . $this->getUrl(0) . '/comment/' . $articleIds[$i] : '', '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], [ template::button('blogConfigEdit' . $articleIds[$i], [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleIds[$i] . '/' . $_SESSION['csrf'], '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], [ template::button('blogConfigDelete' . $articleIds[$i], [
'class' => 'blogConfigDelete buttonRed', 'class' => 'blogConfigDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $articleIds[$i] . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $articleIds[$i] . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel') 'value' => template::ico('cancel'),
'help' => 'Effacer l\'article'
]) ])
]; ];
} }

View File

@ -10,14 +10,16 @@
<div class="col1 offset9"> <div class="col1 offset9">
<?php echo template::button('blogConfigOption', [ <?php echo template::button('blogConfigOption', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/option', 'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'value' => template::ico('cogs') 'value' => template::ico('cogs'),
'help' => 'Options de configuration'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('blogConfigAdd', [ <?php echo template::button('blogConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add', 'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'value' => template::ico('plus') 'value' => template::ico('plus'),
'help' => 'Rédiger un article'
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -60,13 +60,15 @@
<div class="col1 offset7"> <div class="col1 offset7">
<?php echo template::button('formConfigData', [ <?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data', 'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => template::ico('code') 'value' => template::ico('code'),
'help' => 'Voir et exporter les données du formulaire'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('formConfigLayout', [ <?php echo template::button('formConfigLayout', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/option', 'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'value' => template::ico('cogs') 'value' => template::ico('cogs'),
'help' => 'Options de configuration'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col2">

View File

@ -1,25 +1,24 @@
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('formDataBack', [ <?php echo template::button('formDataBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset6"> <div class="col1 offset9">
<?php echo template::button('formDataDeleteAll', [ <?php echo template::button('formDataDeleteAll', [
'class' => 'formDataDeleteAll buttonRed', 'class' => 'formDataDeleteAll buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/deleteall' . '/' . $_SESSION['csrf'],
'ico' => 'cancel', 'value' => template::ico('cancel'),
'value' => 'Tout effacer' 'help' => 'Effacer toutes les données'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col1">
<?php echo template::button('formDataBack', [ <?php echo template::button('formDataBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/export2csv' . '/' . $_SESSION['csrf'],
'ico' => 'download', 'value' => template::ico('download'),
'value' => 'Export CSV' 'help' => 'Exporter toutes les données'
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -1,14 +1,13 @@
<?php echo template::formOpen('formOptionForm'); ?> <?php echo template::formOpen('formOptionForm'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('formOptionBack', [ <?php echo template::button('formOptionBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset9">
<?php echo template::submit('formOptionSubmit'); ?> <?php echo template::submit('formOptionSubmit'); ?>
</div> </div>
</div> </div>

View File

@ -346,12 +346,14 @@ class gallery extends common {
$gallery['config']['directory'], $gallery['config']['directory'],
template::button('galleryConfigEdit' . $galleryId , [ template::button('galleryConfigEdit' . $galleryId , [
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'], '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, [ template::button('galleryConfigDelete' . $galleryId, [
'class' => 'galleryConfigDelete buttonRed', 'class' => 'galleryConfigDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $galleryId . '/' . $_SESSION['csrf'], '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 // Tableau des id des galleries pour le drag and drop

View File

@ -10,7 +10,8 @@
<div class="col1 offset10"> <div class="col1 offset10">
<?php echo template::button('galleryConfigBack', [ <?php echo template::button('galleryConfigBack', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/theme/' . $_SESSION['csrf'], 'href' => helper::baseUrl() . $this->getUrl(0) . '/theme/' . $_SESSION['csrf'],
'value' => template::ico('brush') 'value' => template::ico('brush'),
'help' => 'Thème de cette galerie'
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -1,10 +1,9 @@
<div class="row"> <div class="row">
<div class="col2"> <div class="col1">
<?php echo template::button('galleryGalleryBack', [ <?php echo template::button('galleryGalleryBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0), 'href' => helper::baseUrl() . $this->getUrl(0),
'ico' => 'left', 'value' => template::ico('left')
'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -5,7 +5,7 @@
<?php echo template::button('galleryThemeBack', [ <?php echo template::button('galleryThemeBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('cancel') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>
<div class="col2 offset9"> <div class="col2 offset9">

View File

@ -8,15 +8,17 @@
]); ?> ]); ?>
</div> </div>
<div class="col1 offset9"> <div class="col1 offset9">
<?php echo template::button('newsConfigAdd', [ <?php echo template::button('newsConfigLayout', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add', 'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'value' => template::ico('plus') 'value' => template::ico('cogs'),
'help' => 'Options de configuration'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('newsConfigLayout', [ <?php echo template::button('newsConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/option', 'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'value' => template::ico('brush') 'value' => template::ico('plus'),
'help' => 'Rédiger une news'
]); ?> ]); ?>
</div> </div>
</div> </div>