]> git.p6c8.net - devedit.git/commitdiff
- Allow to use Greenwich Mean Time in date strings (maybe someone needs it)
authorpcanterino <>
Thu, 20 Jan 2005 15:20:15 +0000 (15:20 +0000)
committerpcanterino <>
Thu, 20 Jan 2005 15:20:15 +0000 (15:20 +0000)
- Changed the order of the configuration options a little bit

devedit.dat
modules/Command.pm
templates/about.htm
templates/dirlist_dir.htm
templates/dirlist_file.htm
templates/dirlist_up.htm

index c2b2d8bd18551ffd13aebf5b2da2f88a400d29ae..05762cab47d20ac9f6a3e45c4e26321f84073f83 100644 (file)
@@ -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
 
index bb335dd0b3b36f40c57779642d887f65fe465c74..e06d0b61877b42657b2a5519041c724c91ecc386 100644 (file)
@@ -6,7 +6,7 @@ package Command;
 # Execute Dev-Editor's commands
 #
 # Author:        Patrick Canterino <patrick@patshaping.de>
-# 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
 
index c2efd1b1b658146f3316b8bec8f1ad7c6514dff9..5ad69fc5e8bbcaa53cfa7a83ec76bbae0f3c55b4 100644 (file)
@@ -194,7 +194,7 @@ WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 <tr>
 <td><b>Server time:</b></td>
-<td>{TIME}</td>
+<td>{TIME}{IF gmt} (GMT){ENDIF}</td>
 </tr>
 
 <tr>
index 2162e2e93638e6744ae7cde2d70bf4535cd588cd..4daa787a03eb6cbb71f218b8bac6061feeb5ba6a 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
 <td align="right" style="white-space:nowrap">[SUBDIR]</td>
-<td style="padding-left:15pt;white-space:nowrap;">{DATE}</td>
+<td style="padding-left:15pt;white-space:nowrap;">{DATE}{IF gmt} (GMT){ENDIF}</td>
 <td style="padding-left:15pt;white-space:nowrap;">{IF readable}<a href="{SCRIPT}?command=show&amp;file={DIR}{IF filter}&amp;filter={FILTER_URL}{ENDIF}">{DIR_NAME}/</a>{ELSE}<span style="color:#C0C0C0" title="Not accessible">{DIR_NAME}/</span>{ENDIF}</td>
 <td style="padding-left:15pt;white-space:nowrap;">({IF dir_writeable}<a href="{SCRIPT}?command=rename&amp;file={DIR}">Rename</a> | <a href="{SCRIPT}?command=remove&amp;file={DIR}">Delete</a> | {ENDIF}{IF users}<a href="{SCRIPT}?command=chprop&amp;file={DIR}">Chmod/Chgrp</a> | {ENDIF}<a href="{URL}" target="_blank">View in Browser</a>)</td>
 </tr>
index c688f0e66784099086f406f40743d65a50669e08..f08398ab054db788562dfcda294d1cad9577208f 100644 (file)
@@ -1,6 +1,6 @@
 <tr>
 <td align="right" style="white-space:nowrap">{SIZE}</td>
-<td style="padding-left:15pt;white-space:nowrap;">{DATE}</td>
+<td style="padding-left:15pt;white-space:nowrap;">{DATE}{IF gmt} (GMT){ENDIF}</td>
 <td style="padding-left:15pt;white-space:nowrap;">{FILE_NAME}</td>
 <td style="padding-left:15pt;white-space:nowrap;">({IF viewable}<a href="{SCRIPT}?command=show&amp;file={FILE}">View</a>{ELSE}<span style="color:#C0C0C0" title="{IF not_readable}Not readable{ELSE}{IF binary}Binary file{ELSE}{IF too_large}File too large{ENDIF}{ENDIF}{ENDIF}">View</span>{ENDIF} | {IF editable}<a href="{SCRIPT}?command=beginedit&amp;file={FILE}">Edit</a>{ELSE}<span style="color:#C0C0C0" title="{IF not_readable}Not readable{ELSE}{IF readonly}Read only{ELSE}{IF binary}Binary file{ELSE}{IF too_large}File too large{ENDIF}{IF in_use}In use{ENDIF}{ENDIF}{ENDIF}{ENDIF}">Edit</span>{ENDIF} | <a href="{SCRIPT}?command=copy&amp;file={FILE}">Copy</a>{IF unused}{IF dir_writeable} | <a href="{SCRIPT}?command=rename&amp;file={FILE}">Rename</a> | <a href="{SCRIPT}?command=remove&amp;file={FILE}">Delete</a>{ENDIF}{ENDIF}{IF in_use} | <a href="{SCRIPT}?command=unlock&amp;file={FILE}">Unlock</a>{ENDIF} |{IF unused}{IF users} <a href="{SCRIPT}?command=chprop&amp;file={FILE}">Chmod/Chgrp</a> |{ENDIF}{ENDIF} <a href="{URL}" target="_blank">View in Browser</a>)</td>
 </tr>
index 0384c0d9ff4d718a7263cde532b3512ef9694149..44cdce5165c93630e151b5fb70ed0395a20c0be8 100644 (file)
@@ -1,5 +1,5 @@
 <tr>
 <td align="right" style="white-space:nowrap">[SUBDIR]</td>
-<td style="padding-left:15pt;white-space:nowrap;">{DATE}</td>
+<td style="padding-left:15pt;white-space:nowrap;">{DATE}{IF gmt} (GMT){ENDIF}</td>
 <td colspan="2" style="padding-left:15pt;white-space:nowrap"><a href="{SCRIPT}?command=show&amp;file={UPPER_DIR}{IF filter}&amp;filter={FILTER_URL}{ENDIF}">../</a></td>
 </tr>

patrick-canterino.de