page.home.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. global $conf;
  3. require_once(__DIR__.SLASH.'WikiCategory.class.php');
  4. require_once(__DIR__.SLASH.'WikiPage.class.php');
  5. $updated = WikiPage::loadAll(array(),array('updated DESC'),array('10'), array('*'), 1);
  6. ?>
  7. <h1><i style="color:<?php echo random_hex_pastel_color('Accueil'); ?>;" class="fas fa-home"></i> Accueil</h1>
  8. <?php if($conf->get('wiki_home') != ''):
  9. $homePage = explode('/', $conf->get('wiki_home'));
  10. if(count($homePage) >= 2):
  11. list($category,$page) = $homePage;
  12. $category = WikiCategory::load(array('slug'=>$category));
  13. if($category && $home = WikiPage::load(array('category'=>$category->id,'slug'=>$page)))
  14. $home->content();
  15. ?>
  16. <div class="wiki-home-page">
  17. <?php echo isset($home) && $home ? $home->html() : ''; ?>
  18. </div>
  19. <?php endif; ?>
  20. <?php endif; ?>
  21. <?php if(count($updated) == 0): ?>
  22. <p>Aucune activitée récente enregistrée...<p>
  23. <?php else: ?>
  24. <div class="wiki-home-activity">
  25. <h3 class="wiki-title">Récemment Ajouté / Modifié </h3>
  26. <ul class="category-recent">
  27. <?php foreach($updated as $page): ?>
  28. <li data-category="<?php echo $page->join('category')->slug; ?>" data-page="<?php echo $page->slug; ?>" onclick="wiki_page_open($(this).attr('data-category'),$(this).attr('data-page'),event);">
  29. <h5><i class="far fa-sticky-note"></i> <?php echo $page->label; ?></h5>
  30. <small class="wiki-small">
  31. <span class="font-weight-bold"><i class="<?php echo $page->join('category')->icon; ?>"></i> <?php echo $page->join('category')->label; ?></span>
  32. <?php if($page->created == $page->updated): ?>
  33. <span> - Ajouté <?php echo $page->created(); ?> par <i class="far fa-meh-blank"></i> <?php echo $page->author(); ?></span>
  34. <?php else: ?>
  35. <span> - Edité <?php echo $page->updated(); ?> par <i class="far fa-meh-blank"></i> <?php echo $page->updater(); ?></span>
  36. <?php endif; ?>
  37. </small>
  38. </li>
  39. <?php endforeach; ?>
  40. </ul>
  41. </div>
  42. <?php endif; ?>
  43. <div class="clear"></div>