cms.parametres-general.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. $checkMaintenance = core::isMaintenance();
  3. $checkDebug = core::isDebug();
  4. ?>
  5. <h4>Général</h4>
  6. <div class="element-parametres form-check form-switch">
  7. <input class="form-check-input" type="checkbox" role="switch" id="checkMaintenance" <?php core::checkboxSelecter($checkMaintenance) ?>>
  8. <label class="form-check-label" for="checkMaintenance">Site en mode maintenance (les salariés ne pourront plus faire d'action sur le site)</label>
  9. </div>
  10. <div class="element-parametres form-check form-switch">
  11. <input class="form-check-input" type="checkbox" role="switch" id="checkDebug" <?php core::checkboxSelecter($checkDebug) ?>>
  12. <label class="form-check-label" for="checkDebug">Afficher les erreurs (débug)</label>
  13. </div>
  14. <?php if (session::accessUserByType(1) and session::getId() == 1 and (ENVIRONNEMENT == "DEV" or ENVIRONNEMENT == "PREPROD")) { ?>
  15. <h4>Développement</h4>
  16. <div class="element-parametres">
  17. <a href="/submit.php?from=parametres-reset-datas" onclick="return confirm('Etes-vous certain de vouloir supprimer les données ?')"><button type="button" class="btn btn-warning">Nettoyer les données</button></a>
  18. </div>
  19. <div class="element-parametres">
  20. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPHPInfo">PHP Infos</button>
  21. </div>
  22. <div class="modal fade" id="modalPHPInfo" tabindex="-1" role="dialog" aria-hidden="true">
  23. <div class="modal-dialog" role="document">
  24. <div class="modal-content">
  25. <div class="modal-header">
  26. <h5 class="modal-title" id="exampleModalLabel">PHP Info</h5>
  27. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  28. <span aria-hidden="true">&times;</span>
  29. </button>
  30. </div>
  31. <div class="modal-body">
  32. <iframe width="970" height="800" src="/parametres-debug-info.vue"></iframe>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <?php } ?>
  38. <script>
  39. $(document).ready(function() {
  40. $('#checkMaintenance').on('change', function() {
  41. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  42. });
  43. $('#checkDebug').on('change', function() {
  44. window.location.href = "/submit.php?from=parametres-debug-activation&actif=" + $("#checkDebug").prop('checked');
  45. });
  46. $('#modalPHPInfo').on('show.bs.modal', function() {
  47. $(this).find('.modal-body').css({
  48. width: 'auto', //probably not needed
  49. height: 'auto', //probably not needed
  50. 'max-height': '100%'
  51. });
  52. });
  53. });
  54. </script>
  55. <style>
  56. h4 {
  57. margin-top: 15px;
  58. }
  59. .element-parametres {
  60. margin-top: 5px;
  61. }
  62. .modal-body {
  63. position: relative;
  64. overflow-y: auto;
  65. max-height: 400px;
  66. padding: 15px;
  67. }
  68. .modal-dialog{
  69. width: 1005px !important;
  70. }
  71. .modal {
  72. --bs-modal-width: none;
  73. }
  74. .autoModal.modal .modal-body {
  75. max-height: 100%;
  76. }
  77. </style>