Elgg  Version 3.0
metadata.php
Go to the documentation of this file.
1 <?php
2 
10 $metadata = elgg_extract('metadata', $vars);
11 if (!isset($metadata)) {
12  $metadata = '';
13 
14  $show_entity_menu = elgg_extract('show_entity_menu', $vars, true);
15  $show_social_menu = elgg_extract('show_social_menu', $vars, true);
16 
17  if ($show_entity_menu) {
18  $metadata .= elgg_view_menu('entity', [
19  'entity' => elgg_extract('entity', $vars),
20  'handler' => elgg_extract('handler', $vars),
21  ]);
22  }
23 
24  if ($show_social_menu && !elgg_in_context('admin')) {
25  $metadata .= elgg_view_menu('social', [
26  'entity' => elgg_extract('entity', $vars),
27  'handler' => elgg_extract('handler', $vars),
28  'class' => 'elgg-menu-hz',
29  ]);
30  }
31 }
32 
33 if (!$metadata) {
34  return;
35 }
36 
38  'class' => [
39  'elgg-listing-summary-metadata',
40  ]
41 ], $metadata);
$metadata
Outputs object metadata $vars[&#39;metadata&#39;] Metadata/menu $vars[&#39;show_entity_menu&#39;] Show the entity m...
Definition: metadata.php:10
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:755
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:238
elgg echo
Translates a string.
Definition: languages.js:43
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
$vars['type']
Definition: save.php:11