Commit a07c8d37 authored by Son Nguyen's avatar Son Nguyen
Browse files

Bug 1634591: Show created or last updated date and time

behatnotneeded

Change-Id: I81b1ca00092a4e8bad6807855056bcf79186732e
parent 5c84ffca
......@@ -153,6 +153,8 @@ $string['profilenotshared'] = 'Full access to this user profile is restricted.';
$string['friend'] = 'Friend';
$string['profileicon'] = 'Profile picture';
$string['Updatedon'] = 'Updated on';
$string['Createdon'] = 'Created on';
// general views stuff
$string['Added'] = 'Added';
......
......@@ -5684,6 +5684,13 @@ class View {
}
}
/**
* returns a formatted string about the created or last updated date and time
*/
public function lastchanged_message() {
return (($this->ctime != $this->mtime) ? get_string('Updatedon', 'view') : get_string('Createdon', 'view')) . ' ' . format_date(strtotime($this->mtime));
}
/**
* after editing the view, redirect back to the appropriate place
*/
......
......@@ -194,9 +194,7 @@
</div>
</div>
{if $visitstring}
<div class="metadata text-right">
{$visitstring}
{$lastupdatedstr}{if $visitstring}; {$visitstring}{/if}
</div>
{/if}
{include file="footer.tpl"}
......@@ -369,6 +369,7 @@ if ($view->is_anonymous()) {
$titletext = ($collection && $shownav) ? hsc($collection->get('name')) : $view->display_title(true, false, false);
$smarty->assign('lastupdatedstr', $view->lastchanged_message());
$smarty->assign('visitstring', $view->visit_message());
if ($can_edit) {
$smarty->assign('editurl', get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . ($new ? '&new=1' : ''));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment