page.home.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. list($category,$page) = explode('/', $conf->get('wiki_home'));
  10. $category = WikiCategory::load(array('slug'=>$category));
  11. if($home = WikiPage::load(array('category'=>$category->id,'slug'=>$page)))
  12. $home->content();
  13. ?>
  14. <div class="wiki-home-page">
  15. <?php echo $home?$home->html():''; ?>
  16. </div>
  17. <?php endif; ?>
  18. <?php if(count($updated) == 0): ?>
  19. <p>Aucune activitée enregistrée...<p>
  20. <?php else: ?>
  21. <div class="wiki-home-activity">
  22. <h3 class="wiki-title">Récemment Ajouté / Modifié </h3>
  23. <ul class="category-recent">
  24. <?php foreach($updated as $page): ?>
  25. <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);">
  26. <h5><i class="far fa-sticky-note"></i> <?php echo $page->label; ?></h5>
  27. <small class="wiki-small">
  28. <span class="font-weight-bold"><i class="<?php echo $page->join('category')->icon; ?>"></i> <?php echo $page->join('category')->label; ?></span>
  29. <?php if($page->created == $page->updated): ?>
  30. <span> - Ajouté <?php echo $page->created(); ?> par <i class="far fa-meh-blank"></i> <?php echo $page->author(); ?></span>
  31. <?php else: ?>
  32. <span> - Edité <?php echo $page->updated(); ?> par <i class="far fa-meh-blank"></i> <?php echo $page->updater(); ?></span>
  33. <?php endif; ?>
  34. </small>
  35. </li>
  36. <?php endforeach; ?>
  37. </ul>
  38. </div>
  39. <?php endif; ?>
  40. <div class="clear"></div>