aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorEvan Winslow <evan.b.winslow@gmail.com>2010-10-21 18:45:20 +0000
committerEvan Winslow <evan.b.winslow@gmail.com>2010-10-21 18:45:20 +0000
commit42db97f9d404179f1d7f4059c891fca7766e482e (patch)
treef4236c4533281ba34ff55e4305d653be0e09004b /views
parent9ff9d71952db26c06fe2eb1bf98b53340242e524 (diff)
downloadelgg-42db97f9d404179f1d7f4059c891fca7766e482e.tar.gz
elgg-42db97f9d404179f1d7f4059c891fca7766e482e.tar.bz2
Fixed issue with input/form and added output/friendlytime (uses <time> element now)
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>";