Elgg  Version master
metadata.php
Go to the documentation of this file.
1 <?php
9 $metadata = elgg_extract('metadata', $vars, '');
10 if ($metadata === false) {
11  return;
12 }
13 
14 $annotation = elgg_extract('annotation', $vars);
15 if ($metadata === '' && $annotation instanceof ElggAnnotation) {
16  $metadata = elgg_view_menu('annotation', [
17  'annotation' => $annotation,
18  'class' => 'elgg-menu-hz',
19  'prepare_dropdown' => true,
20  ]);
21 }
22 
24  return;
25 }
26 
27 echo elgg_format_element('div', ['class' => [
28  'elgg-listing-summary-metadata',
29 ]], $metadata);
Entity Annotation.
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:176
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:441
$vars
Definition: theme.php:5
$metadata
Output annotation metadata.
Definition: metadata.php:9
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
if($metadata===false) $annotation
Definition: metadata.php:14