From: pcanterino <> Date: Thu, 5 May 2005 15:18:22 +0000 (+0000) Subject: - Changed names of some {IF} blocks (make use of negations) X-Git-Tag: version_3_0~29 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/3e5f525985e4357d65f2c3aab4f502107408d5c8?hp=d67f6ce936647c7312b944d2d2c0c0da13352e1f - Changed names of some {IF} blocks (make use of negations) - Don't show the "Copy" link if a file is not readable --- diff --git a/modules/Command.pm b/modules/Command.pm index 42da15d..1c5afa0 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -178,9 +178,9 @@ sub exec_show($$) $ftpl->fillin('URL',equal_url(encode_html($config->{'httproot'}),$virt_path->{'html'})); $ftpl->parse_if_block('link',-l $phys_path); - $ftpl->parse_if_block('not_readable',not -r $phys_path); + $ftpl->parse_if_block('readable',-r $phys_path); + $ftpl->parse_if_block('writeable',-w $phys_path); $ftpl->parse_if_block('binary',-B $phys_path); - $ftpl->parse_if_block('readonly',not -w $phys_path); $ftpl->parse_if_block('viewable',(-r $phys_path && -T $phys_path && not $too_large) || -l $phys_path); $ftpl->parse_if_block('editable',(-r $phys_path && -w $phys_path && -T $phys_path && not $too_large) && not -l $phys_path); diff --git a/templates/dirlist_file.htm b/templates/dirlist_file.htm index 99e2ae1..60c359b 100644 --- a/templates/dirlist_file.htm +++ b/templates/dirlist_file.htm @@ -2,5 +2,5 @@ {SIZE} {DATE}{IF gmt} (GMT){ENDIF} {FILE_NAME} -({IF viewable}View{ELSE}View{ENDIF} | {IF editable}Edit{ELSE}Edit{ENDIF}{IF !link} | Copy{ENDIF}{IF dir_writeable} | Rename | Delete{ENDIF} |{IF !link}{IF users} Chmod/Chgrp |{ENDIF}{ENDIF} View in Browser) +({IF viewable}View{ELSE}View{ENDIF} | {IF editable}Edit{ELSE}Edit{ENDIF}{IF !link}{IF readable} | Copy{ENDIF}{ENDIF}{IF dir_writeable} | Rename | Delete{ENDIF} |{IF !link}{IF users} Chmod/Chgrp |{ENDIF}{ENDIF} View in Browser)