setting.global.customiser.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. global $myUser,$conf;
  3. User::check_access('customiser','configure');
  4. require_once(__DIR__.SLASH.'Theme.class.php');
  5. ?>
  6. <div class="row customiser">
  7. <div class="col-md-12"><br>
  8. <div onclick="customiser_theme_save();" class="btn btn-success float-right"><i class="fas fa-check"></i> Enregistrer</div>
  9. <h3>Réglages Thème</h3>
  10. <hr>
  11. <div class="row row-cols-xl-4 row-cols-lg-3 row-cols-md-2 row-cols-sm-1">
  12. <?php foreach(Theme::getAll() as $i => $theme):
  13. $cover = 'media/theme/';
  14. if(isset($theme['cover']) && !empty($theme['cover'])){
  15. $cover .= (basename($theme['folder']).'/public/'.$theme['cover']) ;
  16. }else{
  17. $cover = 'plugin/customiser/img/default-cover.jpg';
  18. }
  19. ?>
  20. <div class="col mb-4">
  21. <label class="card pointer h-100" data-css="<?php echo ROOT_URL.$theme['css-relative-url']; ?>" onclick="customiser_preview(this);">
  22. <div class="theme-cover <?php echo $theme['checked']?'active':''; ?>">
  23. <img src="<?php echo $cover; ?>" class="card-img-top border-bottom border-light" alt="Image de preview du thème">
  24. <div class="overlay">
  25. <h2 class="m-0"><?php echo $theme['label']; ?></h2>
  26. <span class="info"><?php echo $theme['checked'] ? 'Thème actif' : 'Activer le thème'; ?></span>
  27. </div>
  28. </div>
  29. <div class="card-footer h-100 position-relative p-2">
  30. <small class="text-muted d-block mb-1"><i class="far fa-meh-blank"></i> <?php echo isset($theme['author']) ? $theme['author']['name'] : 'Auteur inconnu'; ?></small>
  31. <?php if($theme['last-update']==0): ?>
  32. <small class="text-muted d-block">Aucun thème</small>
  33. <?php else: ?>
  34. <small class="text-muted d-block" title="<?php echo 'Mis à jour le '.date("d/m/Y H:i", $theme['last-update']); ?>"><i class="far fa-calendar-alt"></i> <?php echo relative_time($theme['last-update']); ?></small>
  35. <?php endif; ?>
  36. <div>
  37. <input type="radio" data-type="radio" <?php echo $theme['checked'] ? "checked='checked'" : ""; ?> value="<?php echo $theme['css-relative-url']; ?>" name="selected-theme">
  38. </div>
  39. </div>
  40. </label>
  41. </div>
  42. <?php endforeach; ?>
  43. <div class="col mb-4">
  44. <label class="card pointer h-100" >
  45. <h5 class="bg-dark text-light text-center p-3 mb-0">INSTALLER UN THEME</h5>
  46. <p class="bg-dark text-light text-center mb-2">Fichier <span class="font-weight-bold">.zip</span> accepté</p>
  47. <input class="component-file-default bg-white shadow-sm rounded-sm" type="text" onchange="customiser_theme_install();" data-type="file" data-extension="zip" data-action="customiser_theme_zipTheme" data-id="zipTheme" id="zipTheme" >
  48. </label>
  49. </div>
  50. </div>
  51. </div>
  52. </div>