From: pcanterino <> Date: Thu, 20 Jan 2005 15:20:15 +0000 (+0000) Subject: - Allow to use Greenwich Mean Time in date strings (maybe someone needs it) X-Git-Tag: version_2_3_1~14 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/c1bfe3c380707e7cc6b0582b63f31a77d6f8751a?ds=inline - Allow to use Greenwich Mean Time in date strings (maybe someone needs it) - Changed the order of the configuration options a little bit --- diff --git a/devedit.dat b/devedit.dat index c2b2d8b..05762ca 100644 --- a/devedit.dat +++ b/devedit.dat @@ -5,13 +5,16 @@ fileroot = D:/WWW/dokumente/devedit-test httproot = /devedit-test/ + +max_file_size = 100000 + timeformat = %d.%m.%Y %H:%M +use_gmt = 0 + uselist_file = uselist lock_file = uselist.lock lock_timeout = 10 -max_file_size = 100000 - error_file = errors.dat template_file = templates.dat diff --git a/modules/Command.pm b/modules/Command.pm index bb335dd..e06d0b6 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2005-01-06 +# Last modified: 2005-01-20 # use strict; @@ -128,6 +128,8 @@ sub exec_show($$) $udtpl->fillin('UPPER_DIR',$upper_path); $udtpl->fillin('DATE',encode_entities(strftime($config->{'timeformat'},localtime($stat[9])))); + $udtpl->parse_if_block('gmt',$config->{'use_gmt'}); + $dirlist .= $udtpl->get_template; } @@ -147,12 +149,14 @@ sub exec_show($$) $dtpl->fillin('DIR',$virt_path); $dtpl->fillin('DIR_NAME',encode_entities($dir)); - $dtpl->fillin('DATE',encode_entities(strftime($config->{'timeformat'},localtime($stat[9])))); + $dtpl->fillin('DATE',encode_entities(strftime($config->{'timeformat'},($config->{'use_gmt'}) ? gmtime($stat[9]) : localtime($stat[9])))); $dtpl->fillin('URL',equal_url(encode_entities($config->{'httproot'}),$virt_path)); $dtpl->parse_if_block('readable',-r $phys_path && -x $phys_path); $dtpl->parse_if_block('users',$users && -o $phys_path); + $dtpl->parse_if_block('gmt',$config->{'use_gmt'}); + $dirlist .= $dtpl->get_template; } @@ -175,7 +179,7 @@ sub exec_show($$) $ftpl->fillin('FILE',$virt_path); $ftpl->fillin('FILE_NAME',encode_entities($file)); $ftpl->fillin('SIZE',$stat[7]); - $ftpl->fillin('DATE',encode_entities(strftime($config->{'timeformat'},localtime($stat[9])))); + $ftpl->fillin('DATE',encode_entities(strftime($config->{'timeformat'},($config->{'use_gmt'}) ? gmtime($stat[9]) : localtime($stat[9])))); $ftpl->fillin('URL',equal_url(encode_entities($config->{'httproot'}),$virt_path)); $ftpl->parse_if_block('not_readable',not -r $phys_path); @@ -190,6 +194,8 @@ sub exec_show($$) $ftpl->parse_if_block('too_large',$config->{'max_file_size'} && $stat[7] > $config->{'max_file_size'}); + $ftpl->parse_if_block('gmt',$config->{'use_gmt'}); + $ftpl->parse_if_block('users',$users && -o $phys_path); $dirlist .= $ftpl->get_template; @@ -912,7 +918,9 @@ sub exec_about($$) $tpl->fillin('HTTPD',encode_entities($ENV{'SERVER_SOFTWARE'})); $tpl->fillin('OS', encode_entities($^O)); - $tpl->fillin('TIME', encode_entities(strftime($config->{'timeformat'},localtime))); + $tpl->fillin('TIME', encode_entities(strftime($config->{'timeformat'},($config->{'use_gmt'}) ? gmtime : localtime))); + + $tpl->parse_if_block('gmt',$config->{'use_gmt'}); # Process information diff --git a/templates/about.htm b/templates/about.htm index c2efd1b..5ad69fc 100644 --- a/templates/about.htm +++ b/templates/about.htm @@ -194,7 +194,7 @@ WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. Server time: -{TIME} +{TIME}{IF gmt} (GMT){ENDIF} diff --git a/templates/dirlist_dir.htm b/templates/dirlist_dir.htm index 2162e2e..4daa787 100644 --- a/templates/dirlist_dir.htm +++ b/templates/dirlist_dir.htm @@ -1,6 +1,6 @@ [SUBDIR] -{DATE} +{DATE}{IF gmt} (GMT){ENDIF} {IF readable}{DIR_NAME}/{ELSE}{DIR_NAME}/{ENDIF} ({IF dir_writeable}Rename | Delete | {ENDIF}{IF users}Chmod/Chgrp | {ENDIF}View in Browser) diff --git a/templates/dirlist_file.htm b/templates/dirlist_file.htm index c688f0e..f08398a 100644 --- a/templates/dirlist_file.htm +++ b/templates/dirlist_file.htm @@ -1,6 +1,6 @@ {SIZE} -{DATE} +{DATE}{IF gmt} (GMT){ENDIF} {FILE_NAME} ({IF viewable}View{ELSE}View{ENDIF} | {IF editable}Edit{ELSE}Edit{ENDIF} | Copy{IF unused}{IF dir_writeable} | Rename | Delete{ENDIF}{ENDIF}{IF in_use} | Unlock{ENDIF} |{IF unused}{IF users} Chmod/Chgrp |{ENDIF}{ENDIF} View in Browser) diff --git a/templates/dirlist_up.htm b/templates/dirlist_up.htm index 0384c0d..44cdce5 100644 --- a/templates/dirlist_up.htm +++ b/templates/dirlist_up.htm @@ -1,5 +1,5 @@ [SUBDIR] -{DATE} +{DATE}{IF gmt} (GMT){ENDIF} ../