version 1.484.2.8, 2012/08/27 15:58:05
|
version 1.492, 2012/07/22 04:01:24
|
Line 369 sub breadcrumbs {
|
Line 369 sub breadcrumbs {
|
} |
} |
|
|
sub log_docs { |
sub log_docs { |
return &Apache::lonnet::write_log('course','docslog',@_); |
return &Apache::lonnet::instructor_log('docslog',@_); |
} |
} |
|
|
{ |
{ |
Line 538 sub docs_change_log {
|
Line 538 sub docs_change_log {
|
':'.$docslog{$id}{'exe_udom'}.'</tt>'. |
':'.$docslog{$id}{'exe_udom'}.'</tt>'. |
$send_msg_link.'</td><td>'. |
$send_msg_link.'</td><td>'. |
$docslog{$id}{'logentry'}{'folder'}.'</td><td>'); |
$docslog{$id}{'logentry'}{'folder'}.'</td><td>'); |
my $is_supp = 0; |
my $is_supp = 0; |
if ($docslog{$id}{'logentry'}{'currentfolder'} =~ /^supplemental/) { |
if ($docslog{$id}{'logentry'}{'currentfolder'} =~ /^supplemental/) { |
$is_supp = 1; |
$is_supp = 1; |
} |
} |
Line 561 sub docs_change_log {
|
Line 561 sub docs_change_log {
|
if ($is_supp) { |
if ($is_supp) { |
$shown = &Apache::loncommon::parse_supplemental_title($shown); |
$shown = &Apache::loncommon::parse_supplemental_title($shown); |
} |
} |
$r->print('<li>'.$shown.'</li>'); |
$r->print('<li>'.$shown.'</li>'); |
} |
} |
} |
} |
$r->print('</ul>'); |
$r->print('</ul>'); |
Line 712 sub print_paste_buffer {
|
Line 712 sub print_paste_buffer {
|
$canpaste = &supp_pasteable($env{'docs.markedcopy_url'}); |
$canpaste = &supp_pasteable($env{'docs.markedcopy_url'}); |
unless ($canpaste) { |
unless ($canpaste) { |
$nopaste = &mt('Paste into Supplemental Content unavailable for this type of content.'); |
$nopaste = &mt('Paste into Supplemental Content unavailable for this type of content.'); |
} |
} |
} else { |
} else { |
$canpaste = 1; |
$canpaste = 1; |
} |
} |
Line 726 sub print_paste_buffer {
|
Line 726 sub print_paste_buffer {
|
$othercourse = 1; |
$othercourse = 1; |
if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
if ($canpaste) { |
if ($canpaste) { |
$othercrs = '<br />'.&mt('(from another course).'); |
$othercrs = '<br />'.&mt('(from another course).'); |
} |
} |
} else { |
} else { |
$canpaste = 0; |
$canpaste = 0; |
$nopaste = &mt('Paste from another course unavailable.') |
$nopaste = &mt('Paste from another course unavailable.') |
} |
} |
} |
} |
if ($rem =~ m{^(default|supplemental)_?(\d*)\.(?:page|sequence)$}) { |
if ($rem =~ m{^(default|supplemental)_?(\d*)\.(?:page|sequence)$}) { |
Line 748 sub print_paste_buffer {
|
Line 748 sub print_paste_buffer {
|
.'<legend>'.&mt('Clipboard').'</legend>'); |
.'<legend>'.&mt('Clipboard').'</legend>'); |
my ($type,$buffer); |
my ($type,$buffer); |
if ($is_external) { |
if ($is_external) { |
$type = &mt('External Resource'); |
$type = &mt('External Resource'); |
$buffer = $type.': '. |
$buffer = $type.': '. |
&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('. |
&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('. |
&LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')'; |
&LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')'; |
} else { |
} else { |
my $icon = &Apache::loncommon::icon($extension); |
my $icon = &Apache::loncommon::icon($extension); |
if ($extension eq 'sequence' && |
if ($extension eq 'sequence' && |
$env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) { |
$env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) { |
$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'; |
} |
} |
$icon = '<img src="'.$icon.'" alt="" class="LC_icon" />'; |
$icon = '<img src="'.$icon.'" alt="" class="LC_icon" />'; |
$buffer = $icon.$type.': '. &Apache::loncommon::parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})); |
$buffer = $icon.$type.': '. &Apache::loncommon::parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})); |
} |
} |
if ($canpaste) { |
if ($canpaste) { |
Line 773 sub print_paste_buffer {
|
Line 773 sub print_paste_buffer {
|
'<label>'. |
'<label>'. |
'<input type="radio" name="docs.markedcopy_options" value="new" checked="checked" />'. |
'<input type="radio" name="docs.markedcopy_options" value="new" checked="checked" />'. |
&mt('Copy to new folder').'</label>'.(' ' x2). |
&mt('Copy to new folder').'</label>'.(' ' x2). |
'<label>'. |
'<label>'. |
'<input type="radio" name="docs.markedcopy_options" value="move" />'. |
'<input type="radio" name="docs.markedcopy_options" value="move" />'. |
&mt('Move old folder').'</label><br />'); |
&mt('Move old folder').'</label><br />'); |
if ($env{'docs.markedcopy_nested'}) { |
if ($env{'docs.markedcopy_nested'}) { |
Line 785 sub print_paste_buffer {
|
Line 785 sub print_paste_buffer {
|
my %depths = ( |
my %depths = ( |
$lastdir => 0, |
$lastdir => 0, |
); |
); |
my (%display,%deps); |
my (%display,%deps); |
for (my $i=0; $i<@pastemaps; $i++) { |
for (my $i=0; $i<@pastemaps; $i++) { |
($lastdir,my $subfolderstr) = split(/\:/,$pastemaps[$i]); |
($lastdir,my $subfolderstr) = split(/\:/,$pastemaps[$i]); |
my ($namedir,$esctitlestr) = split(/\:/,$titles[$i]); |
my ($namedir,$esctitlestr) = split(/\:/,$titles[$i]); |
Line 797 sub print_paste_buffer {
|
Line 797 sub print_paste_buffer {
|
my $indent = (' ' x $offset); |
my $indent = (' ' x $offset); |
for (my $j=0; $j<@subfolders; $j++) { |
for (my $j=0; $j<@subfolders; $j++) { |
$depths{$subfolders[$j]} = $depth; |
$depths{$subfolders[$j]} = $depth; |
$display{$subfolders[$j]} = |
$display{$subfolders[$j]} = |
'<tr><td>'.$indent.$subfoldertitles[$j].' </td>'. |
'<tr><td>'.$indent.$subfoldertitles[$j].' </td>'. |
'<td><label>'. |
'<td><label>'. |
'<input type="radio" name="docs.markedcopy_'.$subfolders[$j].'" value="new" checked="checked" />'.&mt('Copy to new').'</label>'.(' ' x2). |
'<input type="radio" name="docs.markedcopy_'.$subfolders[$j].'" value="new" checked="checked" />'.&mt('Copy to new').'</label>'.(' ' x2). |
Line 815 sub print_paste_buffer {
|
Line 815 sub print_paste_buffer {
|
} |
} |
$r->print('<br /><input type="submit" name="pastemarked" value="'.&mt('Paste').'" />'.$othercrs); |
$r->print('<br /><input type="submit" name="pastemarked" value="'.&mt('Paste').'" />'.$othercrs); |
if ($container eq 'page') { |
if ($container eq 'page') { |
$r->print(' |
$r->print(' |
<input type="hidden" name="pagepath" value="'.&HTML::Entities::encode($env{'form.pagepath'},'<>&"').'" /> |
<input type="hidden" name="pagepath" value="'.&HTML::Entities::encode($env{'form.pagepath'},'<>&"').'" /> |
<input type="hidden" name="pagesymb" value="'.&HTML::Entities::encode($env{'form.pagesymb'},'<>&"').'" /> |
<input type="hidden" name="pagesymb" value="'.&HTML::Entities::encode($env{'form.pagesymb'},'<>&"').'" /> |
'); |
'); |
} else { |
} else { |
$r->print(' |
$r->print(' |
<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" /> |
<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" /> |
'); |
'); |
} |
} |
Line 902 sub do_paste_from_buffer {
|
Line 902 sub do_paste_from_buffer {
|
|
|
my ($is_map,$srcdom,$srcnum,$prefixchg,%before,%after,%mapchanges,%tomove); |
my ($is_map,$srcdom,$srcnum,$prefixchg,%before,%after,%mapchanges,%tomove); |
if ($url=~/\.(page|sequence)$/) { |
if ($url=~/\.(page|sequence)$/) { |
$is_map = 1; |
$is_map = 1; |
} |
} |
if ($url =~ m{^/uploaded/($match_domain)/($match_courseid)/([^/]+)}) { |
if ($url =~ m{^/uploaded/($match_domain)/($match_courseid)/([^/]+)}) { |
$srcdom = $1; |
$srcdom = $1; |
$srcnum = $2; |
$srcnum = $2; |
my $oldprefix = $3; |
my $oldprefix = $3; |
# When paste buffer was populated using an active role in a different course |
# When paste buffer was populated using an active role in a different course |
# check for mdc privilege in the course from which the resource was pasted |
# check for mdc privilege in the course from which the resource was pasted |
if (($srcdom ne $coursedom) || ($srcnum ne $coursenum)) { |
if (($srcdom ne $coursedom) || ($srcnum ne $coursenum)) { |
unless ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
unless ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
return (&mt('Paste failed: Item is from a different course which you do not have rights to edit.')); |
return (&mt('Paste failed: Item is from a different course which you do not have rights to edit.')); |
} |
} |
} |
} |
# When pasting content from Main Content to Supplemental Content and vice versa |
# When pasting content from Main Content to Supplemental Content and vice versa |
# URLs will contain different paths (which depend on whether pasted item is |
# URLs will contain different paths (which depend on whether pasted item is |
# a folder/page or a document. |
# a folder/page or a document. |
if (($folder =~ /^supplemental/) && (($oldprefix =~ /^default/) || ($oldprefix eq 'docs'))) { |
if (($folder =~ /^supplemental/) && (($oldprefix =~ /^default/) || ($oldprefix eq 'docs'))) { |
$prefixchg = 1; |
$prefixchg = 1; |
%before = ( map => 'default', |
%before = ( map => 'default', |
Line 961 sub do_paste_from_buffer {
|
Line 961 sub do_paste_from_buffer {
|
if ($folder =~ /^default/) { |
if ($folder =~ /^default/) { |
my $lastchange = &Apache::lonnet::get_coursechange($coursedom,$coursenum); |
my $lastchange = &Apache::lonnet::get_coursechange($coursedom,$coursenum); |
if ($lastchange > $env{'request.course.tied'}) { |
if ($lastchange > $env{'request.course.tied'}) { |
&reinit_role($coursedom,$coursenum,$env{"course.$env{'request.course.id'}.home"}); |
&reinit_role($coursedom,$coursenum,$env{"course.$env{'request.course.id'}.home"}); |
} |
} |
} |
} |
# If pasting a map, check if map contains other maps |
# If pasting a map, check if map contains other maps |
Line 979 sub do_paste_from_buffer {
|
Line 979 sub do_paste_from_buffer {
|
if ($url=~ m{^/uploaded/}) { |
if ($url=~ m{^/uploaded/}) { |
my $newurl; |
my $newurl; |
unless ($env{'form.docs.markedcopy_options'} eq 'move') { |
unless ($env{'form.docs.markedcopy_options'} eq 'move') { |
($newurl,my $error) = |
($newurl,my $error) = |
&get_newmap_url($url,$folder,$prefixchg,$coursedom,$coursenum, |
&get_newmap_url($url,$folder,$prefixchg,$coursedom,$coursenum, |
$srcdom,$srcnum,\$title,\%allmaps,\%newurls); |
$srcdom,$srcnum,\$title,\%allmaps,\%newurls); |
if ($error) { |
if ($error) { |
Line 1006 sub do_paste_from_buffer {
|
Line 1006 sub do_paste_from_buffer {
|
} elsif ($env{'docs.markedcopy_nested'}) { |
} elsif ($env{'docs.markedcopy_nested'}) { |
&url_paste_fixups($url,$folder,$prefixchg,$coursedom,$coursenum,\%allmaps,\%rewrites, |
&url_paste_fixups($url,$folder,$prefixchg,$coursedom,$coursenum,\%allmaps,\%rewrites, |
\%retitles,\%copies,\%dbcopies,\%zombies,\%params,\%mapmoves, |
\%retitles,\%copies,\%dbcopies,\%zombies,\%params,\%mapmoves, |
\%mapchanges,\%tomove,\%newsubdir,\%newurls); |
\%mapchanges,\%tomove,\%newsubdir,\%newurls); |
} |
} |
} elsif ($url=~m {^/res/}) { |
} elsif ($url=~m {^/res/}) { |
# published maps can only exists once, so remove it from paste buffer when done |
# published maps can only exists once, so remove it from paste buffer when done |
Line 1020 sub do_paste_from_buffer {
|
Line 1020 sub do_paste_from_buffer {
|
} |
} |
} |
} |
if ($url=~ m{/smppg$}) { |
if ($url=~ m{/smppg$}) { |
my $db_name = &Apache::lonsimplepage::get_db_name($url); |
my $db_name = &Apache::lonsimplepage::get_db_name($url); |
if ($db_name =~ /^smppage_/) { |
if ($db_name =~ /^smppage_/) { |
#simple pages, need to copy the db contents to a new one. |
#simple pages, need to copy the db contents to a new one. |
my %contents=&Apache::lonnet::dump($db_name,$coursedom,$coursenum); |
my %contents=&Apache::lonnet::dump($db_name,$coursedom,$coursenum); |
my $now = time(); |
my $now = time(); |
$db_name =~ s{_\d*$ }{_$now}x; |
$db_name =~ s{_\d*$ }{_$now}x; |
my $dbresult=&Apache::lonnet::put($db_name,\%contents, |
my $dbresult=&Apache::lonnet::put($db_name,\%contents, |
$coursedom,$coursenum); |
$coursedom,$coursenum); |
if ($dbresult eq 'ok') { |
if ($dbresult eq 'ok') { |
$url =~ s{/(\d*)/smppg$ }{/$now/smppg}x; |
$url =~ s{/(\d*)/smppg$ }{/$now/smppg}x; |
$title=&mt('Copy of').' '.$title; |
$title=&mt('Copy of').' '.$title; |
} else { |
} else { |
return (&mt('Paste failed: An error occurred when copying the simple page.')); |
return (&mt('Paste failed: An error occurred when copying the simple page.')); |
} |
} |
} |
} |
} |
} |
$title = &LONCAPA::map::qtunescape($title); |
$title = &LONCAPA::map::qtunescape($title); |
my $ext='false'; |
my $ext='false'; |
Line 1077 sub do_paste_from_buffer {
|
Line 1077 sub do_paste_from_buffer {
|
} |
} |
} |
} |
} |
} |
# Apply any changes to maps, or copy dependencies for uploaded HTML pages |
# Apply any changes to maps, or copy dependencies for uploaded HTML pages |
my ($result,$save_err); |
my ($result,$save_err); |
$result = |
$result = |
&apply_fixups($folder,$is_map,$prefixchg,$coursedom,$coursenum,$oldurl, |
&apply_fixups($folder,$is_map,$prefixchg,$coursedom,$coursenum,$oldurl, |
Line 1085 sub do_paste_from_buffer {
|
Line 1085 sub do_paste_from_buffer {
|
\%copies,\%dbcopies,\%zombies,\%params,\%docmoves, |
\%copies,\%dbcopies,\%zombies,\%params,\%docmoves, |
\%mapmoves,\%newsubdir,$errors,\%before,\%after); |
\%mapmoves,\%newsubdir,$errors,\%before,\%after); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
if ($is_map) { |
if ($is_map) { |
my ($errtext,$fatal) = &mapread($coursenum,$coursedom, |
my ($errtext,$fatal) = &mapread($coursenum,$coursedom, |
$folder.'.'.$container); |
$folder.'.'.$container); |
return $errtext if ($fatal); |
return $errtext if ($fatal); |
Line 1109 sub do_paste_from_buffer {
|
Line 1109 sub do_paste_from_buffer {
|
$env{'user.domain'}.'___&&&___'.$title; |
$env{'user.domain'}.'___&&&___'.$title; |
} |
} |
} |
} |
$LONCAPA::map::resources[$newidx]= $title.':'.$url.':'.$ext.':normal:res'; |
$LONCAPA::map::resources[$newidx]= $title.':'.$url.':'.$ext.':normal:res'; |
push(@LONCAPA::map::order, $newidx); |
push(@LONCAPA::map::order, $newidx); |
|
|
# Store the result |
# Store the result |
my ($errtext,$fatal) = |
my ($errtext,$fatal) = |
&storemap($coursenum,$coursedom,$folder.'.'.$container,1); |
&storemap($coursenum,$coursedom,$folder.'.'.$container,1); |
if ($fatal) { |
if ($fatal) { |
$save_err = $errtext; |
$save_err = $errtext; |
} |
} |
} |
} |
|
|
if ($env{'form.docs.markedcopy_options'} eq 'move') { |
if ($env{'form.docs.markedcopy_options'} eq 'move') { |
&Apache::lonnet::delenv('docs.markedcopy'); |
&Apache::lonnet::delenv('docs.markedcopy'); |
&Apache::lonnet::delenv('docs.markedcopy_nested'); |
&Apache::lonnet::delenv('docs.markedcopy_nested'); |
Line 1243 sub contained_map_check {
|
Line 1243 sub contained_map_check {
|
$titles->{$url}{$token->[2]->{'id'}} = $token->[2]->{'title'}; |
$titles->{$url}{$token->[2]->{'id'}} = $token->[2]->{'title'}; |
} else { |
} else { |
if ($allmaps->{$ressrc}) { |
if ($allmaps->{$ressrc}) { |
$removefrommap->{$url}{$token->[2]->{'id'}} = $ressrc; |
$removefrommap->{$url}{$token->[2]->{'id'}} = $ressrc; |
} elsif (ref($addedmaps->{$ressrc}) eq 'ARRAY') { |
} elsif (ref($addedmaps->{$ressrc}) eq 'ARRAY') { |
$removefrommap->{$url}{$token->[2]->{'id'}} = $ressrc; |
$removefrommap->{$url}{$token->[2]->{'id'}} = $ressrc; |
} else { |
} else { |
Line 1258 sub contained_map_check {
|
Line 1258 sub contained_map_check {
|
if (ref($removeparam->{$url}{$token->[2]->{'to'}}) eq 'ARRAY') { |
if (ref($removeparam->{$url}{$token->[2]->{'to'}}) eq 'ARRAY') { |
push(@{$removeparam->{$url}{$token->[2]->{'to'}}},$token->[2]->{'name'}); |
push(@{$removeparam->{$url}{$token->[2]->{'to'}}},$token->[2]->{'name'}); |
} else { |
} else { |
$removeparam->{$url}{$token->[2]->{'to'}} = [$token->[2]->{'name'}]; |
$removeparam->{$url}{$token->[2]->{'to'}} = [$token->[2]->{'name'}]; |
} |
} |
} |
} |
} |
} |
Line 1310 sub url_paste_fixups {
|
Line 1310 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}{$ressrc} = $id; |
$zombies->{$oldurl}{$ressrc} = $id; |
$changed = 1; |
$changed = 1; |
} elsif ($ressrc =~ m{^/uploaded/($match_domain)/($match_courseid)/(.+)$}) { |
} elsif ($ressrc =~ m{^/uploaded/($match_domain)/($match_courseid)/(.+)$}) { |
Line 1342 sub url_paste_fixups {
|
Line 1342 sub url_paste_fixups {
|
} |
} |
if (($srcdom ne $cdom) || ($srcnum ne $cnum) || ($prefixchg) || |
if (($srcdom ne $cdom) || ($srcnum ne $cnum) || ($prefixchg) || |
($mapchanges->{$oldurl}) || (($newurl ne '') && ($newurl ne $oldurl))) { |
($mapchanges->{$oldurl}) || (($newurl ne '') && ($newurl ne $oldurl))) { |
|
|
if ($rem =~ /^(default|supplemental)(_?\d*).(sequence|page)$/) { |
if ($rem =~ /^(default|supplemental)(_?\d*).(sequence|page)$/) { |
$rewrites->{$oldurl}{$ressrc} = $id; |
$rewrites->{$oldurl}{$ressrc} = $id; |
$mapchanges->{$ressrc} = 1; |
$mapchanges->{$ressrc} = 1; |
Line 1360 sub url_paste_fixups {
|
Line 1360 sub url_paste_fixups {
|
} |
} |
} |
} |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/(.+)$}) { |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/(.+)$}) { |
next if ($skip); |
next if ($skip); |
my $srcdom = $1; |
my $srcdom = $1; |
my $srcnum = $2; |
my $srcnum = $2; |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
Line 1380 sub url_paste_fixups {
|
Line 1380 sub url_paste_fixups {
|
} |
} |
} elsif ($token->[1] eq 'param') { |
} elsif ($token->[1] eq 'param') { |
next if ($skip); |
next if ($skip); |
my $to = $token->[2]->{'to'}; |
my $to = $token->[2]->{'to'}; |
if ($to ne '') { |
if ($to ne '') { |
if (ref($params->{$oldurl}{$to}) eq 'ARRAY') { |
if (ref($params->{$oldurl}{$to}) eq 'ARRAY') { |
push(@{$params->{$oldurl}{$to}},$token->[2]->{'name'}); |
push(@{$params->{$oldurl}{$to}},$token->[2]->{'name'}); |
Line 1418 sub apply_fixups {
|
Line 1418 sub apply_fixups {
|
} |
} |
if (@allcopies > 0) { |
if (@allcopies > 0) { |
foreach my $item (@allcopies) { |
foreach my $item (@allcopies) { |
my ($relpath,$oldsubdir,$fname) = |
my ($relpath,$oldsubdir,$fname) = |
($item =~ m{^(/uploaded/$match_domain/$match_courseid/(?:docs|supplemental)/(default|\d+)/.*/)([^/]+)$}); |
($item =~ m{^(/uploaded/$match_domain/$match_courseid/(?:docs|supplemental)/(default|\d+)/.*/)([^/]+)$}); |
if ($fname ne '') { |
if ($fname ne '') { |
my $content = &Apache::lonnet::getfile($item); |
my $content = &Apache::lonnet::getfile($item); |
Line 1437 sub apply_fixups {
|
Line 1437 sub apply_fixups {
|
} |
} |
} |
} |
©_dependencies($item,$storefn,$relpath,$errors,\$content); |
©_dependencies($item,$storefn,$relpath,$errors,\$content); |
my $copyurl = |
my $copyurl = |
&Apache::lonclonecourse::writefile($env{'request.course.id'}, |
&Apache::lonclonecourse::writefile($env{'request.course.id'}, |
$storefn.$fname,$content); |
$storefn.$fname,$content); |
if ($copyurl eq '/adm/notfound.html') { |
if ($copyurl eq '/adm/notfound.html') { |
Line 1583 sub apply_fixups {
|
Line 1583 sub apply_fixups {
|
} |
} |
foreach my $idx (keys(%remparam)) { |
foreach my $idx (keys(%remparam)) { |
if (ref($remparam{$idx}) eq 'ARRAY') { |
if (ref($remparam{$idx}) eq 'ARRAY') { |
foreach my $name (@{$remparam{$idx}}) { |
foreach my $name (@{$remparam{$idx}}) { |
&LONCAPA::map::delparameter($idx,'parameter_'.$name); |
&LONCAPA::map::delparameter($idx,'parameter_'.$name); |
} |
} |
} |
} |
Line 1796 sub editor {
|
Line 1796 sub editor {
|
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
\%paste_errors); |
\%paste_errors); |
if ($save_error ne '') { |
if ($save_error ne '') { |
return $save_error; |
return $save_error; |
} |
} |
if ($paste_res ne 'ok') { |
if ($paste_res ne 'ok') { |
$r->print('<p><span class="LC_error">'.$paste_res.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$paste_res.'</span></p>'); |
Line 2185 sub entryline {
|
Line 2185 sub entryline {
|
my $nocopy=0; |
my $nocopy=0; |
my $nocut=0; |
my $nocut=0; |
if ($url=~ m{^/res/.+\.(page|sequence)$}) { |
if ($url=~ m{^/res/.+\.(page|sequence)$}) { |
# no copy for published maps |
# no copy for published maps |
$nocopy=1; |
$nocopy=1; |
} |
} |
if ($url=~/^\/res\/lib\/templates\//) { |
if ($url=~/^\/res\/lib\/templates\//) { |
$nocopy=1; |
$nocopy=1; |
$nocut=1; |
$nocut=1; |
Line 2999 sub startContentScreen {
|
Line 2999 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('Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Content Editor').' </b></a></li>'."\n"; |
Line 3337 sub handler {
|
Line 3338 sub handler {
|
}; |
}; |
} |
} |
if ($env{'docs.markedcopy_url'}) { |
if ($env{'docs.markedcopy_url'}) { |
$script .= &paste_popup_js(); |
$script .= &paste_popup_js(); |
} |
} |
} |
} |
# -------------------------------------------------------------------- Body tag |
# -------------------------------------------------------------------- Body tag |
Line 3434 sub handler {
|
Line 3435 sub handler {
|
'upld' => 'Import Document', |
'upld' => 'Import Document', |
'srch' => 'Search', |
'srch' => 'Search', |
'impo' => 'Import', |
'impo' => 'Import', |
'lnks' => 'Import from Stored Links', |
'lnks' => 'Import from Stored Links', |
'selm' => 'Select Map', |
'selm' => 'Select Map', |
'load' => 'Load Map', |
'load' => 'Load Map', |
'reco' => 'Recover Deleted Documents', |
'reco' => 'Recover Deleted Documents', |
Line 3502 SEDFFORM
|
Line 3503 SEDFFORM
|
my @simpleeditdefaultforma = ( |
my @simpleeditdefaultforma = ( |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'" onclick="javascript:groupsearch()" />' => "$uploadtag<a class='LC_menubuttons_link' href='javascript:groupsearch()'>$lt{'srch'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'" onclick="javascript:groupsearch()" />' => "$uploadtag<a class='LC_menubuttons_link' href='javascript:groupsearch()'>$lt{'srch'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:open_StoredLinks_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_StoredLinks_Import();'>$lt{'lnks'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:open_StoredLinks_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_StoredLinks_Import();'>$lt{'lnks'}</a>" }, |
); |
); |
$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma)); |
$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma)); |
$simpleeditdefaultform .=(<<SEDFFORM); |
$simpleeditdefaultform .=(<<SEDFFORM); |
Line 4178 sub generate_edit_table {
|
Line 4179 sub generate_edit_table {
|
my $backicon = $iconpath.'clickhere.gif'; |
my $backicon = $iconpath.'clickhere.gif'; |
my $backtext = &mt('To Overview'); |
my $backtext = &mt('To Overview'); |
$form = '<div class="LC_Box" style="margin:0;">'. |
$form = '<div class="LC_Box" style="margin:0;">'. |
'<ul id="navigation'.$tid.'" class="LC_TabContent">'."\n". |
'<ul id="navigation'.$tid.'" class="LC_TabContent">'."\n". |
'<li class="goback">'. |
'<li class="goback">'. |
'<a href="javascript:toContents('."'$jumpto'".');">'. |
'<a href="javascript:toContents('."'$jumpto'".');">'. |
'<img src="'.$backicon.'" class="LC_icon" style="border: none; vertical-align: top;"'. |
'<img src="'.$backicon.'" class="LC_icon" style="border: none; vertical-align: top;"'. |
' alt="'.$backtext.'" />'.$backtext.'</a></li>'."\n". |
' alt="'.$backtext.'" />'.$backtext.'</a></li>'."\n". |
'<li>'. |
'<li>'. |
'<a href="javascript:groupopen('."'$readfile'".',1);">'. |
'<a href="javascript:groupopen('."'$readfile'".',1);">'. |
&mt('Undo Delete').'</a></li>'."\n"; |
&mt('Undo Delete').'</a></li>'."\n"; |
if ($env{'form.docslog'}) { |
if ($env{'form.docslog'}) { |
$form .= '<li class="active">'; |
$form .= '<li class="active">'; |
} else { |
} else { |