setting.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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['sort'] > $b['sort']) return 1;
  8. // if($a['sort'] < $b['sort']) return -1;
  9. // if($a['sort'] == $b['sort']) return 0;
  10. // });
  11. $_['section'] = !isset($_['section']) ? 'global': $_['section'];
  12. $page = basename($_SERVER['PHP_SELF']);
  13. ?>
  14. <div class="row">
  15. <div class="col-md-3">
  16. <div class="list-group">
  17. <span class="list-group-item"><h5 class="mb-0">Configuration</h5></span>
  18. <?php foreach($settingMenu as $item):
  19. if(isset($item['category']) && $item['category']!='configuration') {
  20. $administrationMenu = true;
  21. continue;
  22. }
  23. ?>
  24. <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>
  25. <?php endforeach; ?>
  26. </div>
  27. <br/>
  28. <?php if($administrationMenu): ?>
  29. <div class="list-group">
  30. <span class="list-group-item"><h5 class="mb-0">Administration</h5></span>
  31. <?php foreach($settingMenu as $item):
  32. if(!isset($item['category']) || $item['category']!='administration') continue;
  33. ?>
  34. <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>
  35. <?php endforeach; ?>
  36. </div>
  37. <?php endif; ?>
  38. </div>
  39. <div class="col-md-9"><?php Plugin::callHook("content_setting"); ?></div>
  40. </div>
  41. <br>
  42. <?php require_once __ROOT__.'footer.php' ?>