Elgg  Version 3.0
default.php
Go to the documentation of this file.
1 <?php
10 $annotation = elgg_extract('annotation', $vars);
11 
12 $owner = get_entity($annotation->owner_guid);
13 if (!$owner) {
14  return true;
15 }
17 $owner_link = elgg_view('output/url', [
18  'text' => $owner->getDisplayName(),
19  'href' => $owner->getURL(),
20  'is_trusted' => true,
21 ]);
22 
23 $menu = elgg_view_menu('annotation', [
24  'annotation' => $annotation,
25  'class' => 'elgg-menu-hz float-alt',
26 ]);
27 
28 $text = elgg_view("output/longtext", ["value" => $annotation->value]);
29 
31 
32 $body = <<<HTML
33 <div class="mbn">
34  $menu
36  <span class="elgg-subtext">
38  </span>
39  $text
40 </div>
41 HTML;
42 
$annotation
Elgg default annotation view.
Definition: default.php:10
$friendlytime
Definition: default.php:30
$owner_link
Definition: default.php:17
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
Definition: views.php:899
if(!$owner) $icon
Definition: default.php:16
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:1177
$text
Definition: default.php:28
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:755
elgg echo
Translates a string.
Definition: languages.js:43
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:27
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
$menu
Definition: default.php:23
$owner
Definition: default.php:12
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$body
Definition: default.php:32
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1120
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:87