widget.configure.php 1.2 KB

12345678910111213141516171819202122232425
  1. <?php
  2. require_once(__DIR__.SLASH.'Notification.class.php');
  3. $selectedTypes = $widget->data('types');
  4. $selectedTypes = $selectedTypes==''? array("announcement"):$selectedTypes;
  5. $max = $widget->data('notification-number');
  6. $max = $max =="" ? 5 : $max ;
  7. $maxlength = $widget->data('notification-length');
  8. $maxlength = $maxlength =="" ? 150 : $maxlength ;
  9. ?>
  10. <div id="notification-widget-form">
  11. Afficher au maximum le nombre de notifications suivant
  12. <input type="number" class="form-control mb-2" value="<?php echo $max; ?>" id="notification-number">
  13. Limiter le nombre de caractères du texte à
  14. <input type="number" class="form-control mb-2" value="<?php echo $maxlength; ?>" id="notification-length">
  15. Cochez les types de notifications à afficher
  16. <ul class="list-group" id="widget-notification-list">
  17. <?php foreach(Notification::types() as $slug=>$type): ?>
  18. <li class="list-group-item p-0">
  19. <label class="m-0 pointer p-2"><input type="checkbox" <?php echo in_array($slug, $selectedTypes)?'checked="checked"':''; ?> value="<?php echo $slug; ?>" data-type="checkbox"><i class="<?php echo $type['icon']; ?>"></i> <?php echo $type['label']; ?> <small class="text-muted">- <?php echo $type['description']; ?></small></label>
  20. </li>
  21. <?php endforeach; ?>
  22. </ul>
  23. </div>