aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/input/form.php6
-rw-r--r--views/default/output/friendlytime.php12
2 files changed, 15 insertions, 3 deletions
diff --git a/views/default/input/form.php b/views/default/input/form.php
index 565db3afe..364e13f86 100644
--- a/views/default/input/form.php
+++ b/views/default/input/form.php
@@ -20,14 +20,14 @@ $defaults = array(
$vars = array_merge($defaults, $vars);
+$body = $vars['body'];
+unset($vars['body']);
+
if ($vars['disable_security'] != TRUE) {
$body .= elgg_view('input/securitytoken');
}
unset($vars['disable_security']);
-$body = $vars['body'];
-unset($vars['body']);
-
$attributes = html5_get_html_attributes($vars);
echo "<form $attributes>$body</form>";
diff --git a/views/default/output/friendlytime.php b/views/default/output/friendlytime.php
new file mode 100644
index 000000000..3618e7f56
--- /dev/null
+++ b/views/default/output/friendlytime.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Friendly time
+ * Translates an epoch time into a human-readable time.
+ *
+ * @uses string $vars['time'] Unix-style epoch timestamp
+ */
+
+$friendly_time = elgg_get_friendly_time($vars['time']);
+$timestamp = htmlentities(date(elgg_echo('friendlytime:date_format'), $vars['time']));
+
+echo "<time title=\"$timestamp\" class=\"timestamp\">$friendly_time</time>";