version 1.484.2.66, 2016/10/31 20:48:30
|
version 1.572, 2013/12/18 23:03:43
|
Line 46 use Apache::lonsimplepage();
|
Line 46 use Apache::lonsimplepage();
|
use HTML::Entities; |
use HTML::Entities; |
use HTML::TokeParser; |
use HTML::TokeParser; |
use GDBM_File; |
use GDBM_File; |
use File::MMagic; |
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Cwd; |
use Cwd; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
Line 196 ENDJS
|
Line 195 ENDJS
|
} else { |
} else { |
&Apache::loncourserespicker::enumerate_course_contents($navmap,\%maps,\%resources,\%titles, |
&Apache::loncourserespicker::enumerate_course_contents($navmap,\%maps,\%resources,\%titles, |
'dumpdocs',$cdom,$cnum); |
'dumpdocs',$cdom,$cnum); |
} |
} |
my @todump = &Apache::loncommon::get_env_multiple('form.archive'); |
my @todump = &Apache::loncommon::get_env_multiple('form.archive'); |
my (%tocopy,%replacehash,%lookup,%deps,%display,%result,%depresult,%simpleproblems,%simplepages, |
my (%tocopy,%replacehash,%lookup,%deps,%display,%result,%depresult,%simpleproblems,%simplepages, |
%newcontent,%has_simpleprobs); |
%newcontent,%has_simpleprobs); |
Line 207 ENDJS
|
Line 206 ENDJS
|
if ($res =~ m{^uploaded/$cdom/$cnum/\E((?:docs|supplemental)/.+)$}) { |
if ($res =~ m{^uploaded/$cdom/$cnum/\E((?:docs|supplemental)/.+)$}) { |
$tocopy{$1} = $name; |
$tocopy{$1} = $name; |
$display{$item} = $1; |
$display{$item} = $1; |
$lookup{$1} = $item; |
$lookup{$1} = $item; |
} elsif ($res eq 'lib/templates/simpleproblem.problem') { |
} elsif ($res eq 'lib/templates/simpleproblem.problem') { |
$simpleproblems{$item} = { |
$simpleproblems{$item} = { |
symb => $resources{$item}, |
symb => $resources{$item}, |
Line 302 ENDJS
|
Line 301 ENDJS
|
if ($contents{content}) { |
if ($contents{content}) { |
$content .= ' |
$content .= ' |
<div class="LC_Box"> |
<div class="LC_Box"> |
<h4 class="LC_hcell">'.&mt('Content').'</h4>'. |
<h4 class="LC_hcell">Content</h4>'. |
$contents{content}.' |
$contents{content}.' |
</div>'; |
</div>'; |
} |
} |
if ($contents{webreferences}) { |
if ($contents{webreferences}) { |
$content .= ' |
$content .= ' |
<div class="LC_Box"> |
<div class="LC_Box"> |
<h4 class="LC_hcell">'.&mt('Web References').'</h4>'. |
<h4 class="LC_hcell">Web References</h4>'. |
$contents{webreferences}.' |
$contents{webreferences}.' |
</div>'; |
</div>'; |
} |
} |
Line 317 $contents{webreferences}.'
|
Line 316 $contents{webreferences}.'
|
</body> |
</body> |
</html> |
</html> |
'; |
'; |
$newcontent{'/'.$simplepages{$item}{res}} = $content; |
$newcontent{'/'.$simplepages{$item}{res}} = $content; |
} |
} |
} |
} |
foreach my $item (keys(%tocopy)) { |
foreach my $item (keys(%tocopy)) { |
unless ($item=~/\.(sequence|page)$/) { |
unless ($item=~/\.(sequence|page)$/) { |
my $currurlpath = $prefix.$item; |
my $currurlpath = $prefix.$item; |
my $currdirpath = &Apache::lonnet::filelocation('',$currurlpath); |
my $currdirpath = &Apache::lonnet::filelocation('',$currurlpath); |
Line 351 $contents{webreferences}.'
|
Line 350 $contents{webreferences}.'
|
if ($simpleproblems{$num}) { |
if ($simpleproblems{$num}) { |
$newfilename=$title.'/'.$simpleproblems{$num}{'name'}; |
$newfilename=$title.'/'.$simpleproblems{$num}{'name'}; |
} else { |
} else { |
$newfilename=$title.'/'.$replacehash{$item}; |
$newfilename=$title.'/'.$replacehash{$item}; |
} |
} |
$newfilename=~s/\.(\w+)$//; |
$newfilename=~s/\.(\w+)$//; |
my $ext=$1; |
my $ext=$1; |
$newfilename=&clean($newfilename); |
$newfilename=&clean($newfilename); |
$newfilename.='.'.$ext; |
$newfilename.='.'.$ext; |
my ($newrelpath) = ($newfilename =~ m{^\Q$title/\E(.+)$}); |
my ($newrelpath) = ($newfilename =~ m{^\Q$title/\E(.+)$}); |
if ($newrelpath ne $replacehash{$item}) { |
if ($newrelpath ne $replacehash{$item}) { |
$replacehash{$item} = $newrelpath; |
$replacehash{$item} = $newrelpath; |
} |
} |
my @dirs=split(/\//,$newfilename); |
my @dirs=split(/\//,$newfilename); |
my $path=$r->dir_config('lonDocRoot')."/priv/$cd/$ca"; |
my $path=$r->dir_config('lonDocRoot')."/priv/$cd/$ca"; |
my $makepath=$path; |
my $makepath=$path; |
my $fail; |
my $fail; |
my $origin; |
my $origin; |
for (my $i=0;$i<$#dirs;$i++) { |
for (my $i=0;$i<$#dirs;$i++) { |
$makepath.='/'.$dirs[$i]; |
$makepath.='/'.$dirs[$i]; |
unless (-e $makepath) { |
unless (-e $makepath) { |
unless(mkdir($makepath,0755)) { |
unless(mkdir($makepath,0755)) { |
$fail = &mt('Directory creation failed.'); |
$fail = &mt('Directory creation failed.'); |
} |
} |
} |
} |
} |
} |
if ($i == 0) { |
if ($i == 0) { |
$result = '<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '; |
$result = '<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '; |
} else { |
} else { |
$depresult .= '<li><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt> '. |
$depresult .= '<li><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt> '. |
'<span class="LC_fontsize_small" style="font-weight: bold;">'. |
'<span class="LC_fontsize_small" style="font-weight: bold;">'. |
&mt('(dependency)').'</span>: '; |
&mt('(dependency)').'</span>: '; |
} |
} |
if (-e $path.'/'.$newfilename) { |
if (-e $path.'/'.$newfilename) { |
$fail = &mt('Destination already exists -- not overwriting.'); |
$fail = &mt('Destination already exists -- not overwriting.'); |
} else { |
} else { |
if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) { |
if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) { |
if (($item =~ m{^/adm/$match_domain/$match_username/\d+/smppg}) || |
if (($item =~ m{^/adm/$match_domain/$match_username/\d+/smppg}) || |
($item =~ /^simpleproblem_/)) { |
($item =~ /^simpleproblem_/)) { |
Line 405 $contents{webreferences}.'
|
Line 404 $contents{webreferences}.'
|
while (my $token = $parser->get_token) { |
while (my $token = $parser->get_token) { |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
if (($token->[1] eq 'resource') && |
if (($token->[1] eq 'resource') && |
($token->[2]->{'src'} eq '/res/lib/templates/simpleproblem.problem') && |
($token->[2]->{'src'} eq '/res/lib/templates/simpleproblem.problem') && |
($changes{$token->[2]->{'id'}})) { |
($changes{$token->[2]->{'id'}})) { |
my $id = $token->[2]->{'id'}; |
my $id = $token->[2]->{'id'}; |
$updatedcontent .= '<'.$token->[1]; |
$updatedcontent .= '<'.$token->[1]; |
foreach my $attrib (@{$token->[3]}) { |
foreach my $attrib (@{$token->[3]}) { |
next unless ($attrib =~ /^(src|type|title|id)$/); |
next unless ($attrib =~ /^(src|type|title|id)$/); |
if ($attrib eq 'src') { |
if ($attrib eq 'src') { |
my ($file) = ($display{$changes{$id}} =~ /^\Qsimpleproblem_\E(.+)$/); |
my ($file) = ($display{$changes{$id}} =~ /^\Qsimpleproblem_\E(.+)$/); |
if ($file) { |
if ($file) { |
$updatedcontent .= ' '.$attrib.'="'.$file.'"'; |
$updatedcontent .= ' '.$attrib.'="'.$file.'"'; |
} else { |
} else { |
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
} |
} |
} else { |
} else { |
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
Line 431 $contents{webreferences}.'
|
Line 430 $contents{webreferences}.'
|
} |
} |
} |
} |
print $fh $updatedcontent; |
print $fh $updatedcontent; |
} else { |
} else { |
print $fh &Apache::lonclonecourse::rewritefile( |
print $fh &Apache::lonclonecourse::rewritefile( |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item), |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item), |
(%replacehash,$crs => '') |
(%replacehash,$crs => '') |
); |
); |
} |
} |
} else { |
} else { |
print $fh |
print $fh |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item); |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item); |
} |
} |
} else { |
} else { |
$fail = &mt('Source does not exist.'); |
$fail = &mt('Source does not exist.'); |
} |
} |
} |
} |
$fh->close(); |
$fh->close(); |
} else { |
} else { |
$fail = &mt('Could not write to destination.'); |
$fail = &mt('Could not write to destination.'); |
} |
} |
} |
} |
my $text; |
my $text; |
if ($fail) { |
if ($fail) { |
$text = '<span class="LC_error">'.&mt('fail').(' 'x3).$fail.'</span>'; |
$text = '<span class="LC_error">'.&mt('fail').(' 'x3).$fail.'</span>'; |
} else { |
} else { |
$text = '<span class="LC_success">'.&mt('ok').'</span>'; |
$text = '<span class="LC_success">'.&mt('ok').'</span>'; |
} |
} |
if ($i == 0) { |
if ($i == 0) { |
$result .= $text; |
$result .= $text; |
} else { |
} else { |
$depresult .= $text.'</li>'; |
$depresult .= $text.'</li>'; |
} |
} |
} |
} |
$r->print($result); |
$r->print($result); |
if ($depresult) { |
if ($depresult) { |
Line 477 $contents{webreferences}.'
|
Line 476 $contents{webreferences}.'
|
$r->rflush(); |
$r->rflush(); |
my ($preamble,$formname); |
my ($preamble,$formname); |
$formname = 'dumpdoc'; |
$formname = 'dumpdoc'; |
unless ($home==1) { |
unless ($home==1) { |
$preamble = '<div class="LC_left_float">'. |
$preamble = '<div class="LC_left_float">'. |
'<fieldset><legend>'. |
'<fieldset><legend>'. |
&mt('Select the Authoring Space'). |
&mt('Select the Authoring Space'). |
'</legend><select name="authorspace">'; |
'</legend><select name="authorspace">'; |
} |
} |
my @orderspaces = (); |
my @orderspaces = (); |
foreach my $key (sort(keys(%outhash))) { |
foreach my $key (sort(keys(%outhash))) { |
if ($key=~/^home_(.+)$/) { |
if ($key=~/^home_(.+)$/) { |
if ($1 eq $env{'user.name'}.':'.$env{'user.domain'}) { |
if ($1 eq $env{'user.name'}.':'.$env{'user.domain'}) { |
unshift(@orderspaces,$1); |
unshift(@orderspaces,$1); |
} else { |
} else { |
push(@orderspaces,$1); |
push(@orderspaces,$1); |
} |
} |
} |
} |
} |
} |
if ($home>1) { |
if ($home>1) { |
$preamble .= '<option value="" selected="selected">'.&mt('Select').'</option>'; |
$preamble .= '<option value="" selected="selected">'.&mt('Select').'</option>'; |
} |
} |
foreach my $user (@orderspaces) { |
foreach my $user (@orderspaces) { |
if ($home==1) { |
if ($home==1) { |
$preamble .= '<input type="hidden" name="authorspace" value="'.$user.'" />'; |
$preamble .= '<input type="hidden" name="authorspace" value="'.$user.'" />'; |
} else { |
} else { |
$preamble .= '<option value="'.$user.'">'.$user.' - '. |
$preamble .= '<option value="'.$user.'">'.$user.' - '. |
&Apache::loncommon::plainname(split(/\:/,$user)).'</option>'; |
&Apache::loncommon::plainname(split(/\:/,$user)).'</option>'; |
} |
} |
} |
} |
unless ($home==1) { |
unless ($home==1) { |
$preamble .= '</select></fieldset></div>'."\n"; |
$preamble .= '</select></fieldset></div>'."\n"; |
} |
} |
my $title=$origcrsdata{'description'}; |
my $title=$origcrsdata{'description'}; |
$title=~s/[\/\s]+/\_/gs; |
$title=~s/[\/\s]+/\_/gs; |
$title=&clean($title); |
$title=&clean($title); |
$preamble .= '<div class="LC_left_float">'. |
$preamble .= '<div class="LC_left_float">'. |
'<fieldset><legend>'.&mt('Folder in Authoring Space').'</legend>'. |
'<fieldset><legend>'.&mt('Folder in Authoring Space').'</legend>'. |
'<input type="text" size="50" name="authorfolder" value="'. |
'<input type="text" size="50" name="authorfolder" value="'. |
$title.'" />'. |
$title.'" />'. |
'</fieldset></div><div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"; |
'</fieldset></div><div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"; |
my %uploadedfiles; |
my %uploadedfiles; |
&tiehash(); |
&tiehash(); |
foreach my $file (&Apache::lonclonecourse::crsdirlist($origcrsid,'userfiles')) { |
foreach my $file (&Apache::lonclonecourse::crsdirlist($origcrsid,'userfiles')) { |
my ($ext)=($file=~/\.(\w+)$/); |
my ($ext)=($file=~/\.(\w+)$/); |
# FIXME Check supplemental here |
# FIXME Check supplemental here |
my $title=$hash{'title_'.$hash{ |
my $title=$hash{'title_'.$hash{ |
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$file}}; |
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$file}}; |
if (!$title) { |
if (!$title) { |
$title=$file; |
$title=$file; |
} else { |
} else { |
$title=~s|/|_|g; |
$title=~s|/|_|g; |
} |
} |
$title=~s/\.(\w+)$//; |
$title=~s/\.(\w+)$//; |
$title=&clean($title); |
$title=&clean($title); |
$title.='.'.$ext; |
$title.='.'.$ext; |
# $r->print("\n<td><input type='text' size='60' name='namefor_".$file."' value='".$title."' /></td>" |
# $r->print("\n<td><input type='text' size='60' name='namefor_".$file."' value='".$title."' /></td>" |
$uploadedfiles{$file} = $title; |
$uploadedfiles{$file} = $title; |
} |
} |
&untiehash(); |
&untiehash(); |
$r->print(&Apache::loncourserespicker::create_picker($navmap,'dumpdocs',$formname,$crstype,undef, |
$r->print(&Apache::loncourserespicker::create_picker($navmap,'dumpdocs',$formname,$crstype,undef, |
undef,undef,$preamble,$home,\%uploadedfiles)); |
undef,undef,$preamble,$home,\%uploadedfiles)); |
} |
} |
Line 564 sub recurse_html {
|
Line 563 sub recurse_html {
|
} else { |
} else { |
$relfile = $dependency; |
$relfile = $dependency; |
$depurl = $currurlpath; |
$depurl = $currurlpath; |
$depurl =~ s{[^/]+$}{}; |
$depurl =~ s{[^/]+$}{}; |
$depurl .= $dependency; |
$depurl .= $dependency; |
($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); |
($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); |
} |
} |
next if ($relfile eq ''); |
next if ($relfile eq ''); |
my $newname = $replacehash->{$container}; |
my $newname = $replacehash->{$container}; |
$newname =~ s{[^/]+$}{}; |
$newname =~ s{[^/]+$}{}; |
$replacehash->{$newcontainer} = $newname.$relfile; |
$replacehash->{$newcontainer} = $newname.$relfile; |
$deps->{$item}{$newcontainer} = 1; |
$deps->{$item}{$newcontainer} = 1; |
my ($newurlpath) = ($depurl =~ m{^(.*)/[^/]+$}); |
my ($newurlpath) = ($depurl =~ m{^(.*)/[^/]+$}); |
my $depfile = &Apache::lonnet::filelocation('',$depurl); |
my $depfile = &Apache::lonnet::filelocation('',$depurl); |
my $type = $mm->checktype_filename($depfile); |
my $type = $mm->checktype_filename($depfile); |
if ($type eq 'text/html') { |
if ($type eq 'text/html') { |
Line 652 sub group_import {
|
Line 651 sub group_import {
|
} else { |
} else { |
$fname =~ s/\W/_/g; |
$fname =~ s/\W/_/g; |
} |
} |
if (length($fname) > 15) { |
if (length($fname > 15)) { |
$fname = substr($fname,0,14); |
$fname = substr($fname,0,14); |
} |
} |
my $initialtext = &mt('Replace with your own content.'); |
my $initialtext = &mt('Replace with your own content.'); |
Line 667 $initialtext
|
Line 666 $initialtext
|
</html> |
</html> |
END |
END |
$env{'form.output'}=$newhtml; |
$env{'form.output'}=$newhtml; |
my $result = |
my $result = |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
'output', |
'output', |
"$filepath/$residx/$fname.html"); |
"$filepath/$residx/$fname.html"); |
Line 692 END
|
Line 691 END
|
removefrommap => \%removefrommap, |
removefrommap => \%removefrommap, |
removeparam => \%removeparam, |
removeparam => \%removeparam, |
); |
); |
my ($result,$msgsarray,$lockerror) = |
my ($result,$msgsarray,$lockerror) = |
&apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated); |
&apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated); |
if (keys(%import_errors) > 0) { |
if (keys(%import_errors) > 0) { |
$fixuperrors = |
$fixuperrors = |
Line 977 sub docs_change_log {
|
Line 976 sub docs_change_log {
|
|
|
sub update_paste_buffer { |
sub update_paste_buffer { |
my ($coursenum,$coursedom,$folder) = @_; |
my ($coursenum,$coursedom,$folder) = @_; |
my (@possibles,%removals,%cuts,$output); |
my (@possibles,%removals,%cuts); |
if ($env{'form.multiremove'}) { |
if ($env{'form.multiremove'}) { |
$env{'form.multiremove'} =~ s/,$//; |
$env{'form.multiremove'} =~ s/,$//; |
map { $removals{$_} = 1; } split(/,/,$env{'form.multiremove'}); |
map { $removals{$_} = 1; } split(/,/,$env{'form.multiremove'}); |
Line 1045 sub update_paste_buffer {
|
Line 1044 sub update_paste_buffer {
|
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url})); |
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url})); |
my ($suffix,$errortxt,$locknotfreed) = |
my ($suffix,$errortxt,$locknotfreed) = |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
if ($suffix ne '') { |
push(@newpaste,$suffix); |
push(@newpaste,$suffix); |
if ($locknotfreed) { |
} else { |
return $locknotfreed; |
if ($locknotfreed) { |
last; |
return $locknotfreed; |
|
} |
|
} |
} |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
&Apache::lonnet::appenv({'docs.markedcopy_supplemental_'.$suffix => $title}); |
&Apache::lonnet::appenv({'docs.markedcopy_supplemental_'.$suffix => $title}); |
Line 1084 sub update_paste_buffer {
|
Line 1081 sub update_paste_buffer {
|
} |
} |
} |
} |
} |
} |
if ($locknotfreed) { |
|
$output = $locknotfreed; |
|
last; |
|
} |
|
} |
} |
if (@newpaste) { |
if (@newpaste) { |
$addtoenv{'docs.markedcopies'} = join(',',(@currpaste,@newpaste)); |
$addtoenv{'docs.markedcopies'} = join(',',(@currpaste,@newpaste)); |
} |
} |
&Apache::lonnet::appenv(\%addtoenv); |
&Apache::lonnet::appenv(\%addtoenv); |
delete($env{'form.markcopy'}); |
delete($env{'form.markcopy'}); |
return $output; |
|
} |
} |
|
|
sub recurse_uploaded_maps { |
sub recurse_uploaded_maps { |
Line 1132 sub print_paste_buffer {
|
Line 1124 sub print_paste_buffer {
|
|
|
my @currpaste = split(/,/,$env{'docs.markedcopies'}); |
my @currpaste = split(/,/,$env{'docs.markedcopies'}); |
my ($pasteitems,@pasteable); |
my ($pasteitems,@pasteable); |
my $clipboardcount = 0; |
|
|
|
# Construct identifiers for current contents of user's paste buffer |
# Construct identifiers for current contents of user's paste buffer |
foreach my $suffix (@currpaste) { |
foreach my $suffix (@currpaste) { |
Line 1141 sub print_paste_buffer {
|
Line 1132 sub print_paste_buffer {
|
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
if (($cid =~ /^$match_domain\_$match_courseid$/) && |
if (($cid =~ /^$match_domain\_$match_courseid$/) && |
($url ne '')) { |
($url ne '')) { |
$clipboardcount ++; |
|
my ($is_external,$othercourse,$fromsupp,$is_uploaded_map,$parent, |
my ($is_external,$othercourse,$fromsupp,$is_uploaded_map,$parent, |
$canpaste,$nopaste,$othercrs,$areachange); |
$canpaste,$nopaste,$othercrs,$areachange); |
my $extension = (split(/\./,$env{'docs.markedcopy_url_'.$suffix}))[-1]; |
my $extension = (split(/\./,$env{'docs.markedcopy_url_'.$suffix}))[-1]; |
Line 1197 sub print_paste_buffer {
|
Line 1187 sub print_paste_buffer {
|
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); |
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); |
$icon .= '/navmap.folder.closed.gif'; |
$icon .= '/navmap.folder.closed.gif'; |
} |
} |
my $title = $env{'docs.markedcopy_title_'.$suffix}; |
|
if ($title eq '') { |
|
($title) = ($url =~ m{/([^/]+)$}); |
|
} |
|
$buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'. |
$buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'. |
': '. |
': '. |
&Apache::loncommon::parse_supplemental_title( |
&Apache::loncommon::parse_supplemental_title( |
&LONCAPA::map::qtescape($title)); |
&LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix})); |
} |
} |
$pasteitems .= '<div class="LC_left_float">'; |
$pasteitems .= '<div class="LC_left_float">'; |
my ($options,$onclick); |
my ($options,$onclick); |
Line 1239 sub print_paste_buffer {
|
Line 1225 sub print_paste_buffer {
|
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post" onsubmit="return validateClipboard();">'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post" onsubmit="return validateClipboard();">'; |
if (@pasteable) { |
if (@pasteable) { |
my $value = &mt('Paste to current folder'); |
$buttons = '<input type="submit" name="pastemarked" value="'.&mt('Paste selected').'" />'.(' 'x2); |
if ($container eq 'page') { |
|
$value = &mt('Paste to current page'); |
|
} |
|
$buttons = '<input type="submit" name="pastemarked" value="'.$value.'" />'.(' 'x2); |
|
} |
|
$buttons .= '<input type="submit" name="clearmarked" value="'.&mt('Clear selected').'" />'.(' 'x2); |
|
if ($clipboardcount > 1) { |
|
$buttons .= |
|
'<span style="text-decoration:line-through">'.(' 'x20).'</span>'.(' 'x2). |
|
'<input type="button" name="checkallclip" value="'.&mt('Check all').'" style="height:20px;" onclick="checkClipboard();" />'. |
|
(' 'x2). |
|
'<input type="button" name="uncheckallclip" value="'.&mt('Uncheck all').'" style="height:20px;" onclick="uncheckClipboard();" />'. |
|
(' 'x2); |
|
} |
} |
$form_end = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'. |
$buttons .= '<input type="submit" name="clearmarked" value="'.&mt('Clear selected').'" />'. |
'</form>'; |
'<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
|
$form_end = '</form>'; |
} else { |
} else { |
$pasteitems = &mt('Clipboard is empty'); |
$pasteitems = &mt('Clipboard is empty'); |
} |
} |
Line 1353 sub supp_pasteable {
|
Line 1327 sub supp_pasteable {
|
} |
} |
|
|
sub paste_popup_js { |
sub paste_popup_js { |
my %html_js_lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
show => 'Show Options', |
show => 'Show Options', |
hide => 'Hide Options', |
hide => 'Hide Options', |
); |
|
my %js_lt = &Apache::lonlocal::texthash( |
|
none => 'No items selected from clipboard.', |
none => 'No items selected from clipboard.', |
); |
); |
&html_escape(\%html_js_lt); |
|
&js_escape(\%html_js_lt); |
|
&js_escape(\%js_lt); |
|
return <<"END"; |
return <<"END"; |
|
|
function showPasteOptions(suffix) { |
function showPasteOptions(suffix) { |
document.getElementById('pasteoptions_'+suffix).style.display='block'; |
document.getElementById('pasteoptions_'+suffix).style.display='block'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML = ' <a href="javascript:hidePasteOptions(\\''+suffix+'\\');" class="LC_menubuttons_link">$html_js_lt{'hide'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML = ' <a href="javascript:hidePasteOptions(\\''+suffix+'\\');" class="LC_menubuttons_link">$lt{'hide'}</a>'; |
return; |
return; |
} |
} |
|
|
function hidePasteOptions(suffix) { |
function hidePasteOptions(suffix) { |
document.getElementById('pasteoptions_'+suffix).style.display='none'; |
document.getElementById('pasteoptions_'+suffix).style.display='none'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$html_js_lt{'show'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$lt{'show'}</a>'; |
return; |
return; |
} |
} |
|
|
function showOptions(caller,suffix) { |
function showOptions(caller,suffix) { |
if (document.getElementById('pasteoptionstext_'+suffix)) { |
if (document.getElementById('pasteoptionstext_'+suffix)) { |
if (caller.checked) { |
if (caller.checked) { |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$html_js_lt{'show'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$lt{'show'}</a>'; |
} else { |
} else { |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =''; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =''; |
} |
} |
Line 1409 function validateClipboard() {
|
Line 1378 function validateClipboard() {
|
if (numchk > 0) { |
if (numchk > 0) { |
return true; |
return true; |
} else { |
} else { |
alert("$js_lt{'none'}"); |
alert("$lt{'none'}"); |
return false; |
return false; |
} |
} |
} |
} |
|
|
function checkClipboard() { |
|
if (document.pasteform.pasting.length > 1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
document.pasteform.pasting[i].checked = true; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function uncheckClipboard() { |
|
if (document.pasteform.pasting.length >1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
document.pasteform.pasting[i].checked = false; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
END |
END |
|
|
} |
} |
Line 1678 sub do_paste_from_buffer {
|
Line 1629 sub do_paste_from_buffer {
|
next; |
next; |
} |
} |
if ($lockerr{$prefix}) { |
if ($lockerr{$prefix}) { |
$lockerrs{$suffix} = $lockerr{$prefix}; |
$lockerrs{$suffix} = $lockerr{$prefix}; |
} |
} |
} |
} |
} |
} |
Line 1717 sub do_paste_from_buffer {
|
Line 1668 sub do_paste_from_buffer {
|
if ($newdocsdir eq '') { |
if ($newdocsdir eq '') { |
$newdocsdir = 'default'; |
$newdocsdir = 'default'; |
} |
} |
if (($prefixchg{$suffix}) || |
if (($prefixchg{$suffix}) || |
($srcdom{$suffix} ne $coursedom) || |
($srcdom{$suffix} ne $coursedom) || |
($srcnum{$suffix} ne $coursenum) || |
($srcnum{$suffix} ne $coursenum) || |
($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { |
($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { |
Line 1924 sub dbcopy {
|
Line 1875 sub dbcopy {
|
if (ref($dbref) eq 'HASH') { |
if (ref($dbref) eq 'HASH') { |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
my $prefix = $1; |
my $prefix = $1; |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
($dbref->{'cnum'} =~ /^$match_courseid$/)) { |
($dbref->{'cnum'} =~ /^$match_courseid$/)) { |
my $db_name; |
my $db_name; |
my $marker = (split(m{/},$url))[4]; |
my $marker = (split(m{/},$url))[4]; |
Line 1959 sub dbcopy {
|
Line 1910 sub dbcopy {
|
my $photo = $contents{'uploaded.photourl'}; |
my $photo = $contents{'uploaded.photourl'}; |
my ($subdir,$fname) = |
my ($subdir,$fname) = |
($photo =~ m{^/uploaded/$match_domain/$match_courseid/+(bulletin|simplepage)/(?:|\d+/)([^/]+)$}); |
($photo =~ m{^/uploaded/$match_domain/$match_courseid/+(bulletin|simplepage)/(?:|\d+/)([^/]+)$}); |
my $newphoto; |
my $newphoto; |
if ($fname ne '') { |
if ($fname ne '') { |
my $content = &Apache::lonnet::getfile($photo); |
my $content = &Apache::lonnet::getfile($photo); |
unless ($content eq '-1') { |
unless ($content eq '-1') { |
$env{'form.'.$suffix.'.photourl'} = $content; |
$env{'form.'.$suffix.'.photourl'} = $content; |
$newphoto = |
$newphoto = |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$suffix.'.photourl',"$subdir/$suffix/$fname"); |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$suffix.'.photourl',"$subdir/$suffix/$fname"); |
delete($env{'form.'.$suffix.'.photourl'}); |
delete($env{'form.'.$suffix.'.photourl'}); |
} |
} |
Line 2109 sub url_paste_fixups {
|
Line 2060 sub url_paste_fixups {
|
} |
} |
next if ($token->[2]->{'type'} eq 'external'); |
next if ($token->[2]->{'type'} eq 'external'); |
if ($token->[2]->{'type'} eq 'zombie') { |
if ($token->[2]->{'type'} eq 'zombie') { |
next if ($skip); |
next if ($skip); |
$zombies->{$oldurl}{$id} = $ressrc; |
$zombies->{$oldurl}{$id} = $ressrc; |
$changed = 1; |
$changed = 1; |
} elsif ($ressrc =~ m{^/uploaded/($match_domain)/($match_courseid)/(.+)$}) { |
} elsif ($ressrc =~ m{^/uploaded/($match_domain)/($match_courseid)/(.+)$}) { |
Line 2555 sub update_parameter {
|
Line 2506 sub update_parameter {
|
'randomorder' => {}, |
'randomorder' => {}, |
); |
); |
foreach my $which (keys(%allchecked)) { |
foreach my $which (keys(%allchecked)) { |
$env{'form.all'.$which} =~ s/,$//; |
$env{'form.all'.$which} =~ s/,$//; |
if ($which eq 'randompick') { |
if ($which eq 'randompick') { |
foreach my $item (split(/,/,$env{'form.all'.$which})) { |
foreach my $item (split(/,/,$env{'form.all'.$which})) { |
my ($res,$value) = split(/:/,$item); |
my ($res,$value) = split(/:/,$item); |
Line 2582 sub update_parameter {
|
Line 2533 sub update_parameter {
|
foreach my $which (keys(%allchecked)) { |
foreach my $which (keys(%allchecked)) { |
if (($which eq 'randompick' || $which eq 'randomorder')) { |
if (($which eq 'randompick' || $which eq 'randomorder')) { |
next if (!$is_map); |
next if (!$is_map); |
} |
} |
my $oldvalue = 0; |
my $oldvalue = 0; |
my $newvalue = 0; |
my $newvalue = 0; |
if ($allchecked{$which}{$res}) { |
if ($allchecked{$which}{$res}) { |
Line 2618 sub update_parameter {
|
Line 2569 sub update_parameter {
|
} |
} |
return $haschanges; |
return $haschanges; |
} else { |
} else { |
my $haschanges = 0; |
return 0 if ($env{'form.changeparms'} !~ /^($valid_parameters_re)$/); |
return $haschanges if ($env{'form.changeparms'} !~ /^($valid_parameters_re)$/); |
|
|
|
my $which = $env{'form.changeparms'}; |
my $which = $env{'form.changeparms'}; |
my $idx = $env{'form.setparms'}; |
my $idx = $env{'form.setparms'}; |
my $oldvalue = 0; |
|
my $newvalue = 0; |
|
my $current = (&LONCAPA::map::getparameter($idx,'parameter_'.$which))[0]; |
|
if ($which eq 'randompick') { |
|
if ($current =~ /^(\d+)$/) { |
|
$oldvalue = $1; |
|
} |
|
} elsif ($current =~ /^yes$/i) { |
|
$oldvalue = 1; |
|
} |
|
if ($env{'form.'.$which.'_'.$idx}) { |
if ($env{'form.'.$which.'_'.$idx}) { |
$newvalue = ($which eq 'randompick') ? $env{'form.rpicknum_'.$idx} |
my $value = ($which eq 'randompick') ? $env{'form.rpicknum_'.$idx} |
: 1; |
: 'yes'; |
} |
&LONCAPA::map::storeparameter($idx, 'parameter_'.$which, $value, |
if ($oldvalue ne $newvalue) { |
$parameter_type{$which}); |
$haschanges = 1; |
&remember_parms($idx,$which,'set',$value); |
if ($newvalue) { |
} else { |
my $storeval = 'yes'; |
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
if ($which eq 'randompick') { |
|
$storeval = $newvalue; |
&remember_parms($idx,$which,'del'); |
} |
|
&LONCAPA::map::storeparameter($idx, 'parameter_'.$which, $storeval, |
|
$parameter_type{$which}); |
|
&remember_parms($idx,$which,'set',$storeval); |
|
} else { |
|
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
|
&remember_parms($idx,$which,'del'); |
|
} |
|
} |
} |
return $haschanges; |
return 1; |
} |
} |
return; |
|
} |
} |
|
|
|
|
sub handle_edit_cmd { |
sub handle_edit_cmd { |
my ($coursenum,$coursedom) =@_; |
my ($coursenum,$coursedom) =@_; |
if ($env{'form.cmd'} eq '') { |
if ($env{'form.cmd'} eq '') { |
Line 2748 sub editor {
|
Line 2680 sub editor {
|
&snapshotbefore(); |
&snapshotbefore(); |
|
|
if (&update_parameter()) { |
if (&update_parameter()) { |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,1); |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); |
return $errtext if ($fatal); |
return $errtext if ($fatal); |
} |
} |
|
|
Line 2810 sub editor {
|
Line 2742 sub editor {
|
$r->print($upload_output); |
$r->print($upload_output); |
|
|
# Rename, cut, copy or remove a single resource |
# Rename, cut, copy or remove a single resource |
if (&handle_edit_cmd($coursenum,$coursedom)) { |
if (&handle_edit_cmd()) { |
my $contentchg; |
my $contentchg; |
if ($env{'form.cmd'} =~ m{^(remove|cut)_}) { |
if ($env{'form.cmd'} =~ m{^(del|cut)_}) { |
$contentchg = 1; |
$contentchg = 1; |
} |
} |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,$contentchg); |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,$contentchg); |
Line 2844 sub editor {
|
Line 2776 sub editor {
|
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
$name=&LONCAPA::map::qtescape($name); |
$name=&LONCAPA::map::qtescape($name); |
$url=&LONCAPA::map::qtescape($url); |
$url=&LONCAPA::map::qtescape($url); |
next unless $url; |
next unless ($name && $url); |
my %denied = |
my %denied = |
&action_restrictions($coursenum,$coursedom,$url, |
&action_restrictions($coursenum,$coursedom,$url, |
$env{'form.folderpath'},\%curr_groups); |
$env{'form.folderpath'},\%curr_groups); |
Line 3060 sub editor {
|
Line 2992 sub editor {
|
if (@allidx > 0) { |
if (@allidx > 0) { |
my $path; |
my $path; |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$path = |
$path = |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
} |
} |
if (@allidx > 1) { |
if (@allidx > 1) { |
$to_show .= |
$to_show .= |
&Apache::loncommon::continue_data_table_row(). |
&Apache::loncommon::continue_data_table_row(). |
'<td colspan="2"> </td>'. |
'<td colspan="2"> </td>'. |
'<td>'. |
'<td>'. |
Line 3208 sub process_file_upload {
|
Line 3140 sub process_file_upload {
|
} |
} |
my $quotatype = 'unofficial'; |
my $quotatype = 'unofficial'; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$quotatype = 'community'; |
$quotatype = 'community'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) { |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) { |
$quotatype = 'official'; |
$quotatype = 'official'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
|
$quotatype = 'textbook'; |
|
} |
} |
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
$filesize = int($filesize/1000); #expressed in kb |
$filesize = int($filesize/1000); #expressed in kb |
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
$env{'form.uploaddoc.filename'},$filesize, |
$env{'form.uploaddoc.filename'},$filesize,'upload'); |
'upload',$quotatype); |
|
return if ($$upload_output); |
return if ($$upload_output); |
} |
} |
my ($parseaction,$showupload,$nextphase,$mimetype); |
my ($parseaction,$showupload,$nextphase,$mimetype); |
Line 3316 sub process_file_upload {
|
Line 3245 sub process_file_upload {
|
$$upload_output .= &mt('No embedded items identified').'<br />'; |
$$upload_output .= &mt('No embedded items identified').'<br />'; |
} |
} |
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>'; |
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>'; |
} elsif ((&Apache::loncommon::is_archive_file($mimetype)) && |
} elsif (&Apache::loncommon::is_archive_file($mimetype)) { |
($env{'form.uploaddoc.filename'} =~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i)) { |
|
$nextphase = 'decompress_uploaded'; |
$nextphase = 'decompress_uploaded'; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $noextract = &return_to_editor(); |
my $noextract = &return_to_editor(); |
Line 3379 sub is_supplemental_title {
|
Line 3307 sub is_supplemental_title {
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups)=@_; |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups)=@_; |
my ($foldertitle,$renametitle,$oldtitle); |
my ($foldertitle,$renametitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
} else { |
} else { |
Line 3392 sub entryline {
|
Line 3320 sub entryline {
|
|
|
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/"/%22/g; |
|
$renametitle=~s/ /%20/g; |
$renametitle=~s/ /%20/g; |
$oldtitle = $renametitle; |
|
$renametitle=~s/\'\;/\\\'/g; |
|
my $line=&Apache::loncommon::start_data_table_row(); |
my $line=&Apache::loncommon::start_data_table_row(); |
my ($form_start,$form_end,$form_common,$form_param); |
my ($form_start,$form_end,$form_common,$form_param); |
# Edit commands |
# Edit commands |
Line 3480 END
|
Line 3405 END
|
$currgroups); |
$currgroups); |
my ($copylink,$cutlink,$removelink); |
my ($copylink,$cutlink,$removelink); |
my $skip_confirm = 0; |
my $skip_confirm = 0; |
my $confirm_removal = 0; |
|
if ( $folder =~ /^supplemental/ |
if ( $folder =~ /^supplemental/ |
|| ($url =~ m{( /smppg$ |
|| ($url =~ m{( /smppg$ |
|/syllabus$ |
|/syllabus$ |
Line 3491 END
|
Line 3415 END
|
|| $isexternal) { |
|| $isexternal) { |
$skip_confirm = 1; |
$skip_confirm = 1; |
} |
} |
if (($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) && |
|
($url!~/$LONCAPA::assess_page_seq_re/)) { |
|
$confirm_removal = 1; |
|
} |
|
|
|
if ($denied{'copy'}) { |
if ($denied{'copy'}) { |
$copylink=(<<ENDCOPY) |
$copylink=(<<ENDCOPY) |
Line 3537 ENDCUT
|
Line 3457 ENDCUT
|
ENDREM |
ENDREM |
} else { |
} else { |
my $formname = 'edit_remove_'.$orderidx; |
my $formname = 'edit_remove_'.$orderidx; |
my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm,'$container','$folder',$confirm_removal);"; |
my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm);"; |
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
<input type="hidden" name="confirm_rem_$orderidx" id="confirm_removal_$orderidx" value="$confirm_removal" /> |
|
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
$form_end |
$form_end |
ENDREM |
ENDREM |
Line 3551 ENDREM
|
Line 3470 ENDREM
|
} |
} |
} |
} |
$renamelink=(<<ENDREN); |
$renamelink=(<<ENDREN); |
<a href='javascript:changename("$esc_path","$index","$oldtitle");' class="LC_docs_rename">$lt{'rn'}</a> |
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
ENDREN |
ENDREN |
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
Line 3608 END
|
Line 3527 END
|
} |
} |
} |
} |
|
|
my ($editlink,$extresform,$anchor); |
my ($editlink,$extresform); |
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
Line 3630 END
|
Line 3549 END
|
$url='/adm/wrapper'.$url; |
$url='/adm/wrapper'.$url; |
} |
} |
if (&Apache::lonnet::symbverify($symb,$url)) { |
if (&Apache::lonnet::symbverify($symb,$url)) { |
my $shownsymb = $symb; |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
if ($isexternal) { |
|
if ($url =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) { |
|
$shownsymb = $1.&escape('#').$anchor; |
|
} |
|
} |
|
} |
|
$url.=(($url=~/\?/)?'&':'?').'symb='.&HTML::Entities::encode($shownsymb,'"<>&'); |
|
} else { |
} else { |
$url=''; |
$url=''; |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
|
if ($isexternal) { |
|
if ($url =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
} |
|
} |
|
} |
} |
my ($rand_pick_text,$rand_order_text); |
my ($rand_pick_text,$rand_order_text); |
if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') { |
if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') { |
Line 3708 $form_common."\n".
|
Line 3610 $form_common."\n".
|
$form_param."\n". |
$form_param."\n". |
$form_common."\n". |
$form_common."\n". |
'<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" id="randomorder_'.$orderidx.'" onclick="checkForSubmit(this.form,'."'randomorder','settings'".');" '.$ro_set.' /> '.&mt('Random Order').' </label></span>'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" id="randomorder_'.$orderidx.'" onclick="checkForSubmit(this.form,'."'randomorder','settings'".');" '.$ro_set.' /> '.&mt('Random Order').' </label></span>'. |
$form_end; |
$form_end; |
} |
} |
} elsif ($supplementalflag && !$allowed) { |
} elsif ($supplementalflag && !$allowed) { |
$url .= ($url =~ /\?/) ? '&':'?'; |
$url .= ($url =~ /\?/) ? '&':'?'; |
Line 3719 $form_end;
|
Line 3621 $form_end;
|
if ($isexternal && $orderidx) { |
if ($isexternal && $orderidx) { |
$url .= '&idx='.$orderidx; |
$url .= '&idx='.$orderidx; |
} |
} |
if ($anchor ne '') { |
|
$url .= '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
|
} |
|
} |
} |
my ($tdalign,$tdwidth); |
my ($tdalign,$tdwidth); |
if ($allowed) { |
if ($allowed) { |
Line 3734 $form_end;
|
Line 3633 $form_end;
|
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); |
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); |
if (($cfile ne '') && ($symb ne '' || $supplementalflag)) { |
if (($cfile ne '') && ($symb ne '' || $supplementalflag)) { |
my $suppanchor; |
|
if ($supplementalflag) { |
|
$suppanchor = $anchor; |
|
} |
|
my $jscall = |
my $jscall = |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
$switchserver, |
$switchserver, |
$forceedit, |
$forceedit, |
undef,$symb, |
undef,$symb, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
$renametitle,'','',1,$suppanchor); |
$renametitle,'','',1); |
if ($jscall) { |
if ($jscall) { |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
Line 3764 $form_end;
|
Line 3659 $form_end;
|
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
} elsif ($url) { |
} elsif ($url) { |
if ($anchor ne '') { |
$line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', |
if ($supplementalflag) { |
|
$anchor = '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
|
} else { |
|
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
|
} |
|
} |
|
$line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
|
(($anchor ne '')?$anchor:''), |
|
'<img src="'.$icon.'" alt="" class="LC_icon" />',600,500); |
'<img src="'.$icon.'" alt="" class="LC_icon" />',600,500); |
} else { |
} else { |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
Line 3781 $form_end;
|
Line 3668 $form_end;
|
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
} elsif ($url) { |
} elsif ($url) { |
$line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
$line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', |
(($anchor ne '')?$anchor:''), |
|
$title,600,500); |
$title,600,500); |
} else { |
} else { |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
Line 3899 sub new_timebased_suffix {
|
Line 3785 sub new_timebased_suffix {
|
if ($type eq 'paste') { |
if ($type eq 'paste') { |
$prefix = $type; |
$prefix = $type; |
$namespace = 'courseeditor'; |
$namespace = 'courseeditor'; |
$idtype = 'addcode'; |
|
} elsif ($type eq 'map') { |
} elsif ($type eq 'map') { |
$prefix = 'docs'; |
$prefix = 'docs'; |
if ($area eq 'supplemental') { |
if ($area eq 'supplemental') { |
Line 3911 sub new_timebased_suffix {
|
Line 3796 sub new_timebased_suffix {
|
$prefix = $type; |
$prefix = $type; |
$namespace = 'templated'; |
$namespace = 'templated'; |
} |
} |
|
$idtype = 'concat'; |
my ($suffix,$freedlock,$error) = |
my ($suffix,$freedlock,$error) = |
&Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num,$idtype); |
&Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num); |
if (!$suffix) { |
if (!$suffix) { |
if ($type eq 'paste') { |
if ($type eq 'paste') { |
$errtext = &mt('Failed to acquire a unique timestamp-based suffix when adding to the paste buffer.'); |
$errtext = &mt('Failed to acquire a unique timestamp-based suffix when adding to the paste buffer.'); |
Line 3928 sub new_timebased_suffix {
|
Line 3814 sub new_timebased_suffix {
|
} |
} |
} |
} |
if ($freedlock ne 'ok') { |
if ($freedlock ne 'ok') { |
$locknotfreed = |
$locknotfreed = |
'<div class="LC_error">'. |
'<div class="LC_error">'. |
&mt('There was a problem removing a lockfile.').' '; |
&mt('There was a problem removing a lockfile.').' '; |
if ($type eq 'paste') { |
if ($type eq 'paste') { |
if ($freedlock eq 'nolock') { |
&mt('This will prevent use of the paste buffer until th next log-in.'); |
$locknotfreed = |
|
'<div class="LC_error">'. |
|
&mt('A lockfile was not released when you added content to the clipboard earlier in this session.').' '. |
|
|
|
&mt('As a result addition of items to the clipboard will be unavailable until your next log-in.'); |
|
} else { |
|
$locknotfreed .= |
|
&mt('This will prevent addition of items to the clipboard until your next log-in.'); |
|
} |
|
} elsif ($type eq 'map') { |
} elsif ($type eq 'map') { |
$locknotfreed .= |
&mt('This will prevent creation of additional folders or composite pages in this course.'); |
&mt('This will prevent creation of additional folders or composite pages in this course.'); |
|
} elsif ($type eq 'smppg') { |
} elsif ($type eq 'smppg') { |
$locknotfreed .= |
$locknotfreed .= |
&mt('This will prevent creation of additional simple pages in this course.'); |
&mt('This will prevent creation of additional simple pages in this course.'); |
Line 4337 ENDHEADERS
|
Line 4213 ENDHEADERS
|
return; |
return; |
} |
} |
$r->print( |
$r->print( |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'. |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('Resources').'</th>'. |
'<th>'.&mt('Resources').'</th>'. |
Line 4380 ENDHEADERS
|
Line 4256 ENDHEADERS
|
$setversions{$linkurl}, |
$setversions{$linkurl}, |
'set_version_'.$linkurl, |
'set_version_'.$linkurl, |
{'select_form_order' => ['',1..$currentversion,'mostrecent'], |
{'select_form_order' => ['',1..$currentversion,'mostrecent'], |
'' => '', |
'' => '', |
'mostrecent' => &mt('most recent'), |
'mostrecent' => &mt('most recent'), |
map {$_,$_} (1..$currentversion)})); |
map {$_,$_} (1..$currentversion)})); |
my $lastold=1; |
my $lastold=1; |
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
my $url=$root.'.'.$prevvers.'.'.$extension; |
my $url=$root.'.'.$prevvers.'.'.$extension; |
Line 4519 sub startContentScreen {
|
Line 4395 sub startContentScreen {
|
if (($mode eq 'navmaps') || ($mode eq 'supplemental')) { |
if (($mode eq 'navmaps') || ($mode eq 'supplemental')) { |
$output .= '<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Content Overview').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Content Overview').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
|
$output .= '<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
} else { |
} else { |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Main Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Main Content Editor').' </b></a></li>'."\n"; |
Line 4589 sub handler {
|
Line 4466 sub handler {
|
$allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
$allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
} |
} |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['chooseserver', |
if ($allowed && $env{'form.verify'}) { |
'inhibitmenu']); |
|
if ($allowed && $env{'form.chooseserver'}) { |
|
&choose_dump_server($r); |
|
return OK; |
|
} elsif ($allowed && $env{'form.verify'}) { |
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content'); |
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content'); |
&verifycontent($r); |
&verifycontent($r); |
} elsif ($allowed && $env{'form.listsymbs'}) { |
} elsif ($allowed && $env{'form.listsymbs'}) { |
Line 4916 sub handler {
|
Line 4797 sub handler {
|
'navc' => 'Table of Contents', |
'navc' => 'Table of Contents', |
'sipa' => 'Simple Course Page', |
'sipa' => 'Simple Course Page', |
'sipr' => 'Simple Problem', |
'sipr' => 'Simple Problem', |
'webp' => 'Blank Web Page (editable)', |
'webp' => 'Blank Web Page (editable)', |
'drbx' => 'Drop Box', |
'drbx' => 'Drop Box', |
'scuf' => 'External Scores (handgrade, upload, clicker)', |
'scuf' => 'External Scores (handgrade, upload, clicker)', |
'bull' => 'Discussion Board', |
'bull' => 'Discussion Board', |
Line 4932 sub handler {
|
Line 4813 sub handler {
|
'title' => 'Title', |
'title' => 'Title', |
'comment' => 'Comment', |
'comment' => 'Comment', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'bb5' => 'Blackboard 5', |
); |
'bb6' => 'Blackboard 6', |
|
'angel5' => 'ANGEL 5.5', |
|
'webctce4' => 'WebCT 4 Campus Edition', |
|
); |
|
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
# Calculate free quota space for a user or course. |
|
my $quotatype = 'unofficial'; |
|
if ($crstype eq 'Community') { |
|
$quotatype = 'community'; |
|
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) { |
|
$quotatype = 'official'; |
|
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
|
$quotatype = 'textbook'; |
|
} |
|
my $disk_quota = &Apache::loncommon::get_user_quota($coursenum,$coursedom, |
|
'course',$quotatype); # expressed in MB |
|
my $current_disk_usage = 0; |
|
foreach my $subdir ('docs','supplemental') { |
|
$current_disk_usage += &Apache::lonnet::diskusage($coursedom,$coursenum, |
|
"userfiles/$subdir",1); # expressed in kB |
|
} |
|
my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage); |
|
my $usage = $current_disk_usage/1024; # in MB |
|
my $quota = $disk_quota; |
|
my $percent; |
|
if ($disk_quota == 0) { |
|
$percent = 100.0; |
|
} else { |
|
$percent = 100*($current_disk_usage/$disk_quota); |
|
} |
|
$usage = sprintf("%.2f",$usage); |
|
$quota = sprintf("%.2f",$quota); |
|
$percent = sprintf("%.0f",$percent); |
|
my $quotainfo = '<p>'.&mt('Currently using [_1] of the [_2] available.', |
|
$percent.'%',$quota.' MB').'</p>'; |
|
|
|
my $fileupload=(<<FIUP); |
my $fileupload=(<<FIUP); |
$quotainfo |
|
$lt{'file'}:<br /> |
$lt{'file'}:<br /> |
<input type="file" name="uploaddoc" size="40" /> |
<input type="file" name="uploaddoc" size="40" /> |
FIUP |
FIUP |
Line 4999 CHBO
|
Line 4844 CHBO
|
$lt{'cms'}: |
$lt{'cms'}: |
<select name="source"> |
<select name="source"> |
<option value="-1" selected="selected">$lt{'se'}</option> |
<option value="-1" selected="selected">$lt{'se'}</option> |
<option value="bb5">$lt{'bb5'}</option> |
<option value="bb5">Blackboard 5</option> |
<option value="bb6">$lt{'bb6'}</option> |
<option value="bb6">Blackboard 6</option> |
<option value="angel5">$lt{'angel5'}</option> |
<option value="angel5">ANGEL 5.5</option> |
<option value="webctce4">$lt{'webctce4'}</option> |
<option value="webctce4">WebCT 4 Campus Edition</option> |
</select> |
</select> |
<input type="hidden" name="folder" value="$imsfolder" /> |
<input type="hidden" name="folder" value="$imsfolder" /> |
</p> |
</p> |
Line 5496 my %suporderhash = (
|
Line 5341 my %suporderhash = (
|
} |
} |
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
undef($suppchanges); |
undef($suppchanges); |
} |
} |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
Line 5575 sub decompression_info {
|
Line 5420 sub decompression_info {
|
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $container='sequence'; |
my $container='sequence'; |
my ($pathitem,$hiddenelem); |
my ($pathitem,$hiddenelem); |
my @hiddens = ('newidx','comment','position','folderpath','archiveurl'); |
my @hiddens = ('newidx','comment','position','folderpath'); |
if ($env{'form.folderpath'} =~ /\:1$/) { |
if ($env{'form.folderpath'} =~ /\:1$/) { |
$container='page'; |
$container='page'; |
} |
} |
Line 5583 sub decompression_info {
|
Line 5428 sub decompression_info {
|
foreach my $item (@hiddens) { |
foreach my $item (@hiddens) { |
if ($env{'form.'.$item}) { |
if ($env{'form.'.$item}) { |
$hiddenelem .= '<input type="hidden" name="'.$item.'" value="'. |
$hiddenelem .= '<input type="hidden" name="'.$item.'" value="'. |
&HTML::Entities::encode($env{'form.'.$item},'<>&"').'" />'."\n"; |
$env{'form.'.$item}.'" />'."\n"; |
} |
} |
} |
} |
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container, |
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container, |
Line 5640 sub remove_archive {
|
Line 5485 sub remove_archive {
|
} else { |
} else { |
$delwarning = &mt('An error occurred retrieving the contents of the current folder.'); |
$delwarning = &mt('An error occurred retrieving the contents of the current folder.'); |
} |
} |
$delwarning .= ' '.&mt('As a result the archive file has not been removed.'); |
$delwarning .= &mt('As a result the archive file has not been removed.'); |
} else { |
} else { |
my $currcmd = $env{'form.cmd'}; |
my $currcmd = $env{'form.cmd'}; |
my $position = $env{'form.position'}; |
my $position = $env{'form.position'}; |
my $archiveidx = $position; |
|
if ($position > 0) { |
if ($position > 0) { |
if (($env{'form.autoextract_camtasia'}) && (scalar(@LONCAPA::map::order) == 2)) { |
$env{'form.cmd'} = 'remove_'.$position; |
$archiveidx = $position-1; |
my ($title,$url,@rrest) = |
} |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); |
$env{'form.cmd'} = 'remove_'.$archiveidx; |
if (&handle_edit_cmd($docuname,$docudom)) { |
my ($title,$url,@rrest) = |
($errtext,$fatal) = &storemap($docuname,$docudom,$map,1); |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$archiveidx]]); |
if ($fatal) { |
if ($url eq $env{'form.archiveurl'}) { |
if ($container eq 'page') { |
if (&handle_edit_cmd($docuname,$docudom)) { |
$delwarning = &mt('An error occurred updating the contents of the current page.'); |
($errtext,$fatal) = &storemap($docuname,$docudom,$map,1); |
|
if ($fatal) { |
|
if ($container eq 'page') { |
|
$delwarning = &mt('An error occurred updating the contents of the current page.'); |
|
} else { |
|
$delwarning = &mt('An error occurred updating the contents of the current folder.'); |
|
} |
|
} else { |
} else { |
$delresult = &mt('Archive file removed.'); |
$delwarning = &mt('An error occurred updating the contents of the current folder.'); |
} |
} |
|
} else { |
|
$delresult = &mt('Archive file removed.'); |
} |
} |
} else { |
|
$delwarning .= &mt('Archive file had unexpected item number in folder.'). |
|
' '.&mt('As a result the archive file has not been removed.'); |
|
} |
} |
} |
} |
$env{'form.cmd'} = $currcmd; |
$env{'form.cmd'} = $currcmd; |
Line 5870 END
|
Line 5706 END
|
|
|
sub editing_js { |
sub editing_js { |
my ($udom,$uname,$supplementalflag) = @_; |
my ($udom,$uname,$supplementalflag) = @_; |
my %js_lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
p_mnf => 'Name of New Folder', |
p_mnf => 'Name of New Folder', |
t_mnf => 'New Folder', |
t_mnf => 'New Folder', |
p_mnp => 'Name of New Page', |
p_mnp => 'Name of New Page', |
Line 5880 sub editing_js {
|
Line 5716 sub editing_js {
|
p_msb => 'Title for the Problem', |
p_msb => 'Title for the Problem', |
p_mdb => 'Title for the Drop Box', |
p_mdb => 'Title for the Drop Box', |
p_mbb => 'Title for the Discussion Board', |
p_mbb => 'Title for the Discussion Board', |
p_mwp => 'Title for Web Page', |
p_mwp => 'Title for Web Page', |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab2 => 'Personal Information Page of ', |
p_mab2 => 'Personal Information Page of ', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_chn => 'New Title', |
p_chn => 'New Title', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr2a => 'Remove', |
p_rmr2a => 'Remove[_99]', |
p_rmr2b => '?', |
p_rmr2b => '?[_99]', |
p_rmr3a => 'Remove those', |
p_rmr3a => 'Remove those [_2]', |
p_rmr3b => 'items?', |
p_rmr3b => 'items?[_2]', |
p_rmr4 => 'WARNING: Removing a resource uploaded to a course cannot be undone via "Undo Delete".', |
|
p_rmr5 => 'Push "Cancel" and then use "Cut" instead if you might need to undo this change.', |
|
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr2a => 'Cut', |
p_ctr2a => 'Cut[_98]', |
p_ctr2b => '?', |
p_ctr2b => '?[_98]', |
p_ctr3a => 'Cut those', |
p_ctr3a => 'Cut those[_2]', |
p_ctr3b => 'items?', |
p_ctr3b => 'items?[_2]', |
rpck => 'Enter number to pick (e.g., 3)', |
rpck => 'Enter number to pick (e.g., 3)', |
imsfile => 'You must choose an IMS package for import', |
imsfile => 'You must choose an IMS package for import', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
Line 5911 sub editing_js {
|
Line 5745 sub editing_js {
|
noac => 'No actions selected.', |
noac => 'No actions selected.', |
); |
); |
|
|
&js_escape(\%js_lt); |
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
my $main_container_page; |
my $main_container_page; |
Line 5931 sub editing_js {
|
Line 5764 sub editing_js {
|
my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller); |
my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller); |
$res = &Apache::lonnet::clutter($res); |
$res = &Apache::lonnet::clutter($res); |
if (&Apache::lonnet::is_on_map($res)) { |
if (&Apache::lonnet::is_on_map($res)) { |
my ($url,$anchor); |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='. |
if ($res =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
if (($caller =~ m{^([^#]+)\Q#$anchor\E$})) { |
|
$caller = $1.&escape('#').$anchor; |
|
} |
|
} |
|
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='. |
|
&HTML::Entities::encode($caller,'<>&"'); |
&HTML::Entities::encode($caller,'<>&"'); |
if ($anchor ne '') { |
|
$backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"'); |
|
} |
|
$backtourl = &Apache::loncommon::escape_single($backtourl); |
|
} else { |
} else { |
$backtourl = '/adm/navmaps'; |
$backtourl = '/adm/navmaps'; |
} |
} |
Line 5967 sub editing_js {
|
Line 5788 sub editing_js {
|
|
|
return <<ENDNEWSCRIPT; |
return <<ENDNEWSCRIPT; |
function makenewfolder(targetform,folderseq) { |
function makenewfolder(targetform,folderseq) { |
var foldername=prompt('$js_lt{"p_mnf"}','$js_lt{"t_mnf"}'); |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
if (foldername) { |
if (foldername) { |
targetform.importdetail.value=escape(foldername)+"="+folderseq; |
targetform.importdetail.value=escape(foldername)+"="+folderseq; |
targetform.submit(); |
targetform.submit(); |
Line 5975 function makenewfolder(targetform,folder
|
Line 5796 function makenewfolder(targetform,folder
|
} |
} |
|
|
function makenewpage(targetform,folderseq) { |
function makenewpage(targetform,folderseq) { |
var pagename=prompt('$js_lt{"p_mnp"}','$js_lt{"t_mnp"}'); |
var pagename=prompt('$lt{"p_mnp"}','$lt{"t_mnp"}'); |
if (pagename) { |
if (pagename) { |
targetform.importdetail.value=escape(pagename)+"="+folderseq; |
targetform.importdetail.value=escape(pagename)+"="+folderseq; |
targetform.submit(); |
targetform.submit(); |
Line 5983 function makenewpage(targetform,folderse
|
Line 5804 function makenewpage(targetform,folderse
|
} |
} |
|
|
function makeexamupload() { |
function makeexamupload() { |
var title=prompt('$js_lt{"p_mxu"}'); |
var title=prompt('$lt{"p_mxu"}'); |
if (title) { |
if (title) { |
this.document.forms.newexamupload.importdetail.value= |
this.document.forms.newexamupload.importdetail.value= |
escape(title)+'=/res/lib/templates/examupload.problem'; |
escape(title)+'=/res/lib/templates/examupload.problem'; |
Line 5992 function makeexamupload() {
|
Line 5813 function makeexamupload() {
|
} |
} |
|
|
function makesmppage() { |
function makesmppage() { |
var title=prompt('$js_lt{"p_msp"}'); |
var title=prompt('$lt{"p_msp"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmppg.importdetail.value= |
this.document.forms.newsmppg.importdetail.value= |
escape(title)+'=/adm/$udom/$uname/new/smppg'; |
escape(title)+'=/adm/$udom/$uname/new/smppg'; |
Line 6001 function makesmppage() {
|
Line 5822 function makesmppage() {
|
} |
} |
|
|
function makewebpage(type) { |
function makewebpage(type) { |
var title=prompt('$js_lt{"p_mwp"}'); |
var title=prompt('$lt{"p_mwp"}'); |
var formname; |
var formname; |
if (type == 'supp') { |
if (type == 'supp') { |
formname = this.document.forms.supwebpage; |
formname = this.document.forms.supwebpage; |
Line 6009 function makewebpage(type) {
|
Line 5830 function makewebpage(type) {
|
formname = this.document.forms.newwebpage; |
formname = this.document.forms.newwebpage; |
} |
} |
if (title) { |
if (title) { |
var webpage = formname.importdetail.value; |
var webpage = formname.importdetail.value; |
formname.importdetail.value = escape(title)+'='+webpage; |
formname.importdetail.value = escape(title)+'='+webpage; |
formname.submit(); |
formname.submit(); |
} |
} |
} |
} |
|
|
function makesmpproblem() { |
function makesmpproblem() { |
var title=prompt('$js_lt{"p_msb"}'); |
var title=prompt('$lt{"p_msb"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmpproblem.importdetail.value= |
this.document.forms.newsmpproblem.importdetail.value= |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
Line 6025 function makesmpproblem() {
|
Line 5846 function makesmpproblem() {
|
} |
} |
|
|
function makedropbox() { |
function makedropbox() { |
var title=prompt('$js_lt{"p_mdb"}'); |
var title=prompt('$lt{"p_mdb"}'); |
if (title) { |
if (title) { |
this.document.forms.newdropbox.importdetail.value= |
this.document.forms.newdropbox.importdetail.value= |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
Line 6034 function makedropbox() {
|
Line 5855 function makedropbox() {
|
} |
} |
|
|
function makebulboard() { |
function makebulboard() { |
var title=prompt('$js_lt{"p_mbb"}'); |
var title=prompt('$lt{"p_mbb"}'); |
if (title) { |
if (title) { |
this.document.forms.newbul.importdetail.value= |
this.document.forms.newbul.importdetail.value= |
escape(title)+'=/adm/$udom/$uname/new/bulletinboard'; |
escape(title)+'=/adm/$udom/$uname/new/bulletinboard'; |
Line 6043 function makebulboard() {
|
Line 5864 function makebulboard() {
|
} |
} |
|
|
function makeabout() { |
function makeabout() { |
var user=prompt("$js_lt{'p_mab'}"); |
var user=prompt("$lt{'p_mab'}"); |
if (user) { |
if (user) { |
var comp=new Array(); |
var comp=new Array(); |
comp=user.split(':'); |
comp=user.split(':'); |
if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) { |
if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) { |
if ((comp[0]) && (comp[1])) { |
if ((comp[0]) && (comp[1])) { |
this.document.forms.newaboutsomeone.importdetail.value= |
this.document.forms.newaboutsomeone.importdetail.value= |
'$js_lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme'; |
'$lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme'; |
this.document.forms.newaboutsomeone.submit(); |
this.document.forms.newaboutsomeone.submit(); |
} else { |
} else { |
alert("$js_lt{'p_mab_alrt1'}"); |
alert("$lt{'p_mab_alrt1'}"); |
} |
} |
} else { |
} else { |
alert("$js_lt{'p_mab_alrt2'}"); |
alert("$lt{'p_mab_alrt2'}"); |
} |
} |
} |
} |
} |
} |
Line 6094 function toggleMap(caller) {
|
Line 5915 function toggleMap(caller) {
|
|
|
function makeims(imsform) { |
function makeims(imsform) { |
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
alert("$js_lt{'imsfile'}"); |
alert("$lt{'imsfile'}"); |
return; |
return; |
} |
} |
if (imsform.source.selectedIndex == 0) { |
if (imsform.source.selectedIndex == 0) { |
alert("$js_lt{'imscms'}"); |
alert("$lt{'imscms'}"); |
return; |
return; |
} |
} |
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
Line 6106 function makeims(imsform) {
|
Line 5927 function makeims(imsform) {
|
} |
} |
|
|
function changename(folderpath,index,oldtitle) { |
function changename(folderpath,index,oldtitle) { |
var title=prompt('$js_lt{"p_chn"}',oldtitle); |
var title=prompt('$lt{"p_chn"}',oldtitle); |
if (title) { |
if (title) { |
this.document.forms.renameform.markcopy.value=''; |
this.document.forms.renameform.markcopy.value=''; |
this.document.forms.renameform.title.value=title; |
this.document.forms.renameform.title.value=title; |
Line 6130 function updatePick(targetform,index,cal
|
Line 5951 function updatePick(targetform,index,cal
|
picknumtext = document.getElementById('randompicknum_'+index); |
picknumtext = document.getElementById('randompicknum_'+index); |
} |
} |
if (pickitem.checked) { |
if (pickitem.checked) { |
var picknum=prompt('$js_lt{"rpck"}',picknumitem.value); |
var picknum=prompt('$lt{"rpck"}',picknumitem.value); |
if (picknum == '' || picknum == null) { |
if (picknum == '' || picknum == null) { |
if (caller == 'check') { |
if (caller == 'check') { |
pickitem.checked=false; |
pickitem.checked=false; |
Line 6280 function propagateState(form,param) {
|
Line 6101 function propagateState(form,param) {
|
return; |
return; |
} |
} |
|
|
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder,confirm_removal) { |
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) { |
var dosettings; |
var dosettings; |
var doaction; |
var doaction; |
var control = document.togglemultsettings; |
var control = document.togglemultsettings; |
Line 6318 function checkForSubmit(targetform,param
|
Line 6139 function checkForSubmit(targetform,param
|
targetform.markcopy.value=idx+':'+param; |
targetform.markcopy.value=idx+':'+param; |
targetform.copyfolder.value=folder+'.'+container; |
targetform.copyfolder.value=folder+'.'+container; |
if (param == 'remove') { |
if (param == 'remove') { |
var doremove = 0; |
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
if (skip_confirm) { |
|
if (confirm_removal) { |
|
if (confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'"$js_lt{"p_rmr2b"}')) { |
|
doremove = 1; |
|
} |
|
} else { |
|
doremove = 1; |
|
} |
|
} else { |
|
if (confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'" $js_lt{"p_rmr2b"}')) { |
|
doremove = 1; |
|
} |
|
} |
|
if (doremove) { |
|
targetform.markcopy.value=''; |
targetform.markcopy.value=''; |
targetform.copyfolder.value=''; |
targetform.copyfolder.value=''; |
targetform.submit(); |
targetform.submit(); |
} |
} |
} |
} |
if (param == 'cut') { |
if (param == 'cut') { |
if (skip_confirm || confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr2a"} "'+oldtitle+'" $js_lt{"p_ctr2b"}')) { |
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
targetform.submit(); |
targetform.submit(); |
return; |
return; |
} |
} |
Line 6404 for (i = 0; i < currentLis.length; i++)
|
Line 6211 for (i = 0; i < currentLis.length; i++)
|
|
|
function hideAll(current, nav, data) { |
function hideAll(current, nav, data) { |
unselectInactive(nav); |
unselectInactive(nav); |
if (current) { |
if (current) { |
if (current.className == 'right'){ |
if (current.className == 'right'){ |
current.className = 'right active' |
current.className = 'right active' |
} else { |
} else { |
current.className = 'active'; |
current.className = 'active'; |
} |
} |
} |
} |
currentData = document.getElementById(data); |
currentData = document.getElementById(data); |
Line 6446 function showPage(current, pageId, nav,
|
Line 6253 function showPage(current, pageId, nav,
|
unselectInactive(nav); |
unselectInactive(nav); |
if ((currstate == 'active') || (currstate == 'right active')) { |
if ((currstate == 'active') || (currstate == 'right active')) { |
if (currstate == 'active') { |
if (currstate == 'active') { |
current.className = ''; |
current.className = ''; |
} else { |
} else { |
current.className = 'right'; |
current.className = 'right'; |
} |
} |
activeTab = ''; |
activeTab = ''; |
toggleUpload(); |
toggleUpload(); |
toggleMap(); |
toggleMap(); |
resize_scrollbox('contentscroll','1','0'); |
resize_scrollbox('contentscroll','1','0'); |
Line 6518 function togglePick(caller,value) {
|
Line 6325 function togglePick(caller,value) {
|
} |
} |
document.getElementById('multi'+caller).style.display=disp; |
document.getElementById('multi'+caller).style.display=disp; |
if (value == 1) { |
if (value == 1) { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$js_lt{'more'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$lt{'more'}</a>'; |
} else { |
} else { |
document.getElementById('more'+caller).innerHTML = ''; |
document.getElementById('more'+caller).innerHTML = ''; |
} |
} |
Line 6544 function togglePick(caller,value) {
|
Line 6351 function togglePick(caller,value) {
|
|
|
function toggleCheckUncheck(caller,more) { |
function toggleCheckUncheck(caller,more) { |
if (more == 1) { |
if (more == 1) { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',0);" style="text-decoration:none;">$js_lt{'less'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',0);" style="text-decoration:none;">$lt{'less'}</a>'; |
document.getElementById('allfields'+caller).style.display='block'; |
document.getElementById('allfields'+caller).style.display='block'; |
} else { |
} else { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$js_lt{'more'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$lt{'more'}</a>'; |
document.getElementById('allfields'+caller).style.display='none'; |
document.getElementById('allfields'+caller).style.display='none'; |
} |
} |
resize_scrollbox('contentscroll','1','1'); |
resize_scrollbox('contentscroll','1','1'); |
Line 6589 function checkSubmits() {
|
Line 6396 function checkSubmits() {
|
var doactions = multiActions(); |
var doactions = multiActions(); |
var cutwarnings = 0; |
var cutwarnings = 0; |
var remwarnings = 0; |
var remwarnings = 0; |
var removalinfo = 0; |
|
if (doactions == 1) { |
if (doactions == 1) { |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
if ((remidxlist != '') && (remidxlist != null)) { |
if ((remidxlist != '') && (remidxlist != null)) { |
Line 6604 function checkSubmits() {
|
Line 6410 function checkSubmits() {
|
remwarnings ++; |
remwarnings ++; |
} |
} |
} |
} |
if (document.getElementById('confirm_removal_'+remidxs[i])) { |
|
if (document.getElementById('confirm_removal_'+remidxs[i]).value == 1) { |
|
removalinfo ++; |
|
} |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 6707 function checkSubmits() {
|
Line 6508 function checkSubmits() {
|
} |
} |
if (doactions == 1) { |
if (doactions == 1) { |
if (numchanges > 0) { |
if (numchanges > 0) { |
if ((cutwarnings > 0) || (remwarnings > 0) || (removalinfo > 0)) { |
if ((cutwarnings > 0) || (remwarnings > 0)) { |
if (remwarnings > 0) { |
if (remwarnings > 0) { |
if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) { |
if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) { |
return false; |
|
} |
|
} |
|
if (removalinfo > 0) { |
|
if (!confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr3a"} '+removalinfo+' $js_lt{"p_rmr3b"}')) { |
|
return false; |
return false; |
} |
} |
} |
} |
if (cutwarnings > 0) { |
if (cutwarnings > 0) { |
if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) { |
if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) { |
return false; |
return false; |
} |
} |
} |
} |
Line 6735 function checkSubmits() {
|
Line 6531 function checkSubmits() {
|
} |
} |
} |
} |
if ((dosettings == 1) && (doactions == 1)) { |
if ((dosettings == 1) && (doactions == 1)) { |
alert("$js_lt{'noor'}"); |
alert("$lt{'noor'}"); |
} else { |
} else { |
if (dosettings == 1) { |
if (dosettings == 1) { |
alert("$js_lt{'noch'}"); |
alert("$lt{'noch'}"); |
} else { |
} else { |
alert("$js_lt{'noac'}"); |
alert("$lt{'noac'}"); |
} |
} |
} |
} |
return false; |
return false; |
Line 6855 ENDINJECT
|
Line 6651 ENDINJECT
|
|
|
sub dump_switchserver_js { |
sub dump_switchserver_js { |
my @hosts = @_; |
my @hosts = @_; |
my %js_lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
dump => 'Copying content to Authoring Space requires switching server.', |
dump => 'Copying Content to Authoring Space requires switching server.', |
swit => 'Switch server?', |
|
); |
|
my %html_js_lt = &Apache::lonlocal::texthash( |
|
swit => 'Switch server?', |
swit => 'Switch server?', |
duco => 'Copying Content to Authoring Space', |
duco => 'Copying Content to Authoring Space', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
chos => 'Choose server', |
chos => 'Choose server', |
); |
); |
&js_escape(\%js_lt); |
|
&html_escape(\%html_js_lt); |
|
&js_escape(\%html_js_lt); |
|
my $role = $env{'request.role'}; |
my $role = $env{'request.role'}; |
my $js = <<"ENDSWJS"; |
my $js = <<"ENDSWJS"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 6908 ENDSWJS
|
Line 6698 ENDSWJS
|
|
|
function dump_needs_switchserver(url) { |
function dump_needs_switchserver(url) { |
if (url!='' && url!= null) { |
if (url!='' && url!= null) { |
if (confirm("$js_lt{'dump'}\\n$js_lt{'swit'}")) { |
if (confirm("$lt{'dump'}\\n$lt{'swit'}")) { |
go(url); |
go(url); |
} |
} |
} |
} |
Line 6919 function choose_switchserver_window() {
|
Line 6709 function choose_switchserver_window() {
|
newWindow = window.open('','ChooseServer','height=400,width=500,scrollbars=yes') |
newWindow = window.open('','ChooseServer','height=400,width=500,scrollbars=yes') |
newWindow.document.open(); |
newWindow.document.open(); |
newWindow.document.writeln('$startpage'); |
newWindow.document.writeln('$startpage'); |
newWindow.document.write('<h3>$html_js_lt{'duco'}<\\/h3>\\n'+ |
newWindow.document.write('<h3>$lt{'duco'}<\\/h3>\\n'+ |
'<p>$html_js_lt{'yone'}<\\/p>\\n'+ |
'<p>$lt{'yone'}<\\/p>\\n'+ |
'<div class="LC_left_float"><fieldset><legend>$html_js_lt{'chos'}<\\/legend>\\n'+ |
'<div class="LC_left_float"><fieldset><legend>$lt{'chos'}<\\/legend>\\n'+ |
'<form name="setserver" method="post" action="" \\/>\\n'+ |
'<form name="setserver" method="post" action="" \\/>\\n'+ |
'$hostpicker\\n'+ |
'$hostpicker\\n'+ |
'<br \\/><br \\/>\\n'+ |
'<br \\/><br \\/>\\n'+ |
'<input type="button" name="makeswitch" value="$html_js_lt{'swit'}" '+ |
'<input type="button" name="makeswitch" value="$lt{'swit'}" '+ |
'onclick="write_switchserver();" \\/>\\n'+ |
'onclick="write_switchserver();" \\/>\\n'+ |
'<\\/form><\\/fieldset><\\/div><br clear="all" \\/>\\n'); |
'<\\/form><\\/fieldset><\\/div><br clear="all" \\/>\\n'); |
newWindow.document.writeln('$endpage'); |
newWindow.document.writeln('$endpage'); |