[vhffs-dev] [1050] Object's creation date is now fully displayed in admin part. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1050
Author: beuss
Date: 2007-11-01 08:13:11 +0000 (Thu, 01 Nov 2007)
Log Message:
-----------
Object's creation date is now fully displayed in admin part.
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Object.pm
Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm 2007-10-29 22:23:16 UTC (rev 1049)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm 2007-11-01 08:13:11 UTC (rev 1050)
@@ -76,6 +76,8 @@
sub admin_part
{
+ use DateTime;
+ use DateTime::Locale;
my $panel = shift;
my $object = shift;
@@ -84,8 +86,10 @@
my $vhffs = $panel->{vhffs};
my $templatedir = $panel->{templatedir};
my $user = $panel->{user};
+
+ return undef if( $user->is_admin != 1 );
- return undef if( $user->is_admin != 1 );
+ my $loc = DateTime::Locale->load($user->get_lang);
my $template = new HTML::Template( filename => $templatedir.'/panel/admin/object/editembedded.tmpl' );
@@ -106,7 +110,8 @@
if( defined $object->get_date )
{
- $template->param( VALUE_DATE => $object->get_date );
+ my $dt = DateTime->from_epoch( epoch => $object->get_date, locale => $user->get_lang);
+ $template->param( VALUE_DATE => $dt->strftime($loc->full_date_format.' '.$loc->full_time_format) );
}
else
{
@@ -204,9 +209,6 @@
} else {
my $output = '';
my $history_tmpl = new HTML::Template( filename => $templatedir.'/panel/misc/history_part.tmpl' );
- use DateTime;
- use DateTime::Locale;
- my $loc = DateTime::Locale->load($user->get_lang);
foreach (@{$history}) {
my $dt = DateTime->from_epoch( epoch => $_->{date}, locale => $user->get_lang);
$history_tmpl->param( DATE => $dt->strftime($loc->medium_date_format().' '.$loc->long_time_format() ) );