widget.configure.php 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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. <div class="row">
  12. <div class="col-md-6 col-sm-12">
  13. <label for="notification-number">Nb de notifications affichées :</label>
  14. <input type="number" class="form-control mb-2" value="<?php echo $max; ?>" id="notification-number">
  15. </div>
  16. <div class="col-md-6 col-sm-12">
  17. <label for="notification-length">Nb de caractères affichés :</label>
  18. <input type="number" class="form-control mb-2" value="<?php echo $maxlength; ?>" id="notification-length">
  19. </div>
  20. <div class="col-md-12 col-sm-12">
  21. <label for="">Types de notifications à afficher :</label>
  22. <ul class="list-group" id="widget-notification-list">
  23. <?php foreach(Notification::types() as $slug=>$type): ?>
  24. <li class="list-group-item p-0">
  25. <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>
  26. </li>
  27. <?php endforeach; ?>
  28. </ul>
  29. </div>
  30. </div>
  31. </div>