page.index.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. global $myUser, $myFirm, $conf;
  3. if(!$myUser->can('wiki','read')){
  4. require_once(__DIR__.SLASH.'page.login.php');
  5. exit();
  6. }
  7. require_once(__DIR__.SLASH.'WikiCategory.class.php');
  8. require_once(__DIR__.SLASH.'WikiPage.class.php');
  9. WikiCategory::synchronize();
  10. $myUser->loadPreferences();
  11. $menu = array(
  12. 'home' => array(
  13. 'label' => 'Accueil',
  14. 'icon' => 'fas fa-home',
  15. 'css' => 'wiki_home_item',
  16. 'onclick' => 'wiki_page_home()'
  17. ),
  18. 'search' => array(
  19. 'label' => '<span>Recherche</span><input class="form-control hidden" placeholder="Mot clé..." type="text">',
  20. 'icon' => 'fas fa-search',
  21. 'css' => 'wiki_search_item',
  22. 'onclick'=> 'wiki_search()'
  23. )
  24. );
  25. ?>
  26. <div id="wiki-summary">
  27. <h2><i title="Sommaire" class="far fa-list-alt"></i> Sommaire</h2>
  28. <ul></ul>
  29. </div>
  30. <div id="drag-overlay">
  31. <div id="overlay-text"><i class="far fa-file-alt"></i>&nbsp;&nbsp;Glissez vos fichiers ici.</div>
  32. <div id="overlay-icon"><i class="fas fa-cloud-upload-alt"></i></div>
  33. </div>
  34. <div id="sideMenu">
  35. <div class="wiki-header">
  36. <img src="action.php?action=wiki_logo_download" class="wiki-logo">
  37. <div class="wiki-brand">
  38. <div class="wiki-brand-firm">
  39. <?php $firmName = empty($conf->get('wiki_name'))?$myFirm->label:$conf->get('wiki_name'); ?>
  40. <span class="firm-label" title="<?php echo $firmName; ?>"><?php echo $firmName; ?></span>
  41. <div class="brand-option dropdown">
  42. <i class="fas fa-caret-down" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></i>
  43. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  44. <h6 class="dropdown-header">Général :</h6>
  45. <a class="dropdown-item" href="index.php"><i class="fas fa-home"></i> Accueil</a>
  46. <!-- <a class="dropdown-item" href="http://idleman.fr" target="_blank"><i class="fas fa-book"></i> Documentation</a> -->
  47. <!-- <a class="dropdown-item" href="index.php?module=wiki&page=shortcut" target="_blank"><i class="far fa-keyboard"></i> Raccourcis clavier</a> -->
  48. <?php if($myUser->can('wiki', 'edit')) : ?>
  49. <a class="dropdown-item" href="setting.php?section=global.wiki"><i class="fas fa-cogs"></i> Réglages</a>
  50. <?php endif; ?>
  51. <div class="dropdown-divider"></div>
  52. <a class="dropdown-item" href="action.php?action=logout&url=<?php echo base64_encode('index.php?module=wiki'); ?>"><i class="fas fa-sign-out-alt"></i> Déconnexion</a>
  53. </div>
  54. </div>
  55. <div class="clear"></div>
  56. </div>
  57. <div class="wiki-brand-user"><i class="far fa-meh-blank"></i> <?php echo $myUser->fullName(); ?></div>
  58. </div>
  59. <div class="night-mode-toggler" title="Activer / Désactiver le mode nuit du Wiki">
  60. <div class="toggle-box">
  61. <input <?php if(!empty($myUser->preference('wiki_night_mode'))) echo 'checked="checked"'; ?> type="checkbox" name="-toggler" id="night-mode-check" onchange="toggle_night_mode(this);" />
  62. <label for="night-mode-check" class="toggle-box-label"></label>
  63. </div>
  64. </div>
  65. </div>
  66. <div id="wiki-main-menu">
  67. <ul>
  68. <?php foreach($menu as $link): ?>
  69. <li class="<?php echo $link['css']; ?>" onclick="<?php echo $link['onclick']; ?>"><i class="<?php echo $link['icon']; ?>"></i> <?php echo $link['label']; ?>
  70. <?php if (isset($link['bubble'])): ?>
  71. <div class="wiki-bubble"><?php echo $link['bubble']; ?></div>{{/bubble}}
  72. <?php endif; ?>
  73. </li>
  74. <?php endforeach; ?>
  75. </ul>
  76. </div>
  77. <div id="wiki-categories">
  78. <h3>Catégories
  79. <?php if($myUser->can('wiki', 'edit')) : ?>
  80. <i class="fas fa-plus wiki-add-category" title="Ajouter une nouvelle catégorie" onclick="wiki_category_edit(this,event);"></i>
  81. <?php endif; ?>
  82. </h3>
  83. <ul id="categories">
  84. <li data-category="{{slug}}" data-id="{{id}}" onclick="wiki_category_open($(this).attr('data-category'));" class="hidden category category-{{state}}">
  85. <div class="icon-bubble" style="background-color:{{color}};"><i class="{{icon}}"></i></div> {{{label}}}
  86. <div class="category-option dropdown">
  87. <i class=" fas fa-ellipsis-h" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></i>
  88. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  89. <h6 class="dropdown-header">Catégorie :</h6>
  90. <?php if($myUser->can('wiki', 'edit')) : ?>
  91. <a class="dropdown-item" href="#" onclick="wiki_page_add(event);"><i class="far fa-file-alt"></i> Créer une page</a>
  92. <a class="dropdown-item" href="#" onclick="wiki_category_edit(this,event);"><i class="fas fa-pencil-alt"></i> Éditer</a>
  93. <a class="dropdown-item text-danger" href="#" onclick="wiki_category_delete(this,event);"><i class="far fa-trash-alt"></i> Supprimer</a>
  94. <div class="dropdown-divider"></div>
  95. <?php endif; ?>
  96. <a class="dropdown-item" href="#" onclick="wiki_category_download(this,event);"><i class="far fa-file-archive"></i> Télécharger</a>
  97. </div>
  98. </div>
  99. <ul></ul>
  100. </li>
  101. </ul>
  102. <ul id="pageModel" class="hidden">
  103. <li data-category="{{categorySlug}}" data-page="{{slug}}" data-id="{{id}}" class="page" onclick="wiki_page_open($(this).attr('data-category'),$(this).attr('data-page'),event);"><i class="far fa-sticky-note"></i> {{label}}</li>
  104. </ul>
  105. <div class="wiki-preloader"><i class="far fa-meh-blank fa-spin"></i><br>Recherche en cours...</div>
  106. <a class="dropdown-item hidden" href="#" id="upload-button">
  107. <div><i class="fas fa-plus"></i> Fichier</div>
  108. <form class="box" method="post" action="action.php?action=wiki_file_upload" enctype="multipart/form-data">
  109. <input data-label="envoyer" type="file" name="file[]" multiple />
  110. </form>
  111. </a>
  112. </div>
  113. </div>
  114. <div id="editor"></div>