Elgg  Version 4.3
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 
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_language_key_exists($key, $language= 'en')
Check if a given language key exists.
Definition: languages.php:46
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_get_page_owner_guid()
Elgg page owner library.
Definition: pageowner.php:12
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:135
if($info===false) $container
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:547
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:44
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
Definition: views.php:1530
$options
Entity container guid input.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:69