page.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Revision view for history page
  4. *
  5. * @package ElggPages
  6. */
  7. $annotation = $vars['annotation'];
  8. $page = get_entity($annotation->entity_guid);
  9. if (!pages_is_page($page)) {
  10. return;
  11. }
  12. $icon = elgg_view("pages/icon", array(
  13. 'annotation' => $annotation,
  14. 'size' => 'small',
  15. ));
  16. $owner_guid = $annotation->owner_guid;
  17. $owner = get_entity($owner_guid);
  18. if (!$owner) {
  19. return;
  20. }
  21. $owner_link = elgg_view('output/url', array(
  22. 'href' => $owner->getURL(),
  23. 'text' => $owner->name,
  24. 'is_trusted' => true,
  25. ));
  26. $date = elgg_view_friendly_time($annotation->time_created);
  27. $title_link = elgg_view('output/url', array(
  28. 'href' => $annotation->getURL(),
  29. 'text' => $page->title,
  30. 'is_trusted' => true,
  31. ));
  32. $subtitle = elgg_echo('pages:revision:subtitle', array($date, $owner_link));
  33. $body = <<< HTML
  34. <h3>$title_link</h3>
  35. <p class="elgg-subtext">$subtitle</p>
  36. HTML;
  37. if (!elgg_in_context('widgets')) {
  38. $menu = elgg_view_menu('annotation', array(
  39. 'annotation' => $annotation,
  40. 'sort_by' => 'priority',
  41. 'class' => 'elgg-menu-hz float-alt',
  42. ));
  43. }
  44. $body = <<<HTML
  45. <div class="mbn">
  46. $menu
  47. <h3>$title_link</h3>
  48. <span class="elgg-subtext">
  49. $subtitle
  50. </span>
  51. </div>
  52. HTML;
  53. echo elgg_view_image_block($icon, $body);