Elgg  Version master
container_guid.php
Go to the documentation of this file.
1 <?php
13  'name' => 'container_guid',
14  'value' => elgg_get_page_owner_guid(),
15 ];
16 
17 $options = array_merge($options, $vars);
18 
19 echo elgg_view('input/hidden', $options);
20 
21 $info = elgg_extract('container_info', $vars);
22 if ($info === false) {
23  return;
24 }
25 
26 $container = get_entity((int) $options['value']);
27 if (empty($info) && $container instanceof \ElggGroup) {
28  $language_keys = [];
29 
30  $entity_type = elgg_extract('entity_type', $vars);
31  $entity_subtype = elgg_extract('entity_subtype', $vars);
32 
33  if (!empty($entity_type) && !empty($entity_subtype)) {
34  $language_keys[] = "input:container_guid:{$entity_type}:{$entity_subtype}:info";
35  }
36 
37  $language_keys[] = 'input:container_guid:info';
38 
39  foreach ($language_keys as $key) {
40  if (!elgg_language_key_exists($key)) {
41  continue;
42  }
43 
45  break;
46  }
47 }
48 
49 if (empty($info)) {
50  return;
51 }
52 
53 echo elgg_format_element('span', ['class' => 'elgg-subtext'], $info);
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_get_page_owner_guid()
Elgg page owner library.
Definition: pageowner.php:12
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(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_language_key_exists(string $key, string $language= 'en')
Check if a given language key exists.
Definition: languages.php:44
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:68
if($info===false) $container
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:44
$vars
Definition: theme.php:5
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
Definition: views.php:1444
$options
Entity container guid input.