default.php 868 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Elgg default annotation view
  4. *
  5. * @note To add or remove from the annotation menu, register handlers for the menu:annotation hook.
  6. *
  7. * @uses $vars['annotation']
  8. */
  9. $annotation = $vars['annotation'];
  10. $owner = get_entity($annotation->owner_guid);
  11. if (!$owner) {
  12. return true;
  13. }
  14. $icon = elgg_view_entity_icon($owner, 'tiny');
  15. $owner_link = "<a href=\"{$owner->getURL()}\">$owner->name</a>";
  16. $menu = elgg_view_menu('annotation', array(
  17. 'annotation' => $annotation,
  18. 'sort_by' => 'priority',
  19. 'class' => 'elgg-menu-hz float-alt',
  20. ));
  21. $text = elgg_view("output/longtext", array("value" => $annotation->value));
  22. $friendlytime = elgg_view_friendly_time($annotation->time_created);
  23. $body = <<<HTML
  24. <div class="mbn">
  25. $menu
  26. $owner_link
  27. <span class="elgg-subtext">
  28. $friendlytime
  29. </span>
  30. $text
  31. </div>
  32. HTML;
  33. echo elgg_view_image_block($icon, $body);