Elgg  Version 4.3
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 if (!$time) {
27  return;
28 }
29 
31 $time_href = elgg_extract('time_href', $vars);
32 if (!empty($time_href)) {
34 }
35 
36 echo elgg_view('object/elements/imprint/element', [
37  'icon_name' => elgg_extract('time_icon', $vars, 'history'),
38  'content' => $content,
39  'class' => 'elgg-listing-time',
40 ]);
$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
$time_href
Definition: time.php:27
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
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:859
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1513
$entity
Displays information the time of the post.
Definition: time.php:15
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179