setting.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php require_once __DIR__.DIRECTORY_SEPARATOR.'header.php'; ?>
  2. <?php if (!$myUser->connected()) throw new Exception('Vous devez être connecté pour accéder à cette fonctionnalité',401);
  3. $settingMenu = array();
  4. $administrationMenu = false;
  5. Plugin::callHook("menu_setting", array(&$settingMenu));
  6. // usort($settingMenu, function($a,$b){
  7. // if($a['label'] == "Général") return -1;
  8. // if($a['label'] > $b['label']) return 1;
  9. // if($a['label'] < $b['label']) return -1;
  10. // if($a['label'] == $b['label']) return 0;
  11. // });
  12. $_['section'] = !isset($_['section']) ? 'global': $_['section'];
  13. $page = basename($_SERVER['PHP_SELF']);
  14. ?>
  15. <div class="row">
  16. <div class="col-md-3">
  17. <div class="list-group">
  18. <h5 class="list-group-item">Configuration</h5>
  19. <?php foreach($settingMenu as $item):
  20. if(isset($item['category']) && $item['category']!='configuration') {
  21. $administrationMenu = true;
  22. continue;
  23. }
  24. ?>
  25. <a href="<?php echo $item['url']; ?>" class="list-group-item list-group-item-action <?php echo $item['url'] == $page.'?section='.$_['section']?'active':'text-primary'; ?>"><i class="<?php echo $item['icon']; ?>"></i> <?php echo $item['label']; ?></a>
  26. <?php endforeach; ?>
  27. </div>
  28. <br>
  29. <?php if($administrationMenu): ?>
  30. <div class="list-group">
  31. <h5 class="list-group-item">Administration</h5>
  32. <?php foreach($settingMenu as $item):
  33. if(!isset($item['category']) || $item['category']!='administration') continue;
  34. ?>
  35. <a href="<?php echo isset($item['url'])?$item['url']:''; ?>" class="list-group-item list-group-item-action <?php echo $item['url'] == $page.'?section='.$_['section']?'active':'text-primary'; ?> "><i class="<?php echo $item['icon']; ?>"></i> <?php echo $item['label']; ?></a>
  36. <?php endforeach; ?>
  37. </div>
  38. <?php endif; ?>
  39. </div>
  40. <div class="col-md-9"><?php Plugin::callHook("content_setting"); ?></div>
  41. </div>
  42. <br>
  43. <?php require_once __ROOT__.'footer.php' ?>