Elgg  Version 3.0
time.php
Go to the documentation of this file.
1 <?php
2 
16 $entity = elgg_extract('entity', $vars);
17 if (!$entity instanceof ElggEntity) {
18  return;
19 }
20 
22 if (!isset($time)) {
23  $time = $entity->time_created;
24 }
25 if (!$time) {
26  return;
27 }
28 
30 $time_href = elgg_extract('time_href', $vars);
31 if (!empty($time_href)) {
32  $content = elgg_view('output/url', [
33  'href' => $time_href,
34  'text' => $content,
35  'is_trusted' => true,
36  ]);
37 }
38 
39 echo elgg_view('object/elements/imprint/element', [
40  'icon_name' => elgg_extract('time_icon', $vars, 'history'),
41  'content' => $content,
42  'class' => 'elgg-listing-time',
43 ]);
$vars['class']
Elgg time input Displays a select field with time options.
Definition: time.php:16
if(!$entity instanceof ElggEntity) $time
Definition: time.php:21
$time_href
Definition: time.php:30
elgg echo
Translates a string.
Definition: languages.js:43
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:1131
$entity
Displays information the time of the post.
Definition: time.php:16
if(!isset($time)) if(!$time) $content
Definition: time.php:29
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1120