# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patrick@patshaping.de>
-# Last modified: 2005-08-01
+# Last modified: 2009-03-31
+#
+# Copyright (C) 1999-2000 Roland Bluethgen, Frank Schoenmann
+# Copyright (C) 2003-2009 Patrick Canterino
+# All Rights Reserved.
+#
+# This file can be distributed and/or modified under the terms of
+# of the Artistic License 1.0 (see also the LICENSE file found at
+# the top level of the Dev-Editor distribution).
#
use strict;
my $dirlist = '';
+ my $count = 0;
+
my $filter1 = $data->{'cgi'}->param('filter') || '*'; # The real wildcard
my $filter2 = ($filter1 && $filter1 ne '*') ? $filter1 : ''; # Wildcard for output
unless($virtual eq '/')
{
+ $count++;
+
my @stat = stat($physical.'/..');
my $udtpl = new Template;
foreach my $dir(@$dirs)
{
+ next if($config->{'hide_dot_files'} && substr($dir,0,1) eq '.');
next unless(dos_wildcard_match($filter1,$dir));
+ $count++;
+
my $phys_path = $physical.'/'.$dir;
my $virt_path = multi_string($virtual.$dir.'/');
$dtpl->parse_if_block('forbidden',is_forbidden_file($config->{'forbidden'},$virt_path->{'normal'}));
$dtpl->parse_if_block('readable',-r $phys_path && -x $phys_path);
$dtpl->parse_if_block('users',$users && -o $phys_path);
+ $dtpl->parse_if_block('even',($count % 2) == 0);
$dirlist .= $dtpl->get_template;
}
foreach my $file(@$files)
{
+ next if($config->{'hide_dot_files'} && substr($file,0,1) eq '.');
next unless(dos_wildcard_match($filter1,$file));
+ $count++;
+
my $phys_path = $physical.'/'.$file;
my $virt_path = multi_string($virtual.$file);
$ftpl->parse_if_block('users',$users && -o $phys_path);
+ $ftpl->parse_if_block('even',($count % 2) == 0);
+
$dirlist .= $ftpl->get_template;
}
if(my $uploaded_file = $cgi->param('uploaded_file'))
{
+ if($cgi->param('remote_file'))
+ {
+ $uploaded_file = $cgi->param('remote_file');
+
+ $uploaded_file =~ s!/!!g;
+ $uploaded_file =~ s!\\!!g;
+ }
+
# Process file upload
my $filename = file_name($uploaded_file);