Template button, propriété help

This commit is contained in:
fredtempez 2022-01-20 13:39:42 +01:00
parent a49fda9657
commit 318458b948
2 changed files with 6 additions and 3 deletions

View File

@ -19,15 +19,17 @@ class template {
'name' => $nameId, 'name' => $nameId,
'target' => '', 'target' => '',
'uniqueSubmission' => false, 'uniqueSubmission' => false,
'value' => 'Bouton' 'value' => 'Bouton',
'help' => ''
], $attributes); ], $attributes);
// Retourne le html // Retourne le html
return sprintf( return sprintf(
'<a %s class="button %s %s %s">%s</a>', '<a %s class="button %s %s %s" %s>%s</a>',
helper::sprintAttributes($attributes, ['class', 'disabled', 'ico', 'value']), helper::sprintAttributes($attributes, ['class', 'disabled', 'ico', 'value']),
$attributes['disabled'] ? 'disabled' : '', $attributes['disabled'] ? 'disabled' : '',
$attributes['class'], $attributes['class'],
$attributes['uniqueSubmission'] ? 'uniqueSubmission' : '', $attributes['uniqueSubmission'] ? 'uniqueSubmission' : '',
$attributes['help'] ? ' title="' . $attributes['help'] . '" ': '',
($attributes['ico'] ? template::ico($attributes['ico'], 'right') : '') . $attributes['value'] ($attributes['ico'] ? template::ico($attributes['ico'], 'right') : '') . $attributes['value']
); );
} }

View File

@ -21,7 +21,8 @@
<?php echo template::button('pageEditDelete', [ <?php echo template::button('pageEditDelete', [
'class' => 'buttonRed', 'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'], 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => template::ico('cancel') 'value' => template::ico('cancel'),
'help' => 'Effacer la page'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">