version 1.484.2.48, 2013/12/31 15:20:31
|
version 1.566, 2013/10/06 20:33:45
|
Line 41 use Apache::lonclonecourse;
|
Line 41 use Apache::lonclonecourse;
|
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::lonnavdisplay(); |
use Apache::lonnavdisplay(); |
use Apache::lonextresedit(); |
use Apache::lonextresedit(); |
use Apache::lontemplate(); |
|
use Apache::lonsimplepage(); |
|
use HTML::Entities; |
use HTML::Entities; |
use HTML::TokeParser; |
use HTML::TokeParser; |
use GDBM_File; |
use GDBM_File; |
Line 143 sub clean {
|
Line 141 sub clean {
|
sub dumpcourse { |
sub dumpcourse { |
my ($r) = @_; |
my ($r) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my ($starthash,$js); |
$r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Content to Authoring Space')."\n". |
unless (($env{'form.authorspace'}) && ($env{'form.authorfolder'}=~/\w/)) { |
&Apache::lonhtmlcommon::breadcrumbs('Dump '.$crstype.' Content to Authoring Space')."\n"); |
$js = <<"ENDJS"; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
|
function hide_searching() { |
|
if (document.getElementById('searching')) { |
|
document.getElementById('searching').style.display = 'none'; |
|
} |
|
return; |
|
} |
|
|
|
// ]]> |
|
</script> |
|
ENDJS |
|
$starthash = { |
|
add_entries => {'onload' => "hide_searching();"}, |
|
}; |
|
} |
|
$r->print(&Apache::loncommon::start_page('Copy '.$crstype.' Content to Authoring Space',$js,$starthash)."\n". |
|
&Apache::lonhtmlcommon::breadcrumbs('Copy '.$crstype.' Content to Authoring Space')."\n"); |
|
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
unless ($home) { |
unless ($home) { |
Line 183 ENDJS
|
Line 161 ENDJS
|
$r->print('<h3>'.&mt('Copying Files').'</h3>'); |
$r->print('<h3>'.&mt('Copying Files').'</h3>'); |
my $title=$env{'form.authorfolder'}; |
my $title=$env{'form.authorfolder'}; |
$title=&clean($title); |
$title=&clean($title); |
my ($navmap,$errormsg) = |
my %replacehash=(); |
&Apache::loncourserespicker::get_navmap_object($crstype,'dumpdocs'); |
foreach my $key (keys(%env)) { |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
if ($key=~/^form\.namefor\_(.+)/) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$replacehash{$1}=$env{$key}; |
my (%maps,%resources,%titles); |
} |
if (!ref($navmap)) { |
} |
$r->print($errormsg. |
|
&endContentScreen()); |
|
return ''; |
|
} else { |
|
&Apache::loncourserespicker::enumerate_course_contents($navmap,\%maps,\%resources,\%titles, |
|
'dumpdocs',$cdom,$cnum); |
|
} |
|
my @todump = &Apache::loncommon::get_env_multiple('form.archive'); |
|
my (%tocopy,%replacehash,%lookup,%deps,%display,%result,%depresult,%simpleproblems,%simplepages, |
|
%newcontent,%has_simpleprobs); |
|
foreach my $item (sort {$a <=> $b} (@todump)) { |
|
my $name = $env{'form.namefor_'.$item}; |
|
if ($resources{$item}) { |
|
my ($map,$id,$res) = &Apache::lonnet::decode_symb($resources{$item}); |
|
if ($res =~ m{^uploaded/$cdom/$cnum/\E((?:docs|supplemental)/.+)$}) { |
|
$tocopy{$1} = $name; |
|
$display{$item} = $1; |
|
$lookup{$1} = $item; |
|
} elsif ($res eq 'lib/templates/simpleproblem.problem') { |
|
$simpleproblems{$item} = { |
|
symb => $resources{$item}, |
|
name => $name, |
|
}; |
|
$display{$item} = 'simpleproblem_'.$name; |
|
if ($map =~ m{^\Quploaded/$cdom/$cnum/\E(.+)$}) { |
|
$has_simpleprobs{$1}{$id} = $item; |
|
} |
|
} elsif ($res =~ m{^adm/$match_domain/$match_username/(\d+)/smppg}) { |
|
my $marker = $1; |
|
my $db_name = &Apache::lonsimplepage::get_db_name($res,$marker,$cdom,$cnum); |
|
$simplepages{$item} = { |
|
res => $res, |
|
title => $titles{$item}, |
|
db => $db_name, |
|
marker => $marker, |
|
symb => $resources{$item}, |
|
name => $name, |
|
}; |
|
$display{$item} = '/'.$res; |
|
} |
|
} elsif ($maps{$item}) { |
|
if ($maps{$item} =~ m{^\Quploaded/$cdom/$cnum/\E((?:default|supplemental)_\d+\.(?:sequence|page))$}) { |
|
$tocopy{$1} = $name; |
|
$display{$item} = $1; |
|
$lookup{$1} = $item; |
|
} |
|
} else { |
|
next; |
|
} |
|
} |
|
my $crs='/uploaded/'.$env{'request.course.id'}.'/'; |
my $crs='/uploaded/'.$env{'request.course.id'}.'/'; |
$crs=~s/\_/\//g; |
$crs=~s/\_/\//g; |
my $mm = new File::MMagic; |
foreach my $item (keys(%replacehash)) { |
my $prefix = "/uploaded/$cdom/$cnum/"; |
my $newfilename=$title.'/'.$replacehash{$item}; |
%replacehash = %tocopy; |
$newfilename=~s/\.(\w+)$//; |
foreach my $item (sort(keys(%simpleproblems))) { |
my $ext=$1; |
my $content = &Apache::imsexport::simpleproblem($simpleproblems{$item}{'symb'}); |
$newfilename=&clean($newfilename); |
$newcontent{$display{$item}} = $content; |
$newfilename.='.'.$ext; |
} |
my @dirs=split(/\//,$newfilename); |
my $gateway = Apache::lonhtmlgateway->new('web'); |
my $path=$r->dir_config('lonDocRoot')."/priv/$cd/$ca"; |
foreach my $item (sort(keys(%simplepages))) { |
my $makepath=$path; |
if (ref($simplepages{$item}) eq 'HASH') { |
my $fail=0; |
my $pagetitle = $simplepages{$item}{'title'}; |
for (my $i=0;$i<$#dirs;$i++) { |
my %fields = &Apache::lonnet::dump($simplepages{$item}{'db'},$cdom,$cnum); |
$makepath.='/'.$dirs[$i]; |
my %contents; |
unless (-e $makepath) { |
foreach my $field (keys(%fields)) { |
unless(mkdir($makepath,0777)) { $fail=1; } |
if ($field =~ /^(?:aaa|bbb|ccc)_(\w+)$/) { |
} |
my $name = $1; |
} |
my $msg = $fields{$field}; |
$r->print('<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '); |
if ($name eq 'webreferences') { |
if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) { |
if ($msg =~ m{^https?://}) { |
if ($item=~/\.(sequence|page|html|htm|xml|xhtml)$/) { |
$contents{$name} = '<a href="'.$msg.'"><tt>'.$msg.'</tt></a>'; |
print $fh &Apache::lonclonecourse::rewritefile( |
} |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item), |
} else { |
(%replacehash,$crs => '') |
$msg = &Encode::decode('utf8',$msg); |
); |
$msg = $gateway->process_outgoing_html($msg,1); |
} else { |
$contents{$name} = $msg; |
print $fh |
} |
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item); |
} elsif ($field eq 'uploaded.photourl') { |
} |
my $marker = $simplepages{$item}{marker}; |
$fh->close(); |
if ($fields{$field} =~ m{^\Q$prefix\E(simplepage/$marker/.+)$}) { |
} else { |
my $filepath = $1; |
$fail=1; |
my ($relpath,$fname) = ($filepath =~ m{^(.+/)([^/]+)$}); |
} |
if ($fname ne '') { |
if ($fail) { |
$fname=~s/\.(\w+)$//; |
$r->print('<span class="LC_error">'.&mt('fail').'</span>'); |
my $ext=$1; |
} else { |
$fname = &clean($fname); |
$r->print('<span class="LC_success">'.&mt('ok').'</span>'); |
$fname.='.'.$ext; |
} |
$contents{image} = '<img src="'.$relpath.$fname.'" alt="Image" />'; |
} |
$replacehash{$filepath} = $relpath.$fname; |
|
$deps{$item}{$filepath} = 1; |
|
} |
|
} |
|
} |
|
} |
|
$replacehash{'/'.$simplepages{$item}{'res'}} = $simplepages{$item}{'name'}; |
|
$lookup{'/'.$simplepages{$item}{'res'}} = $item; |
|
my $content = ' |
|
<html> |
|
<head> |
|
<title>'.$pagetitle.'</title> |
|
</head> |
|
<body bgcolor="#ffffff">'; |
|
if ($contents{title}) { |
|
$content .= "\n".'<h2>'.$contents{title}.'</h2>'; |
|
} |
|
if ($contents{image}) { |
|
$content .= "\n".$contents{image}; |
|
} |
|
if ($contents{content}) { |
|
$content .= ' |
|
<div class="LC_Box"> |
|
<h4 class="LC_hcell">Content</h4>'. |
|
$contents{content}.' |
|
</div>'; |
|
} |
|
if ($contents{webreferences}) { |
|
$content .= ' |
|
<div class="LC_Box"> |
|
<h4 class="LC_hcell">Web References</h4>'. |
|
$contents{webreferences}.' |
|
</div>'; |
|
} |
|
$content .= ' |
|
</body> |
|
</html> |
|
'; |
|
$newcontent{'/'.$simplepages{$item}{res}} = $content; |
|
} |
|
} |
|
foreach my $item (keys(%tocopy)) { |
|
unless ($item=~/\.(sequence|page)$/) { |
|
my $currurlpath = $prefix.$item; |
|
my $currdirpath = &Apache::lonnet::filelocation('',$currurlpath); |
|
&recurse_html($mm,$prefix,$currdirpath,$currurlpath,$item,$lookup{$item},\%replacehash,\%deps); |
|
} |
|
} |
|
foreach my $num (sort {$a <=> $b} (@todump)) { |
|
my $src = $display{$num}; |
|
next if ($src eq ''); |
|
my @needcopy = (); |
|
if ($replacehash{$src}) { |
|
push(@needcopy,$src); |
|
if (ref($deps{$num}) eq 'HASH') { |
|
foreach my $dep (sort(keys(%{$deps{$num}}))) { |
|
if ($replacehash{$dep}) { |
|
push(@needcopy,$dep); |
|
} |
|
} |
|
} |
|
} elsif ($src =~ /^simpleproblem_/) { |
|
push(@needcopy,$src); |
|
} |
|
next if (@needcopy == 0); |
|
my ($result,$depresult); |
|
for (my $i=0; $i<@needcopy; $i++) { |
|
my $item = $needcopy[$i]; |
|
my $newfilename; |
|
if ($simpleproblems{$num}) { |
|
$newfilename=$title.'/'.$simpleproblems{$num}{'name'}; |
|
} else { |
|
$newfilename=$title.'/'.$replacehash{$item}; |
|
} |
|
$newfilename=~s/\.(\w+)$//; |
|
my $ext=$1; |
|
$newfilename=&clean($newfilename); |
|
$newfilename.='.'.$ext; |
|
my ($newrelpath) = ($newfilename =~ m{^\Q$title/\E(.+)$}); |
|
if ($newrelpath ne $replacehash{$item}) { |
|
$replacehash{$item} = $newrelpath; |
|
} |
|
my @dirs=split(/\//,$newfilename); |
|
my $path=$r->dir_config('lonDocRoot')."/priv/$cd/$ca"; |
|
my $makepath=$path; |
|
my $fail; |
|
my $origin; |
|
for (my $i=0;$i<$#dirs;$i++) { |
|
$makepath.='/'.$dirs[$i]; |
|
unless (-e $makepath) { |
|
unless(mkdir($makepath,0755)) { |
|
$fail = &mt('Directory creation failed.'); |
|
} |
|
} |
|
} |
|
if ($i == 0) { |
|
$result = '<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '; |
|
} else { |
|
$depresult .= '<li><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt> '. |
|
'<span class="LC_fontsize_small" style="font-weight: bold;">'. |
|
&mt('(dependency)').'</span>: '; |
|
} |
|
if (-e $path.'/'.$newfilename) { |
|
$fail = &mt('Destination already exists -- not overwriting.'); |
|
} else { |
|
if (my $fh=Apache::File->new('>'.$path.'/'.$newfilename)) { |
|
if (($item =~ m{^/adm/$match_domain/$match_username/\d+/smppg}) || |
|
($item =~ /^simpleproblem_/)) { |
|
print $fh $newcontent{$item}; |
|
} else { |
|
my $fileloc = &Apache::lonnet::filelocation('',$prefix.$item); |
|
if (-e $fileloc) { |
|
if ($item=~/\.(sequence|page|html|htm|xml|xhtml)$/) { |
|
if ((($1 eq 'sequence') || ($1 eq 'page')) && |
|
(ref($has_simpleprobs{$item}) eq 'HASH')) { |
|
my %changes = %{$has_simpleprobs{$item}}; |
|
my $content = &Apache::lonclonecourse::rewritefile( |
|
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item), |
|
(%replacehash,$crs => '') |
|
); |
|
my $updatedcontent = ''; |
|
my $parser = HTML::TokeParser->new(\$content); |
|
$parser->attr_encoded(1); |
|
while (my $token = $parser->get_token) { |
|
if ($token->[0] eq 'S') { |
|
if (($token->[1] eq 'resource') && |
|
($token->[2]->{'src'} eq '/res/lib/templates/simpleproblem.problem') && |
|
($changes{$token->[2]->{'id'}})) { |
|
my $id = $token->[2]->{'id'}; |
|
$updatedcontent .= '<'.$token->[1]; |
|
foreach my $attrib (@{$token->[3]}) { |
|
next unless ($attrib =~ /^(src|type|title|id)$/); |
|
if ($attrib eq 'src') { |
|
my ($file) = ($display{$changes{$id}} =~ /^\Qsimpleproblem_\E(.+)$/); |
|
if ($file) { |
|
$updatedcontent .= ' '.$attrib.'="'.$file.'"'; |
|
} else { |
|
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
|
} |
|
} else { |
|
$updatedcontent .= ' '.$attrib.'="'.$token->[2]->{$attrib}.'"'; |
|
} |
|
} |
|
$updatedcontent .= ' />'."\n"; |
|
} else { |
|
$updatedcontent .= $token->[4]."\n"; |
|
} |
|
} else { |
|
$updatedcontent .= $token->[2]; |
|
} |
|
} |
|
print $fh $updatedcontent; |
|
} else { |
|
print $fh &Apache::lonclonecourse::rewritefile( |
|
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item), |
|
(%replacehash,$crs => '') |
|
); |
|
} |
|
} else { |
|
print $fh |
|
&Apache::lonclonecourse::readfile($env{'request.course.id'},$item); |
|
} |
|
} else { |
|
$fail = &mt('Source does not exist.'); |
|
} |
|
} |
|
$fh->close(); |
|
} else { |
|
$fail = &mt('Could not write to destination.'); |
|
} |
|
} |
|
my $text; |
|
if ($fail) { |
|
$text = '<span class="LC_error">'.&mt('fail').(' 'x3).$fail.'</span>'; |
|
} else { |
|
$text = '<span class="LC_success">'.&mt('ok').'</span>'; |
|
} |
|
if ($i == 0) { |
|
$result .= $text; |
|
} else { |
|
$depresult .= $text.'</li>'; |
|
} |
|
} |
|
$r->print($result); |
|
if ($depresult) { |
|
$r->print('<ul>'.$depresult.'</ul>'); |
|
} |
|
} |
|
} else { |
} else { |
my ($navmap,$errormsg) = |
$r->print(&mt('Searching ...').'<br />'); |
&Apache::loncourserespicker::get_navmap_object($crstype,'dumpdocs'); |
$r->rflush(); |
if (!ref($navmap)) { |
# Input form |
$r->print($errormsg); |
$r->print('<form name="dumpdoc" action="" method="post">'."\n"); |
} else { |
unless ($home==1) { |
$r->print('<div id="searching">'.&mt('Searching ...').'</div>'); |
$r->print('<div class="LC_left_float">'. |
$r->rflush(); |
'<fieldset><legend>'. |
my ($preamble,$formname); |
&mt('Select the Authoring Space'). |
$formname = 'dumpdoc'; |
'</legend><select name="authorspace">'); |
unless ($home==1) { |
} |
$preamble = '<div class="LC_left_float">'. |
foreach my $key (sort(keys(%outhash))) { |
'<fieldset><legend>'. |
if ($key=~/^home_(.+)$/) { |
&mt('Select the Authoring Space'). |
if ($home==1) { |
'</legend><select name="authorspace">'; |
$r->print( |
} |
'<input type="hidden" name="authorspace" value="'.$1.'" />'); |
my @orderspaces = (); |
} else { |
foreach my $key (sort(keys(%outhash))) { |
$r->print('<option value="'.$1.'">'.$1.' - '. |
if ($key=~/^home_(.+)$/) { |
&Apache::loncommon::plainname(split(/\:/,$1)).'</option>'); |
if ($1 eq $env{'user.name'}.':'.$env{'user.domain'}) { |
} |
unshift(@orderspaces,$1); |
} |
} else { |
} |
push(@orderspaces,$1); |
unless ($home==1) { |
} |
$r->print('</select></fieldset></div>'."\n"); |
} |
} |
} |
my $title=$origcrsdata{'description'}; |
if ($home>1) { |
$title=~s/[\/\s]+/\_/gs; |
$preamble .= '<option value="" selected="selected">'.&mt('Select').'</option>'; |
$title=&clean($title); |
} |
$r->print('<div class="LC_left_float">'. |
foreach my $user (@orderspaces) { |
'<fieldset><legend>'.&mt('Folder in Authoring Space').'</legend>'. |
if ($home==1) { |
'<input type="text" size="50" name="authorfolder" value="'. |
$preamble .= '<input type="hidden" name="authorspace" value="'.$user.'" />'; |
$title.'" />'. |
} else { |
'</fieldset></div><br clear="all" />'."\n"); |
$preamble .= '<option value="'.$user.'">'.$user.' - '. |
&tiehash(); |
&Apache::loncommon::plainname(split(/\:/,$user)).'</option>'; |
$r->print('<h4>'.&mt('Filenames in Authoring Space').'</h4>' |
} |
.&Apache::loncommon::start_data_table() |
} |
.&Apache::loncommon::start_data_table_header_row() |
unless ($home==1) { |
.'<th>'.&mt('Internal Filename').'</th>' |
$preamble .= '</select></fieldset></div>'."\n"; |
.'<th>'.&mt('Title').'</th>' |
} |
.'<th>'.&mt('Save as ...').'</th>' |
my $title=$origcrsdata{'description'}; |
.&Apache::loncommon::end_data_table_header_row()); |
$title=~s/[\/\s]+/\_/gs; |
foreach my $file (&Apache::lonclonecourse::crsdirlist($origcrsid,'userfiles')) { |
$title=&clean($title); |
$r->print(&Apache::loncommon::start_data_table_row() |
$preamble .= '<div class="LC_left_float">'. |
.'<td>'.$file.'</td>'); |
'<fieldset><legend>'.&mt('Folder in Authoring Space').'</legend>'. |
my ($ext)=($file=~/\.(\w+)$/); |
'<input type="text" size="50" name="authorfolder" value="'. |
my $title=$hash{'title_'.$hash{ |
$title.'" />'. |
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$file}}; |
'</fieldset></div><div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"; |
$r->print('<td>'.($title?$title:' ').'</td>'); |
my %uploadedfiles; |
if (!$title) { |
&tiehash(); |
$title=$file; |
foreach my $file (&Apache::lonclonecourse::crsdirlist($origcrsid,'userfiles')) { |
} else { |
my ($ext)=($file=~/\.(\w+)$/); |
$title=~s|/|_|g; |
# FIXME Check supplemental here |
} |
my $title=$hash{'title_'.$hash{ |
$title=~s/\.(\w+)$//; |
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$file}}; |
$title=&clean($title); |
if (!$title) { |
$title.='.'.$ext; |
$title=$file; |
$r->print("\n<td><input type='text' size='60' name='namefor_".$file."' value='".$title."' /></td>" |
} else { |
.&Apache::loncommon::end_data_table_row()); |
$title=~s|/|_|g; |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$title=~s/\.(\w+)$//; |
&untiehash(); |
$title=&clean($title); |
$r->print( |
$title.='.'.$ext; |
'<p><input type="submit" name="dumpcourse" value="'.&mt("Dump $crstype Content").'" /></p></form>'); |
# $r->print("\n<td><input type='text' size='60' name='namefor_".$file."' value='".$title."' /></td>" |
|
$uploadedfiles{$file} = $title; |
|
} |
|
&untiehash(); |
|
$r->print(&Apache::loncourserespicker::create_picker($navmap,'dumpdocs',$formname,$crstype,undef, |
|
undef,undef,$preamble,$home,\%uploadedfiles)); |
|
} |
|
} |
} |
$r->print(&endContentScreen()); |
$r->print(&endContentScreen()); |
} |
} |
|
|
sub recurse_html { |
|
my ($mm,$prefix,$currdirpath,$currurlpath,$container,$item,$replacehash,$deps) = @_; |
|
return unless ((ref($replacehash) eq 'HASH') && (ref($deps) eq 'HASH')); |
|
my (%allfiles,%codebase); |
|
if (&Apache::lonnet::extract_embedded_items($currdirpath,\%allfiles,\%codebase) eq 'ok') { |
|
if (keys(%allfiles)) { |
|
foreach my $dependency (keys(%allfiles)) { |
|
next if (($dependency =~ m{^/(res|adm)/}) || ($dependency =~ m{^https?://})); |
|
my ($depurl,$relfile,$newcontainer); |
|
if ($dependency =~ m{^/}) { |
|
if ($dependency =~ m{^\Q$currurlpath/\E(.+)$}) { |
|
$relfile = $1; |
|
if ($dependency =~ m{^\Q$prefix\E(.+)$}) { |
|
$newcontainer = $1; |
|
next if ($replacehash->{$newcontainer}); |
|
} |
|
$depurl = $dependency; |
|
} else { |
|
next; |
|
} |
|
} else { |
|
$relfile = $dependency; |
|
$depurl = $currurlpath; |
|
$depurl =~ s{[^/]+$}{}; |
|
$depurl .= $dependency; |
|
($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); |
|
} |
|
next if ($relfile eq ''); |
|
my $newname = $replacehash->{$container}; |
|
$newname =~ s{[^/]+$}{}; |
|
$replacehash->{$newcontainer} = $newname.$relfile; |
|
$deps->{$item}{$newcontainer} = 1; |
|
my ($newurlpath) = ($depurl =~ m{^(.*)/[^/]+$}); |
|
my $depfile = &Apache::lonnet::filelocation('',$depurl); |
|
my $type = $mm->checktype_filename($depfile); |
|
if ($type eq 'text/html') { |
|
&recurse_html($mm,$prefix,$depfile,$newurlpath,$newcontainer,$item,$replacehash,$deps); |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub group_import { |
sub group_import { |
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_; |
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_; |
my ($donechk,$allmaps,%hierarchy,%titles,%addedmaps,%removefrommap, |
my ($donechk,$allmaps,%hierarchy,%titles,%addedmaps,%removefrommap, |
Line 666 $initialtext
|
Line 355 $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 691 END
|
Line 380 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 1124 sub print_paste_buffer {
|
Line 813 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 1133 sub print_paste_buffer {
|
Line 821 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 1227 sub print_paste_buffer {
|
Line 914 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 1397 function validateClipboard() {
|
Line 1072 function validateClipboard() {
|
} |
} |
} |
} |
|
|
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 1661 sub do_paste_from_buffer {
|
Line 1318 sub do_paste_from_buffer {
|
next; |
next; |
} |
} |
if ($lockerr{$prefix}) { |
if ($lockerr{$prefix}) { |
$lockerrs{$suffix} = $lockerr{$prefix}; |
$lockerrs{$suffix} = $lockerr{$prefix}; |
} |
} |
} |
} |
} |
} |
Line 1700 sub do_paste_from_buffer {
|
Line 1357 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 1907 sub dbcopy {
|
Line 1564 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 1942 sub dbcopy {
|
Line 1599 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 2092 sub url_paste_fixups {
|
Line 1749 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 2538 sub update_parameter {
|
Line 2195 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 2565 sub update_parameter {
|
Line 2222 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 3024 sub editor {
|
Line 2681 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 3172 sub process_file_upload {
|
Line 2829 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.instcode'}) { |
} 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 |
Line 3644 $form_common."\n".
|
Line 3299 $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 3848 sub new_timebased_suffix {
|
Line 3503 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') { |
Line 4067 sub devalidateversioncache {
|
Line 3722 sub devalidateversioncache {
|
sub checkversions { |
sub checkversions { |
my ($r) = @_; |
my ($r) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
$r->print(&Apache::loncommon::start_page("Check $crstype Resource Versions")); |
$r->print(&Apache::loncommon::start_page("Check $crstype Document Versions")); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Resource Versions")); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Document Versions")); |
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
|
|
my $header=''; |
my $header=''; |
Line 4224 $lt{'sc'}: <input type="submit" name="se
|
Line 3879 $lt{'sc'}: <input type="submit" name="se
|
<br clear="all" /> |
<br clear="all" /> |
<hr /> |
<hr /> |
<h4>$lt{'vers'}</h4> |
<h4>$lt{'vers'}</h4> |
|
<input type="submit" name="setversions" value="$lt{'save'}" /> |
ENDHEADERS |
ENDHEADERS |
#number of columns for version history |
#number of columns for version history |
my %changedbytime; |
|
foreach my $key (keys(%changes)) { |
|
#excludes not versionable problems from resource version history: |
|
next if ($key =~ /^\/res\/lib\/templates/); |
|
my $chg; |
|
if ($env{'form.timerange'} eq 'all') { |
|
my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); |
|
$chg = &Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate'); |
|
} else { |
|
$chg = $changes{$key}; |
|
next if ($chg < $starttime); |
|
} |
|
push(@{$changedbytime{$chg}},$key); |
|
} |
|
if (keys(%changedbytime) == 0) { |
|
&untiehash(); |
|
$r->print(&mt('No content changes in imported content in specified time frame'). |
|
&endContentScreen()); |
|
return; |
|
} |
|
$r->print( |
$r->print( |
'<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 4257 ENDHEADERS
|
Line 3892 ENDHEADERS
|
'<th>'.&mt('History').'</th>'. |
'<th>'.&mt('History').'</th>'. |
&Apache::loncommon::end_data_table_header_row() |
&Apache::loncommon::end_data_table_header_row() |
); |
); |
foreach my $chg (sort {$b <=> $a } keys(%changedbytime)) { |
foreach my $key (sort(keys(%changes))) { |
foreach my $key (sort(@{$changedbytime{$chg}})) { |
#excludes not versionable problems from resource version history: |
my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); |
next unless ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/); |
my $currentversion=&Apache::lonnet::getversion($key); |
my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); |
if ($currentversion<0) { |
my $currentversion=&Apache::lonnet::getversion($key); |
$currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>'; |
if ($currentversion<0) { |
} |
$currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>'; |
my $linkurl=&Apache::lonnet::clutter($key); |
} |
$r->print( |
my $linkurl=&Apache::lonnet::clutter($key); |
&Apache::loncommon::start_data_table_row(). |
$r->print( |
'<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br />'. |
&Apache::loncommon::start_data_table_row(). |
'<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'. |
'<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br />'. |
'<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br />('. |
'<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'. |
&Apache::lonlocal::locallocaltime($chg).')</span></td>'. |
'<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br />('. |
'<td align="right">' |
&Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).')</span></td>'. |
); |
'<td align="right">' |
# Used in course |
); |
my $usedversion=$hash{'version_'.$linkurl}; |
# Used in course |
if (($usedversion) && ($usedversion ne 'mostrecent')) { |
my $usedversion=$hash{'version_'.$linkurl}; |
|
if (($usedversion) && ($usedversion ne 'mostrecent')) { |
if ($usedversion != $currentversion) { |
if ($usedversion != $currentversion) { |
$r->print('<span class="LC_warning">'.$usedversion.'</span>'); |
$r->print('<span class="LC_warning">'.$usedversion.'</span>'); |
} else { |
} else { |
Line 4284 ENDHEADERS
|
Line 3920 ENDHEADERS
|
} else { |
} else { |
$r->print($currentversion); |
$r->print($currentversion); |
} |
} |
$r->print('</td><td title="'.$lt{'vu'}.'">'); |
$r->print('</td><td title="'.$lt{'vu'}.'">'); |
# Set version |
# Set version |
$r->print(&Apache::loncommon::select_form( |
$r->print(&Apache::loncommon::select_form( |
$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; |
if (&Apache::lonnet::metadata($url,'lastrevisiondate')<$starttime) { |
if (&Apache::lonnet::metadata($url,'lastrevisiondate')<$starttime) { |
$lastold=$prevvers; |
$lastold=$prevvers; |
} |
} |
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
# List all available versions |
# List all available versions |
$r->print('<td valign="top"><span class="LC_fontsize_medium">'); |
$r->print('<td valign="top"><span class="LC_fontsize_medium">'); |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
my $url=$root.'.'.$prevvers.'.'.$extension; |
my $url=$root.'.'.$prevvers.'.'.$extension; |
$r->print( |
$r->print( |
'<span class="LC_nobreak">' |
'<span class="LC_nobreak">' |
.'<a href="'.&Apache::lonnet::clutter($url).'">' |
.'<a href="'.&Apache::lonnet::clutter($url).'">' |
.&mt('Version [_1]',$prevvers).'</a>' |
.&mt('Version [_1]',$prevvers).'</a>' |
.' ('.&Apache::lonlocal::locallocaltime( |
.' ('.&Apache::lonlocal::locallocaltime( |
&Apache::lonnet::metadata($url,'lastrevisiondate')) |
&Apache::lonnet::metadata($url,'lastrevisiondate')) |
.')'); |
.')'); |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { |
$r->print( |
$r->print( |
' <a href="/adm/diff?filename='. |
' <a href="/adm/diff?filename='. |
&Apache::lonnet::clutter($root.'.'.$extension). |
&Apache::lonnet::clutter($root.'.'.$extension). |
&HTML::Entities::encode('&versionone='.$prevvers,'"<>&'). |
&HTML::Entities::encode('&versionone='.$prevvers,'"<>&'). |
'" target="diffs">'.&mt('Diffs').'</a>'); |
'" target="diffs">'.&mt('Diffs').'</a>'); |
} |
|
$r->print('</span><br />'); |
|
} |
} |
$r->print('</span></td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</span><br />'); |
} |
} |
|
$r->print('</span></td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print( |
$r->print( |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
Line 4332 ENDHEADERS
|
Line 3967 ENDHEADERS
|
|
|
&untiehash(); |
&untiehash(); |
$r->print(&endContentScreen()); |
$r->print(&endContentScreen()); |
return; |
|
} |
} |
|
|
sub mark_hash_old { |
sub mark_hash_old { |
Line 4387 $help{'Caching'}.'</p></form>'."\n\n");
|
Line 4021 $help{'Caching'}.'</p></form>'."\n\n");
|
|
|
|
|
sub init_breadcrumbs { |
sub init_breadcrumbs { |
my ($form,$text,$help)=@_; |
my ($form,$text)=@_; |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?tools=1", |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?tools=1", |
text=>&Apache::loncommon::course_type().' Editor', |
text=>&Apache::loncommon::course_type().' Editor', |
faq=>273, |
faq=>273, |
bug=>'Instructor Interface', |
bug=>'Instructor Interface', |
help => $help}); |
help => 'Docs_Adding_Course_Doc'}); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?".$form.'=1', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?".$form.'=1', |
text=>$text, |
text=>$text, |
faq=>273, |
faq=>273, |
Line 4429 sub startContentScreen {
|
Line 4063 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 4476 sub handler {
|
Line 4111 sub handler {
|
'Adding_Folders','Docs_Overview', 'Load_Map', |
'Adding_Folders','Docs_Overview', 'Load_Map', |
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Importing_LON-CAPA_Resource','Importing_IMS_Course', |
'Importing_LON-CAPA_Resource','Importing_IMS_Course', |
'Uploading_From_Harddrive','Course_Roster','Web_Page', |
'Uploading_From_Harddrive', |
'Dropbox','Simple_Problem') { |
'Check_Resource_Versions','Verify_Content', |
|
'Course_Roster','Web_Page','Dropbox') { |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
} |
} |
# Composite help files |
# Composite help files |
Line 4485 sub handler {
|
Line 4121 sub handler {
|
'Docs_About_Syllabus,Docs_Editing_Templated_Pages'); |
'Docs_About_Syllabus,Docs_Editing_Templated_Pages'); |
$help{'Simple Page'} = &Apache::loncommon::help_open_topic( |
$help{'Simple Page'} = &Apache::loncommon::help_open_topic( |
'Docs_About_Simple_Page,Docs_Editing_Templated_Pages'); |
'Docs_About_Simple_Page,Docs_Editing_Templated_Pages'); |
|
$help{'Simple Problem'} = &Apache::loncommon::help_open_topic( |
|
'Option_Response_Simple'); |
$help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( |
$help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( |
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); |
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); |
$help{'My Personal Information Page'} = &Apache::loncommon::help_open_topic( |
$help{'My Personal Information Page'} = &Apache::loncommon::help_open_topic( |
Line 4505 sub handler {
|
Line 4143 sub handler {
|
&choose_dump_server($r); |
&choose_dump_server($r); |
return OK; |
return OK; |
} elsif ($allowed && $env{'form.verify'}) { |
} elsif ($allowed && $env{'form.verify'}) { |
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content'); |
&init_breadcrumbs('verify','Verify Content'); |
&verifycontent($r); |
&verifycontent($r); |
} elsif ($allowed && $env{'form.listsymbs'}) { |
} elsif ($allowed && $env{'form.listsymbs'}) { |
&init_breadcrumbs('listsymbs','List Content IDs'); |
&init_breadcrumbs('listsymbs','List Content IDs'); |
Line 4518 sub handler {
|
Line 4156 sub handler {
|
} |
} |
&docs_change_log($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath); |
&docs_change_log($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath); |
} elsif ($allowed && $env{'form.versions'}) { |
} elsif ($allowed && $env{'form.versions'}) { |
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); |
&init_breadcrumbs('versions','Check/Set Resource Versions'); |
&checkversions($r); |
&checkversions($r); |
} elsif ($allowed && $env{'form.dumpcourse'}) { |
} elsif ($allowed && $env{'form.dumpcourse'}) { |
&init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space'); |
&init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' Content to Authoring Space'); |
&dumpcourse($r); |
&dumpcourse($r); |
} elsif ($allowed && $env{'form.exportcourse'}) { |
} elsif ($allowed && $env{'form.exportcourse'}) { |
&init_breadcrumbs('exportcourse','IMS Export'); |
&init_breadcrumbs('exportcourse','IMS Export'); |
Line 4689 sub handler {
|
Line 4327 sub handler {
|
$script .= &dump_switchserver_js(@hosts); |
$script .= &dump_switchserver_js(@hosts); |
} |
} |
} else { |
} else { |
my $tid = 1; |
|
my @tabids; |
my @tabids; |
if ($supplementalflag) { |
if ($supplementalflag) { |
@tabids = ('002','ee2','ff2'); |
@tabids = ('002','ee2','ff2'); |
$tid = 2; |
|
} else { |
} else { |
@tabids = ('aa1','bb1','cc1','ff1'); |
@tabids = ('aa1','bb1','cc1','ff1'); |
unless ($env{'form.folderpath'} =~ /\:1$/) { |
unless ($env{'form.folderpath'} =~ /\:1$/) { |
Line 4705 sub handler {
|
Line 4341 sub handler {
|
$script .= &editing_js($udom,$uname,$supplementalflag). |
$script .= &editing_js($udom,$uname,$supplementalflag). |
&history_tab_js(). |
&history_tab_js(). |
&inject_data_js(). |
&inject_data_js(). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr). |
&Apache::lonextresedit::extedit_javascript(); |
&Apache::lonextresedit::extedit_javascript(); |
$addentries = { |
$addentries = { |
onload => "javascript:resize_scrollbox('contentscroll','1','1');", |
onload => "javascript:resize_scrollbox('contentscroll','1','1');", |
Line 4730 sub handler {
|
Line 4366 sub handler {
|
if ($showdoc) { |
if ($showdoc) { |
$r->print(&Apache::loncommon::start_page("$crstype documents",undef, |
$r->print(&Apache::loncommon::start_page("$crstype documents",undef, |
{'force_register' => $showdoc,})); |
{'force_register' => $showdoc,})); |
} elsif ($toolsflag) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
href=>"/adm/coursedocs",text=>"$crstype Contents"}); |
|
$r->print(&Apache::loncommon::start_page("$crstype Contents", $script) |
|
.&Apache::loncommon::help_open_menu('','',273,'RAT') |
|
.&Apache::lonhtmlcommon::breadcrumbs( |
|
'Editing Course Contents') |
|
); |
|
} elsif ($r->uri eq '/adm/supplemental') { |
} elsif ($r->uri eq '/adm/supplemental') { |
my $brcrum = &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype); |
my $brcrum = &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype); |
$r->print(&Apache::loncommon::start_page("Supplemental $crstype Content",undef, |
$r->print(&Apache::loncommon::start_page("Supplemental $crstype Content",undef, |
Line 4830 sub handler {
|
Line 4458 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 5008 HIDDENFORM
|
Line 4636 HIDDENFORM
|
|
|
my $newnavform=(<<NNFORM); |
my $newnavform=(<<NNFORM); |
<form action="/adm/coursedocs" method="post" name="newnav"> |
<form action="/adm/coursedocs" method="post" name="newnav"> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'navc'}=/adm/navmaps" /> |
value="$lt{'navc'}=/adm/navmaps" /> |
Line 5018 HIDDENFORM
|
Line 4646 HIDDENFORM
|
NNFORM |
NNFORM |
my $newsmppageform=(<<NSPFORM); |
my $newsmppageform=(<<NSPFORM); |
<form action="/adm/coursedocs" method="post" name="newsmppg"> |
<form action="/adm/coursedocs" method="post" name="newsmppg"> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makesmppage();"> $lt{'sipa'}</a> |
<a class="LC_menubuttons_link" href="javascript:makesmppage();"> $lt{'sipa'}</a> |
Line 5032 NSPFORM
|
Line 4660 NSPFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makesmpproblem();">$lt{'sipr'}</a> |
<a class="LC_menubuttons_link" href="javascript:makesmpproblem();">$lt{'sipr'}</a> |
$help{'Simple_Problem'} |
$help{'Simple Problem'} |
</form> |
</form> |
|
|
NSPROBFORM |
NSPROBFORM |
Line 5059 NEXUFORM
|
Line 4687 NEXUFORM
|
|
|
my $newbulform=(<<NBFORM); |
my $newbulform=(<<NBFORM); |
<form action="/adm/coursedocs" method="post" name="newbul"> |
<form action="/adm/coursedocs" method="post" name="newbul"> |
<input type="hidden" name="active" value="dd" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makebulboard();" >$lt{'bull'}</a> |
<a class="LC_menubuttons_link" href="javascript:makebulboard();" >$lt{'bull'}</a> |
Line 5069 NBFORM
|
Line 4697 NBFORM
|
|
|
my $newaboutmeform=(<<NAMFORM); |
my $newaboutmeform=(<<NAMFORM); |
<form action="/adm/coursedocs" method="post" name="newaboutme"> |
<form action="/adm/coursedocs" method="post" name="newaboutme"> |
<input type="hidden" name="active" value="dd" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
Line 5080 NAMFORM
|
Line 4708 NAMFORM
|
|
|
my $newaboutsomeoneform=(<<NASOFORM); |
my $newaboutsomeoneform=(<<NASOFORM); |
<form action="/adm/coursedocs" method="post" name="newaboutsomeone"> |
<form action="/adm/coursedocs" method="post" name="newaboutsomeone"> |
<input type="hidden" name="active" value="dd" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makeabout();">$lt{'abou'}</a> |
<a class="LC_menubuttons_link" href="javascript:makeabout();">$lt{'abou'}</a> |
Line 5089 NASOFORM
|
Line 4717 NASOFORM
|
|
|
my $newrosterform=(<<NROSTFORM); |
my $newrosterform=(<<NROSTFORM); |
<form action="/adm/coursedocs" method="post" name="newroster"> |
<form action="/adm/coursedocs" method="post" name="newroster"> |
<input type="hidden" name="active" value="dd" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'rost'}=/adm/viewclasslist" /> |
value="$lt{'rost'}=/adm/viewclasslist" /> |
Line 5110 NROSTFORM
|
Line 4738 NROSTFORM
|
} |
} |
my $newwebpageform =(<<NWEBFORM); |
my $newwebpageform =(<<NWEBFORM); |
<form action="/adm/coursedocs" method="post" name="newwebpage"> |
<form action="/adm/coursedocs" method="post" name="newwebpage"> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="$newwebpage" /> |
<input type="hidden" name="importdetail" value="$newwebpage" /> |
<a class="LC_menubuttons_link" href="javascript:makewebpage();">$lt{'webp'}</a> |
<a class="LC_menubuttons_link" href="javascript:makewebpage();">$lt{'webp'}</a> |
Line 5134 my $newfolderb;
|
Line 4762 my $newfolderb;
|
<form action="/adm/coursedocs" method="post" name="newpage"> |
<form action="/adm/coursedocs" method="post" name="newpage"> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="cc" /> |
<a class="LC_menubuttons_link" href="javascript:makenewpage(document.newpage,'$pageseq');">$lt{'newp'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenewpage(document.newpage,'$pageseq');">$lt{'newp'}</a> |
$help{'Adding_Pages'} |
$help{'Adding_Pages'} |
</form> |
</form> |
Line 5145 NPFORM
|
Line 4773 NPFORM
|
<form action="/adm/coursedocs" method="post" name="newfolder"> |
<form action="/adm/coursedocs" method="post" name="newfolder"> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="active" value="" /> |
<input type="hidden" name="active" value="aa" /> |
<a href="javascript:makenewfolder(document.newfolder,'$folderseq');">$lt{'newf'}</a>$help{'Adding_Folders'} |
<a href="javascript:makenewfolder(document.newfolder,'$folderseq');">$lt{'newf'}</a>$help{'Adding_Folders'} |
</form> |
</form> |
NFFORM |
NFFORM |
|
|
my $newsylform=(<<NSYLFORM); |
my $newsylform=(<<NSYLFORM); |
<form action="/adm/coursedocs" method="post" name="newsyl"> |
<form action="/adm/coursedocs" method="post" name="newsyl"> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" /> |
value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" /> |
Line 5164 NSYLFORM
|
Line 4792 NSYLFORM
|
|
|
my $newgroupfileform=(<<NGFFORM); |
my $newgroupfileform=(<<NGFFORM); |
<form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
<form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
<input type="hidden" name="active" value="dd" /> |
<input type="hidden" name="active" value="cc" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
Line 5281 SUPDOCFORM
|
Line 4909 SUPDOCFORM
|
|
|
my $supnewfolderform=(<<SNFFORM); |
my $supnewfolderform=(<<SNFFORM); |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
<input type="hidden" name="active" value="" /> |
<input type="hidden" name="active" value="ee" /> |
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makenewfolder(document.supnewfolder,'$folderseq');">$lt{'newf'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenewfolder(document.supnewfolder,'$folderseq');">$lt{'newf'}</a> |
Line 5374 my %suporderhash = (
|
Line 5002 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 5522 sub remove_archive {
|
Line 5150 sub remove_archive {
|
} else { |
} else { |
my $currcmd = $env{'form.cmd'}; |
my $currcmd = $env{'form.cmd'}; |
my $position = $env{'form.position'}; |
my $position = $env{'form.position'}; |
if ($position > 0) { |
if ($position > 0) { |
$env{'form.cmd'} = 'remove_'.$position; |
$env{'form.cmd'} = 'remove_'.$position; |
my ($title,$url,@rrest) = |
my ($title,$url,@rrest) = |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); |
Line 5563 sub generate_admin_menu {
|
Line 5191 sub generate_admin_menu {
|
'cv' => 'Check/Set Resource Versions', |
'cv' => 'Check/Set Resource Versions', |
'ls' => 'List Resource Identifiers', |
'ls' => 'List Resource Identifiers', |
'imse' => 'Export contents to IMS Archive', |
'imse' => 'Export contents to IMS Archive', |
'dcd' => "Copy $crstype Content to Authoring Space", |
'dcd' => "Dump $crstype Content to Authoring Space", |
); |
); |
my ($candump,$dumpurl); |
my ($candump,$dumpurl); |
if ($home + $other > 0) { |
if ($home + $other > 0) { |
Line 5594 sub generate_admin_menu {
|
Line 5222 sub generate_admin_menu {
|
{ linktext => $lt{'vc'}, |
{ linktext => $lt{'vc'}, |
url => "javascript:injectData(document.courseverify,'dummy','verify','$lt{'vc'}')", |
url => "javascript:injectData(document.courseverify,'dummy','verify','$lt{'vc'}')", |
permission => 'F', |
permission => 'F', |
help => 'Docs_Verify_Content', |
help => 'Verify_Content', |
icon => 'verify.png', |
icon => 'verify.png', |
linktitle => 'Verify contents can be retrieved/rendered', |
linktitle => 'Verify contents can be retrieved/rendered', |
}, |
}, |
{ linktext => $lt{'cv'}, |
{ linktext => $lt{'cv'}, |
url => "javascript:injectData(document.courseverify,'dummy','versions','$lt{'cv'}')", |
url => "javascript:injectData(document.courseverify,'dummy','versions','$lt{'cv'}')", |
permission => 'F', |
permission => 'F', |
help => 'Docs_Check_Resource_Versions', |
help => 'Check_Resource_Versions', |
icon => 'resversion.png', |
icon => 'resversion.png', |
linktitle => "View version information for resources in your $lc_crstype, and fix/unfix use of specific versions", |
linktitle => "View version information for resources in your $lc_crstype, and fix/unfix use of specific versions", |
}, |
}, |
Line 5626 sub generate_admin_menu {
|
Line 5254 sub generate_admin_menu {
|
{ linktext => $lt{'dcd'}, |
{ linktext => $lt{'dcd'}, |
url => $dumpurl, |
url => $dumpurl, |
permission => $candump, |
permission => $candump, |
help => 'Docs_Dump_Course_Docs', |
#help => '', |
icon => 'dump.png', |
icon => 'dump.png', |
linktitle => $lt{'dcd'}, |
linktitle => $lt{'dcd'}, |
}, |
}, |
Line 5646 sub generate_edit_table {
|
Line 5274 sub generate_edit_table {
|
my $form; |
my $form; |
my $activetab; |
my $activetab; |
my $active; |
my $active; |
if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) { |
if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) { |
$activetab = $env{'form.active'}; |
$activetab = $env{'form.active'}; |
} |
} |
my $backicon = $iconpath.'clickhere.gif'; |
my $backicon = $iconpath.'clickhere.gif'; |
Line 5681 sub generate_edit_table {
|
Line 5309 sub generate_edit_table {
|
$form .= '<li style="float:right" '.$active |
$form .= '<li style="float:right" '.$active |
.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');"><a href="javascript:;"><b>'.&mt(${$orderhash{$name}}[0]).'</b></a></li>'."\n"; |
.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');"><a href="javascript:;"><b>'.&mt(${$orderhash{$name}}[0]).'</b></a></li>'."\n"; |
} else { |
} else { |
$form .= '<li style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n"; |
$form .= '<li '.$active.' style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n"; |
|
|
} |
} |
} |
} |
Line 5749 sub editing_js {
|
Line 5377 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', |
Line 5863 function makewebpage(type) {
|
Line 5491 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(); |
} |
} |
Line 6244 for (i = 0; i < currentLis.length; i++)
|
Line 5872 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.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); |
currentDivs = currentData.getElementsByTagName('DIV'); |
currentDivs = currentData.getElementsByTagName('DIV'); |
Line 6280 function openTabs(pageId) {
|
Line 5906 function openTabs(pageId) {
|
} |
} |
|
|
function showPage(current, pageId, nav, data) { |
function showPage(current, pageId, nav, data) { |
currstate = current.className; |
|
hideAll(current, nav, data); |
hideAll(current, nav, data); |
openTabs(pageId); |
openTabs(pageId); |
unselectInactive(nav); |
unselectInactive(nav); |
if ((currstate == 'active') || (currstate == 'right active')) { |
current.className = 'active'; |
if (currstate == 'active') { |
|
current.className = ''; |
|
} else { |
|
current.className = 'right'; |
|
} |
|
activeTab = ''; |
|
toggleUpload(); |
|
toggleMap(); |
|
resize_scrollbox('contentscroll','1','0'); |
|
return; |
|
} else { |
|
current.className = 'active'; |
|
} |
|
currentData = document.getElementById(pageId); |
currentData = document.getElementById(pageId); |
currentData.style.display = 'block'; |
currentData.style.display = 'block'; |
activeTab = pageId; |
activeTab = pageId; |
Line 6685 ENDINJECT
|
Line 6297 ENDINJECT
|
sub dump_switchserver_js { |
sub dump_switchserver_js { |
my @hosts = @_; |
my @hosts = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
dump => 'Copying content to Authoring Space requires switching server.', |
dump => 'Dumping to Authoring Space requires switching server.', |
swit => 'Switch server?', |
swit => 'Switch server?', |
duco => 'Copying Content to Authoring Space', |
duco => 'Dump 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', |
); |
); |