Elgg  Version 6.1
time.php
Go to the documentation of this file.
1 <?php
15 $entity = elgg_extract('entity', $vars);
16 if (!$entity instanceof ElggEntity) {
17  return;
18 }
19 
22 if (!isset($time)) {
23  $time = $entity->time_created;
24  $time_updated = $entity->time_updated;
25 }
26 
27 if (!$time) {
28  return;
29 }
30 
32 $time_href = elgg_extract('time_href', $vars);
33 if (!empty($time_href)) {
35 }
36 
37 echo elgg_view('object/elements/imprint/element', [
38  'icon_name' => elgg_extract('time_icon', $vars, 'history'),
39  'content' => $content,
40  'class' => 'elgg-listing-time',
41 ]);
$vars['class']
Definition: time.php:19
if(!$annotation instanceof ElggAnnotation) $time
Definition: time.php:20
$time_updated
Definition: time.php:21
if(empty($time)) $content
Definition: time.php:25
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:256
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$time_href
Definition: time.php:27
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:832
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1427
$entity
Displays information the time of the post.
Definition: time.php:15