Elgg  Version 5.1
title.php
Go to the documentation of this file.
1 <?php
9 $title = elgg_extract('title', $vars, '');
10 if ($title === false) {
11  return;
12 }
13 
14 $relationship = elgg_extract('relationship', $vars);
15 if ($title === '' && $relationship instanceof ElggRelationship) {
18  if (empty($entity_one) || empty($entity_two)) {
19  return;
20  }
21 
22  $key = false;
23  $keys = [
24  "relationship:{$relationship->relationship}",
25  'relationship:default',
26  ];
27  foreach ($keys as $try_key) {
28  if (elgg_language_key_exists($try_key)) {
29  $key = $try_key;
30  break;
31  }
32  }
33 
34  if (!empty($key)) {
36  }
37 }
38 
39 echo elgg_format_element('div', ['class' => [
40  'elgg-listing-summary-title',
41 ]], $title);
$title
Output annotation title.
Definition: title.php:9
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$keys
Definition: access.php:31
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
$entity_two
Definition: summary.php:23
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:67
if($title===false) $relationship
Definition: title.php:14
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
if(!$relationship instanceof ElggRelationship) $entity_one
Definition: icon.php:34
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
Definition: views.php:1498