version 1.181, 2010/09/01 23:58:40
|
version 1.190, 2012/12/30 16:05:16
|
Line 261 sub real_handler {
|
Line 261 sub real_handler {
|
my $uri = shift; |
my $uri = shift; |
if (!defined($uri)) { $uri = $r->uri(); } |
if (!defined($uri)) { $uri = $r->uri(); } |
$env{'request.uri'} = $uri; |
$env{'request.uri'} = $uri; |
my $filename = '/home/httpd/html' . $uri; |
my $filename = $r->dir_config('lonDocRoot').$uri; |
my $fh = Apache::File->new($filename); |
my $fh = Apache::File->new($filename); |
my $file; |
my $file; |
read $fh, $file, 100000000; |
read $fh, $file, 100000000; |
Line 1476 BUTTONS
|
Line 1476 BUTTONS
|
HTML::Entities::encode($choice->[1],"<>&\"'") |
HTML::Entities::encode($choice->[1],"<>&\"'") |
. "'"; |
. "'"; |
if ($checkedChoices{$choice->[1]}) { |
if ($checkedChoices{$choice->[1]}) { |
$result .= " checked='checked' "; |
$result .= " checked='checked'"; |
} |
} |
$result .= qq{id="id$id"}; |
$result .= qq{ id="id$id"}; |
my $choiceLabel = $choice->[0]; |
my $choiceLabel = $choice->[0]; |
if ($choice->[3]) { # if we need to evaluate this choice |
if ($choice->[3]) { # if we need to evaluate this choice |
$choiceLabel = "sub { my $helper = shift; my $state = shift;" . |
$choiceLabel = "sub { my $helper = shift; my $state = shift;" . |
Line 1486 BUTTONS
|
Line 1486 BUTTONS
|
$choiceLabel = eval($choiceLabel); |
$choiceLabel = eval($choiceLabel); |
$choiceLabel = &$choiceLabel($helper, $self); |
$choiceLabel = &$choiceLabel($helper, $self); |
} |
} |
$result .= "/></td><td> ".qq{<label for="id$id">}. |
$result .= " /></td><td> ".qq{<label for="id$id">}. |
$choiceLabel. "</label></td>"; |
$choiceLabel. "</label></td>"; |
if ($choice->[4]) { |
if ($choice->[4]) { |
$result .='<td><input type="text" size="5" name="' |
$result .='<td><input type="text" size="5" name="' |
Line 1913 CHECK
|
Line 1913 CHECK
|
if ($anytime) { |
if ($anytime) { |
$result.=' checked="checked" ' |
$result.=' checked="checked" ' |
} |
} |
$result.="name='${var}anytime'/>".&mt('Any time').'</label>' |
my $anytimetext = &mt('Any time'); |
|
if (($var eq 'startreserve') || ($var eq 'endreserve')) { |
|
$anytimetext = &mt('Any time before slot starts'); |
|
} elsif (($var eq 'startunique') || ($var eq 'endunique')) { |
|
$anytimetext = &mt('No restriction on uniqueness'); |
|
} |
|
$result.="name='${var}anytime'/>".$anytimetext.'</label>' |
} |
} |
return $result; |
return $result; |
|
|
Line 2534 RADIO
|
Line 2540 RADIO
|
'closeAllPages' => $self->{'closeallpages'}, |
'closeAllPages' => $self->{'closeallpages'}, |
'suppressEmptySequences' => $self->{'suppressEmptySequences'}, |
'suppressEmptySequences' => $self->{'suppressEmptySequences'}, |
'include_top_level_map' => $self->{'include_top_level_map'}, |
'include_top_level_map' => $self->{'include_top_level_map'}, |
'iterator_map' => $mapUrl } |
'iterator_map' => $mapUrl, |
|
'map_no_edit_link' => 1, } |
); |
); |
|
|
$result .= $buttons; |
$result .= $buttons; |
Line 2971 BUTTONS
|
Line 2978 BUTTONS
|
} |
} |
|
|
# Get the list of files in this directory. |
# Get the list of files in this directory. |
my @fileList; |
my (@fileList,$listref,$listerror); |
|
|
# If the subdirectory is in local CSTR space |
# If the subdirectory is in local CSTR space |
my $metadir; |
my $metadir; |
if ($subdir =~ m|/home/([^/]+)/public_html/(.*)|) { |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my ($user,$domain)= |
if ($subdir =~ m{^(?:\Q$londocroot\E)*/priv/[^/]+/[^/]+/(.*)$}) { |
&Apache::loncacc::constructaccess($subdir, |
my $innerpath=$1; |
$Apache::lonnet::perlvar{'lonDefDomain'}); |
unless ($subdir=~m{^\Q$londocroot\E}) { |
$metadir='/res/'.$domain.'/'.$user.'/'.$2; |
$subdir=$londocroot.$subdir; |
@fileList = &Apache::lonnet::dirlist($subdir,$domain,$user,undef,undef,'/'); |
} |
} elsif ($subdir =~ m|^~([^/]+)/(.*)$|) { |
|
$subdir='/home/'.$1.'/public_html/'.$2; |
|
my ($user,$domain)= |
my ($user,$domain)= |
&Apache::loncacc::constructaccess($subdir, |
&Apache::lonnet::constructaccess($subdir); |
$Apache::lonnet::perlvar{'lonDefDomain'}); |
$metadir='/res/'.$domain.'/'.$user.'/'.$innerpath; |
$metadir='/res/'.$domain.'/'.$user.'/'.$2; |
($listref,$listerror) = |
@fileList = &Apache::lonnet::dirlist($subdir,$domain,$user,undef,undef,'/'); |
&Apache::lonnet::dirlist($subdir,$domain,$user,undef,undef,'/'); |
} else { |
} else { |
# local library server resource space |
# local library server resource space |
@fileList = &Apache::lonnet::dirlist($subdir,$env{'user.domain'},$env{'user.name'},undef,undef,'/'); |
($listref,$listerror) = |
|
&Apache::lonnet::dirlist($subdir,$env{'user.domain'},$env{'user.name'},undef,undef,'/'); |
} |
} |
|
|
# Sort the fileList into order |
# Sort the fileList into order |
@fileList = sort {lc($a) cmp lc($b)} @fileList; |
if (ref($listref) eq 'ARRAY') { |
|
@fileList = sort {lc($a) cmp lc($b)} @{$listref}; |
|
} |
|
|
$result .= $buttons; |
$result .= $buttons; |
|
|
Line 3089 sub fileState {
|
Line 3097 sub fileState {
|
} |
} |
my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $subdirpart = $constructionSpaceDir; |
my $subdirpart = $constructionSpaceDir; |
$subdirpart =~ s/^\/home\/$uname\/public_html//; |
$subdirpart =~ s{^\Q$docroot/priv/$udom/$uname\E}{}; |
my $resdir = $docroot . '/res/' . $udom . '/' . $uname . |
my $resdir = $docroot . '/res/' . $udom . '/' . $uname . |
$subdirpart; |
$subdirpart; |
|
|
Line 3364 sub render {
|
Line 3372 sub render {
|
$result .= '<p><font color="#FF0000">' . $self->{ERROR_MSG} . '</font></p>'; |
$result .= '<p><font color="#FF0000">' . $self->{ERROR_MSG} . '</font></p>'; |
} |
} |
|
|
$result .= '<input type="string" name="' . $self->{'variable'} . '_forminput"'; |
$result .= '<input type="text" name="' . $self->{'variable'} . '_forminput"'; |
|
|
if (defined($self->{'size'})) { |
if (defined($self->{'size'})) { |
$result .= ' size="' . $self->{'size'} . '"'; |
$result .= ' size="' . $self->{'size'} . '"'; |