-
Notifications
You must be signed in to change notification settings - Fork 6
/
last_saved.mc
66 lines (45 loc) · 1.36 KB
/
last_saved.mc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<%doc>
=head1 NAME
last_saved.mc -- Returns the last time a story was saved
=head1 SYNOPSIS
<h3>Last Updated: <& /util/text/last_saved.mc &></h3>
<& /util/text/last_saved.mc,
asset => $story,
format => '%Y-%m-%dT%T'
&>
=head1 DESCRIPTION
Outputs the date and/or time that a story was last saved in the UI.
This is useful if you want to display a "Last Modified" timestamp
that is not affected by republishes. The supported parameters are
all optional, and are as follows:
=over 4
=item C<$asset>
The asset from which to get the time of the last save. Useful for
getting the time for a related story or media asset. Defaults to the
global C<$story> object.
=item C<$format>
The C<strftime> formatting string used to format the date. Defaults
to the value of the "Date/Time Format" preference.
=back
=head1 AUTHORS
David Wheeler <[email protected]>
Marshall Roch <[email protected]>
=head1 COPYRIGHT AND LICENSE
Copyright 2004 by the Bricolage Development Team.
This template is free software; you can redistribute it and/or modify it under
the same terms as Bricolage itself.
=cut
</%doc>
<%args>
$format => undef
$asset => $story
</%args>
<%init>;
# Output the timestamp.
my $event = Bric::Util::Event->list({
obj_id => $asset->get_id,
key_name => 'story_save'
});
$m->print($event->[-1]->get_timestamp($format));
return 1;
</%init>