Elgg  Version master
byline.php
Go to the documentation of this file.
1 <?php
12 $annotation = elgg_extract('annotation', $vars);
13 if (!$annotation instanceof ElggAnnotation) {
14  return;
15 }
16 
17 $show_links = elgg_extract('show_links', $vars, true);
18 
19 $byline_str = elgg_extract('byline', $vars, false);
20 if ($byline_str === true) {
21  $owner = elgg_extract('byline_owner_entity', $vars, $annotation->getOwnerEntity());
22  if ($owner instanceof ElggEntity) {
23  $owner_text = $show_links ? elgg_view_entity_url($owner) : $owner->getDisplayName();
24 
25  $byline_str = elgg_echo('byline', [$owner_text]);
26  }
27 }
28 
30  return;
31 }
32 
33 echo elgg_view('object/elements/imprint/element', [
34  'content' => $byline_str,
35  'class' => 'elgg-listing-byline',
36 ]);
$owner
Definition: upload.php:7
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
Entity Annotation.
$byline_str
Definition: byline.php:19
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(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$annotation
Displays information about the owner of the annotation.
Definition: byline.php:12
$vars
Definition: theme.php:5
if(!$annotation instanceof ElggAnnotation) $show_links
Definition: byline.php:17
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
Definition: views.php:1444