page.index.php 6.6 KB

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