version 1.180, 2010/05/24 09:21:18
|
version 1.184, 2011/10/25 22:27:11
|
Line 571 sub process {
|
Line 571 sub process {
|
# 4: Render the current state to the screen as an HTML page. |
# 4: Render the current state to the screen as an HTML page. |
sub display { |
sub display { |
my $self = shift; |
my $self = shift; |
|
my $footer = shift; |
my $state = $self->{STATES}{$self->{STATE}}; |
my $state = $self->{STATES}{$self->{STATE}}; |
|
|
my $result = ""; |
my $result = ""; |
Line 606 sub display {
|
Line 606 sub display {
|
# FIXME: This should be parameterized, not concatenated - Jeremy |
# FIXME: This should be parameterized, not concatenated - Jeremy |
|
|
|
|
if (!$state->overrideForm()) { $result.='<form name="helpform" method="post">'; } |
if (!$state->overrideForm()) { $result.='<form name="helpform" method="post" action="">'; } |
if ($stateHelp) { |
if ($stateHelp) { |
$stateHelp = &Apache::loncommon::help_open_topic($stateHelp); |
$stateHelp = &Apache::loncommon::help_open_topic($stateHelp); |
} |
} |
Line 661 sub display {
|
Line 661 sub display {
|
</form> |
</form> |
FOOTER |
FOOTER |
|
|
$result .= &Apache::loncommon::end_page(); |
$result .= $footer.&Apache::loncommon::end_page(); |
# Handle writing out the vars to the file |
# Handle writing out the vars to the file |
my $file = Apache::File->new('>'.$self->{FILENAME}); |
my $file = Apache::File->new('>'.$self->{FILENAME}); |
print $file $self->_varsInFile(); |
print $file $self->_varsInFile(); |
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 2971 BUTTONS
|
Line 2971 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/(.*)|) { |
if ($subdir =~ m|^/home/httpd/html/priv/[^/]+/[^/]+/(.*)$|) { |
my ($user,$domain)= |
my $innerpath=$1; |
&Apache::loncacc::constructaccess($subdir, |
|
$Apache::lonnet::perlvar{'lonDefDomain'}); |
|
$metadir='/res/'.$domain.'/'.$user.'/'.$2; |
|
@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::loncacc::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 3086 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/^\/home\/httpd\/html\/priv\/\Q$udom\E\/\Q$uname\E//; |
my $resdir = $docroot . '/res/' . $udom . '/' . $uname . |
my $resdir = $docroot . '/res/' . $udom . '/' . $uname . |
$subdirpart; |
$subdirpart; |
|
|
Line 3364 sub render {
|
Line 3361 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'} . '"'; |