version 1.484.2.15, 2012/12/13 02:45:27
|
version 1.498, 2012/10/02 18:08:12
|
Line 322 sub breadcrumbs {
|
Line 322 sub breadcrumbs {
|
@folders=split('&',$env{'form.folderpath'}); |
@folders=split('&',$env{'form.folderpath'}); |
} |
} |
my $folderpath; |
my $folderpath; |
|
my $cpinfo=''; |
my $plain=''; |
my $plain=''; |
my $randompick=-1; |
my $randompick=-1; |
my $isencrypted=0; |
my $isencrypted=0; |
Line 354 sub breadcrumbs {
|
Line 355 sub breadcrumbs {
|
$name = &mt('Supplemental '.$crstype.' Content'); |
$name = &mt('Supplemental '.$crstype.' Content'); |
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{'href'=>$url, |
{'href'=>$url.$cpinfo, |
'title'=>$name, |
'title'=>$name, |
'text'=>$name, |
'text'=>$name, |
'no_mt'=>1, |
'no_mt'=>1, |
Line 537 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 560 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 711 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 725 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 747 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 772 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 784 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 796 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 814 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 901 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 960 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 978 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 1005 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 1019 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 1076 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 1084 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 1108 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 1242 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 1257 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 1309 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 1341 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 1359 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 1379 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 1417 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 1436 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 1582 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 1743 sub handle_edit_cmd {
|
Line 1744 sub handle_edit_cmd {
|
|
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
$supplementalflag,$orderhash,$iconpath,$uploadtag)=@_; |
$supplementalflag,$orderhash,$iconpath)=@_; |
my $container= ($env{'form.pagepath'}) ? 'page' |
my $container= ($env{'form.pagepath'}) ? 'page' |
: 'sequence'; |
: 'sequence'; |
|
|
Line 1795 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 1828 sub editor {
|
Line 1829 sub editor {
|
if (defined($item)) { |
if (defined($item)) { |
my ($name,$url,$residx)= |
my ($name,$url,$residx)= |
map {&unescape($_)} split(/\=/,$item); |
map {&unescape($_)} split(/\=/,$item); |
if ($url=~ m{^\Q/uploaded/$coursedom/$coursenum/\E(default|supplemental)_new\.(sequence|page)$}) { |
|
my ($suffix,$errortxt,$locknotfreed) = |
|
&newmap_suffix($1,$2,$coursedom,$coursenum); |
|
if ($locknotfreed) { |
|
$r->print($locknotfreed); |
|
} |
|
if ($suffix) { |
|
$url =~ s/_new\./_$suffix./; |
|
} else { |
|
return $errortxt; |
|
} |
|
} |
|
push(@imports, [$name, $url, $residx]); |
push(@imports, [$name, $url, $residx]); |
} |
} |
} |
} |
Line 1911 sub editor {
|
Line 1900 sub editor {
|
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $idx++; next; } |
unless ($name) { $idx++; next; } |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$coursenum,$coursedom,$crstype, |
$coursenum,$crstype); |
$uploadtag,$supplementalflag); |
|
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
Line 2129 sub is_supplemental_title {
|
Line 2117 sub is_supplemental_title {
|
# --------------------------------------------------------------- An entry line |
# --------------------------------------------------------------- An entry line |
|
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$crstype)=@_; |
$crstype,$uploadtag,$supplementalflag)=@_; |
|
my ($foldertitle,$pagetitle,$renametitle); |
my ($foldertitle,$pagetitle,$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); |
Line 2144 sub entryline {
|
Line 2131 sub entryline {
|
|
|
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
|
|
|
|
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/ /%20/g; |
$renametitle=~s/ /%20/g; |
Line 2162 sub entryline {
|
Line 2150 sub entryline {
|
$type = $container = 'page'; |
$type = $container = 'page'; |
$esc_path=&escape($env{'form.pagepath'}); |
$esc_path=&escape($env{'form.pagepath'}); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
|
$symb=&escape($env{'form.pagesymb'}); |
} |
} |
if (!$supplementalflag && $residx) { |
my $cpinfo=''; |
my $currurl = $url; |
|
$currurl =~ s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
|
my $path = 'uploaded/'. |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
|
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
|
$symb = &Apache::lonnet::encode_symb($path.$folder.".$container", |
|
$residx, |
|
&Apache::lonnet::declutter($currurl)); |
|
} |
|
my %lt; |
|
if ($allowed) { |
if ($allowed) { |
my $incindex=$index+1; |
my $incindex=$index+1; |
my $selectbox=''; |
my $selectbox=''; |
Line 2196 sub entryline {
|
Line 2175 sub entryline {
|
} |
} |
$selectbox.='</select>'; |
$selectbox.='</select>'; |
} |
} |
%lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'up' => 'Move Up', |
'up' => 'Move Up', |
'dw' => 'Move Down', |
'dw' => 'Move Down', |
'rm' => 'Remove', |
'rm' => 'Remove', |
'ct' => 'Cut', |
'ct' => 'Cut', |
'rn' => 'Rename', |
'rn' => 'Rename', |
'cp' => 'Copy', |
'cp' => 'Copy'); |
'ex' => 'External Resource', |
|
'ed' => 'Edit', |
|
'pr' => 'Preview', |
|
'sv' => 'Save', |
|
'ul' => 'URL', |
|
'ti' => 'Title', |
|
); |
|
my $nocopy=0; |
my $nocopy=0; |
my $nocut=0; |
my $nocut=0; |
my $noremove=0; |
my $noremove=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 2314 END
|
Line 2286 END
|
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb'> |
<a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
<img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb'> |
<a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb$cpinfo'> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
</td> |
</td> |
Line 2371 END
|
Line 2343 END
|
} |
} |
} |
} |
|
|
my $editlink; |
|
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
if (!$supplementalflag && $residx && $symb) { |
if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) { |
if ($container eq 'page') { |
my $symb=&Apache::lonnet::symbclean( |
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
&Apache::lonnet::declutter('uploaded/'. |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
} |
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'.$folder. |
if ((!$isfolder) && (!$ispage)) { |
'.sequence'). |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
'___'.$residx.'___'. |
$url=&Apache::lonnet::clutter($url); |
&Apache::lonnet::declutter($url)); |
if ($url=~/^\/*uploaded\//) { |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
$url=~/\.(\w+)$/; |
$url=&Apache::lonnet::clutter($url); |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
if ($url=~/^\/*uploaded\//) { |
if (($embstyle eq 'img') || ($embstyle eq 'emb')) { |
$url=~/\.(\w+)$/; |
$url='/adm/wrapper'.$url; |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
} elsif ($embstyle eq 'ssi') { |
if (($embstyle eq 'img') || ($embstyle eq 'emb')) { |
#do nothing with these |
$url='/adm/wrapper'.$url; |
} elsif ($url!~/\.(sequence|page)$/) { |
} elsif ($embstyle eq 'ssi') { |
$url='/adm/coursedocs/showdoc'.$url; |
#do nothing with these |
} |
} elsif ($url!~/\.(sequence|page)$/) { |
} elsif ($url=~m|^/ext/|) { |
$url='/adm/coursedocs/showdoc'.$url; |
$url='/adm/wrapper'.$url; |
} |
$external = 1; |
} elsif ($url=~m|^/ext/|) { |
} |
$url='/adm/wrapper'.$url; |
if (&Apache::lonnet::symbverify($symb,$url)) { |
$external = 1; |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
} |
} else { |
if (&Apache::lonnet::symbverify($symb,$url)) { |
$url=''; |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
} |
} else { |
|
$url=''; |
} |
} |
|
if ($container eq 'page') { |
|
my $symb=$env{'form.pagesymb'}; |
|
|
|
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
|
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
|
} |
} |
} |
my ($rand_pick_text,$rand_order_text); |
my ($rand_pick_text,$rand_order_text); |
if ($isfolder || $extension eq 'sequence') { |
if ($isfolder || $extension eq 'sequence') { |
Line 2419 END
|
Line 2397 END
|
'parameter_encrypturl'))[0]=~/^yes$/i) |
'parameter_encrypturl'))[0]=~/^yes$/i) |
.':'.((&LONCAPA::map::getparameter($orderidx, |
.':'.((&LONCAPA::map::getparameter($orderidx, |
'parameter_randomorder'))[0]=~/^yes$/i); |
'parameter_randomorder'))[0]=~/^yes$/i); |
$url.='folderpath='.&escape($folderpath); |
$url.='folderpath='.&escape($folderpath).$cpinfo; |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
'parameter_randompick'))[0]; |
'parameter_randompick'))[0]; |
my $rpckchk; |
my $rpckchk; |
Line 2448 $form_common.'
|
Line 2426 $form_common.'
|
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath) { $pagepath = $folderpath.'&' }; |
if ($folderpath) { $pagepath = $folderpath.'&' }; |
$pagepath.=$pagearg.'&'.$pagename; |
$pagepath.=$pagearg.'&'.$pagename; |
|
my $symb=$env{'form.pagesymb'}; |
|
if (!$symb) { |
|
my $path='uploaded/'. |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}.'/'. |
|
$env{'course.'.$env{'request.course.id'}.'.num'}.'/'; |
|
$symb=&Apache::lonnet::encode_symb($path.$folder.'.sequence', |
|
$residx, |
|
$path.$pagearg.'.page'); |
|
} |
$url.='pagepath='.&escape($pagepath). |
$url.='pagepath='.&escape($pagepath). |
'&pagesymb='.&escape($symb); |
'&pagesymb='.&escape($symb).$cpinfo; |
} |
} |
if ($allowed) { |
if (($external) && ($allowed)) { |
my $fileloc = |
my $form = ($folder =~ /^default/)? 'newext' : 'supnewext'; |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
$external = ' <a class="LC_docs_ext_edit" href="javascript:edittext(\''.$form.'\',\''.$residx.'\',\''.&escape($title).'\',\''.&escape($orig_url).'\');" >'.&mt('Edit').'</a>'; |
|
} else { |
if ($external) { |
undef($external); |
$editlink = <<"EXTLNK"; |
|
|
|
<a class="LC_docs_ext_edit" href="javascript:editext('$residx');"> |
|
$lt{'ed'}</a> |
|
<form action="/adm/coursedocs" method="post" name="editext_$residx"> |
|
<fieldset id="uploadext$residx" style="display: none;" /> |
|
<input type="hidden" name="active" value="aa" /> |
|
<span class="LC_nobreak"> |
|
<span class="LC_docs_ext_edit">$lt{'ul'} </span> |
|
<input type="text" size="40" name="exturl" id="exturl_$residx" value="$orig_url" /> |
|
<a class="LC_docs_ext_edit" href="javascript:extUrlPreview('exturl_$residx');">$lt{'pr'}</a></span> |
|
</span><br /> |
|
<span class="LC_nobreak"> |
|
<span class="LC_docs_ext_edit">$lt{'ti'} </span> |
|
<input type="text" size="40" name="exttitle" value="$title" /> |
|
$uploadtag |
|
<input type="hidden" name="importdetail" value="" /> |
|
<input type="button" value="$lt{'sv'}" onclick="javascript:setExternal(this.form,'$residx')" /> |
|
</span> |
|
</fieldset> |
|
</form> |
|
EXTLNK |
|
} else { |
|
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
|
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); |
|
if (($cfile ne '') && ($symb ne '')) { |
|
my $jscall = |
|
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
|
$switchserver, |
|
$forceedit, |
|
undef,$symb); |
|
if ($jscall) { |
|
$editlink = ' <a class="LC_docs_ext_edit" href="javascript:'. |
|
$jscall.'" >'.&mt('Edit').'</a>'; |
|
} |
|
} |
|
} |
|
} |
} |
my $reinit; |
my $reinit; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
Line 2518 EXTLNK
|
Line 2468 EXTLNK
|
} else { |
} else { |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
} |
} |
$line.=$editlink."</td>"; |
$line.=$external."</td>"; |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
if (($allowed) && ($folder!~/^supplemental/)) { |
if (($allowed) && ($folder!~/^supplemental/)) { |
Line 2549 ENDPARMS
|
Line 2499 ENDPARMS
|
return $line; |
return $line; |
} |
} |
|
|
sub newmap_suffix { |
|
my ($area,$container,$coursedom,$coursenum) = @_; |
|
my ($prefix,$idtype,$errtext,$locknotfreed); |
|
$prefix = 'docs'; |
|
if ($area eq 'supplemental') { |
|
$prefix = 'supp'; |
|
} |
|
$prefix .= $container; |
|
$idtype = 'concat'; |
|
my ($suffix,$freedlock,$error) = |
|
&Apache::lonnet::get_timebased_id($prefix,'num','uploadedmaps', |
|
$coursedom,$coursenum); |
|
if (!$suffix) { |
|
$errtext = &mt('Failed to acquire a unique timestamp-based suffix for the new folder/page.'); |
|
if ($error) { |
|
$errtext .= '<br />'.$error; |
|
} |
|
} |
|
if ($freedlock ne 'ok') { |
|
$locknotfreed = '<div class="LC_error">'.&mt('There was a problem removing a lockfile. This will prevent creation of additional folders or composite pages in this course. Please contact the domain coordinator for your LON-CAPA domain.').'</div>'; |
|
} |
|
return ($suffix,$errtext,$locknotfreed); |
|
} |
|
|
|
=pod |
=pod |
|
|
=item tiehash() |
=item tiehash() |
Line 2939 ENDHEADERS
|
Line 2865 ENDHEADERS
|
'</b>'); |
'</b>'); |
foreach my $key (sort(keys(%changes))) { |
foreach my $key (sort(keys(%changes))) { |
#excludes not versionable problems from resource version history: |
#excludes not versionable problems from resource version history: |
next unless ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/); |
if ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/) { |
my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); |
my ($root,$extension)=($key=~/^(.*)\.(\w+)$/); |
my $currentversion=&Apache::lonnet::getversion($key); |
my $currentversion=&Apache::lonnet::getversion($key); |
if ($currentversion<0) { |
if ($currentversion<0) { |
Line 3105 sub init_breadcrumbs {
|
Line 3031 sub init_breadcrumbs {
|
sub create_list_elements { |
sub create_list_elements { |
my @formarr = @_; |
my @formarr = @_; |
my $list = ''; |
my $list = ''; |
foreach my $button (@formarr){ |
for my $button (@formarr){ |
foreach my $picture (keys(%{$button})) { |
for my $picture(keys %$button) { |
$list .= &Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text', id => ''}); |
$list .= &Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); |
} |
} |
} |
} |
return $list; |
return $list; |
Line 3130 sub startContentScreen {
|
Line 3056 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 3176 sub handler {
|
Line 3103 sub handler {
|
'Adding_External_Resource','Navigate_Content', |
'Adding_External_Resource','Navigate_Content', |
'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','Uploading_From_Harddrive', |
'Uploading_From_Harddrive', |
|
'Check_Resource_Versions','Verify_Content') { |
'Check_Resource_Versions','Verify_Content') { |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
} |
} |
Line 3469 sub handler {
|
Line 3395 sub handler {
|
}; |
}; |
} |
} |
if ($env{'docs.markedcopy_url'}) { |
if ($env{'docs.markedcopy_url'}) { |
$script .= &paste_popup_js(); |
$script .= &paste_popup_js(); |
} |
} |
my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'. |
|
&mt('Switch server?'); |
|
} |
} |
# -------------------------------------------------------------------- Body tag |
# -------------------------------------------------------------------- Body tag |
$script = '<script type="text/javascript">'."\n" |
$script = '<script type="text/javascript">'."\n" |
Line 3565 sub handler {
|
Line 3489 sub handler {
|
'upls' => 'Upload a new supplemental '.lc($crstype).' document', |
'upls' => 'Upload a new supplemental '.lc($crstype).' document', |
'impp' => 'Import a document', |
'impp' => 'Import a document', |
'copm' => 'All documents out of a published map into this folder', |
'copm' => 'All documents out of a published map into this folder', |
'upfi' => 'Upload File', |
'upld' => 'Import Document', |
'upld' => 'Import Content', |
|
'srch' => 'Search', |
'srch' => 'Search', |
'impo' => 'Import', |
'impo' => 'Import', |
'lnks' => 'Import from Stored Links', |
'lnks' => 'Import from Stored Links', |
'impm' => 'Import from Assembled Map', |
|
'selm' => 'Select Map', |
'selm' => 'Select Map', |
'load' => 'Load Map', |
'load' => 'Load Map', |
'reco' => 'Recover Deleted Documents', |
'reco' => 'Recover Deleted Documents', |
Line 3590 sub handler {
|
Line 3512 sub handler {
|
'abou' => 'Personal Information Page for a User', |
'abou' => 'Personal Information Page for a User', |
'imsf' => 'IMS Import', |
'imsf' => 'IMS Import', |
'imsl' => 'Import IMS package', |
'imsl' => 'Import IMS package', |
'cms' => 'Origin of IMS package', |
|
'file' => 'File', |
'file' => 'File', |
'se' => 'Select', |
|
'title' => 'Title', |
'title' => 'Title', |
'comment' => 'Comment', |
'comment' => 'Comment', |
'url' => 'URL', |
|
'prev' => 'Preview', |
|
'lnk' => 'Add Link', |
|
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'nd' => 'Upload Document', |
'nd' => 'Upload Document', |
'pm' => 'Published Map', |
'pm' => 'Published Map', |
Line 3618 FIUP
|
Line 3535 FIUP
|
<input type="checkbox" name="parserflag" checked="checked" /> $lt{'parse'} |
<input type="checkbox" name="parserflag" checked="checked" /> $lt{'parse'} |
</label> |
</label> |
CHBO |
CHBO |
my $imsfolder = $env{'form.folder'}; |
|
if ($imsfolder eq '') { |
my $fileuploada = "<br clear='all' /><input type='submit' value='".$lt{'upld'}."' /> $help{'Uploading_From_Harddrive'}"; |
$imsfolder = 'default'; |
my $fileuploadform=(<<FUFORM); |
} |
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
my $imspform=(<<IMSFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ims');"> |
|
$lt{'imsf'}</a> $help{'Importing_IMS_Course'} |
|
<form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport"> |
|
<fieldset id="uploadimsform" style="display: none;" /> |
|
<legend>$lt{'imsf'}</legend> |
|
$fileupload |
|
<br /> |
|
<p> |
|
$lt{'cms'}: |
|
<select name="source"> |
|
<option value="-1" selected="selected">$lt{'se'}</option> |
|
<option value="bb5">Blackboard 5</option> |
|
<option value="bb6">Blackboard 6</option> |
|
<option value="angel5">ANGEL 5.5</option> |
|
<option value="webctce4">WebCT 4 Campus Edition</option> |
|
</select> |
|
<input type="hidden" name="folder" value="$imsfolder" /> |
|
</p> |
|
<input type="hidden" name="phase" value="one" /> |
|
<input type="button" value="$lt{'imsl'}" onclick="makeims(this.form);" /> |
|
</fieldset> |
|
</form> |
|
IMSFORM |
|
|
|
my $fileuploadform=(<<FUFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('doc');"> |
|
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
|
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
|
<fieldset id="uploaddocform" style="display: none;" /> |
|
<legend>$lt{'upfi'}</legend> |
|
<input type="hidden" name="active" value="aa" /> |
<input type="hidden" name="active" value="aa" /> |
$fileupload |
$fileupload |
<br /> |
<br /> |
Line 3664 IMSFORM
|
Line 3550 IMSFORM
|
<span class="LC_nobreak" style="float:left"> |
<span class="LC_nobreak" style="float:left"> |
$checkbox |
$checkbox |
</span> |
</span> |
<br clear="all" /> |
|
<input type="submit" value="$lt{'upld'}" /> |
|
</fieldset> |
|
</form> |
|
FUFORM |
FUFORM |
|
$fileuploadform .= $fileuploada.'</form>'; |
|
|
my $importpubform=(<<SEDFFORM); |
my $simpleeditdefaultform=(<<SEDFFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleMap();"> |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
$lt{'impm'}</a>$help{'Load_Map'} |
<input type="hidden" name="active" value="bb" /> |
<form action="/adm/coursedocs" method="post" name="mapimportform"> |
|
<fieldset id="importmapform" style="display: none;" /> |
|
<legend>$lt{'impm'}</legend> |
|
<input type="hidden" name="active" value="bb" /> |
|
$lt{'copm'}<br /> |
|
<span class="LC_nobreak"> |
|
<input type="text" name="importmap" size="40" value="" |
|
onfocus="this.blur();openbrowser('mapimportform','importmap','sequence,page','');" /> |
|
<a href="javascript:openbrowser('mapimportform','importmap','sequence,page','');">$lt{'selm'}</a><br /> |
|
<input type="submit" name="loadmap" value="$lt{'load'}" /> |
|
</fieldset> |
|
</form> |
|
|
|
SEDFFORM |
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>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/sequence.png" alt="'.$lt{impm}.'" onclick="javascript:toggleMap();" />' => $importpubform } |
); |
); |
$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma)); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
$simpleeditdefaultform .=(<<SEDFFORM); |
|
<hr id="bb_hrule" style="width:0px;text-align:left;margin-left:0" /> |
|
$lt{'copm'}<br /> |
|
<input type="text" size="40" name="importmap" /><br /> |
|
<span class="LC_nobreak" style="float:left"><input type="button" |
|
onclick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')" |
|
value="$lt{'selm'}" /> <input type="submit" name="loadmap" value="$lt{'load'}" /> |
|
$help{'Load_Map'}</span> |
|
</form> |
|
SEDFFORM |
|
|
my $extresourcesform=(<<ERFORM); |
my $extresourcesform=(<<ERFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
|
<form action="/adm/coursedocs" method="post" name="newext"> |
<form action="/adm/coursedocs" method="post" name="newext"> |
<fieldset id="uploadextform" style="display: none;" /> |
|
<legend>$lt{'extr'}</legend> |
|
<input type="hidden" name="active" value="aa" /> |
|
$lt{'url'}:<br /> |
|
<input type="text" size="60" name="exturl" id="exturl" value="http://" /> |
|
<input type="button" name="view" value="$lt{'prev'}" onclick="javascript:extUrlPreview('exturl');" /><br /> |
|
$lt{'title'}:<br /> |
|
<input type="text" size="60" name="exttitle" value="$lt{'extr'}" /> |
|
$uploadtag |
$uploadtag |
<br /> |
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="button" value="$lt{'lnk'}" onclick="javascript:setExternal(this.form,0)" /> |
<a class="LC_menubuttons_link" href="javascript:makenewext('newext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
</fieldset> |
|
</form> |
</form> |
ERFORM |
ERFORM |
|
|
Line 3770 HIDDENFORM
|
Line 3637 HIDDENFORM
|
} else { |
} else { |
#$postexec='self.close();'; |
#$postexec='self.close();'; |
} |
} |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.sequence'; |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
'.sequence'; |
'.sequence'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.page'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
'.page'; |
'.page'; |
my $container='sequence'; |
my $container='sequence'; |
if ($env{'form.pagepath'}) { |
if ($env{'form.pagepath'}) { |
Line 3780 HIDDENFORM
|
Line 3647 HIDDENFORM
|
} |
} |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
|
|
|
my $imspform=(<<IMSPFORM); |
|
<form action="/adm/imsimportdocs" method="post" name="ims"> |
|
<input type="hidden" name="folder" value="$folder" /> |
|
<a class="LC_menubuttons_link" href="javascript:makeims();">$lt{'imsf'}</a> |
|
</form> |
|
IMSPFORM |
|
|
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="cc" /> |
<input type="hidden" name="active" value="cc" /> |
Line 3934 NGFFORM
|
Line 3808 NGFFORM
|
$specialdocumentsform = &create_form_ul(&create_list_elements(@specialdocumentsforma)); |
$specialdocumentsform = &create_form_ul(&create_list_elements(@specialdocumentsforma)); |
|
|
|
|
|
|
my @importdoc = ( |
my @importdoc = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="toggleUpload(\'ext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'newext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:toggleUpload(\'ims\');" />'=>$imspform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:makeims();" />'=>$imspform},); |
{'<img class="LC_noBorder_LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'doc\');" />'=>$fileuploadform, |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)) . '<hr id="cc_hrule" style="width:0px;text-align:left;margin-left:0" />' . $fileuploadform; |
}); |
|
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); |
|
|
|
@gradingforma=( |
@gradingforma=( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.$lt{sipr}.'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
Line 3961 NGFFORM
|
Line 3832 NGFFORM
|
|
|
my %orderhash = ( |
my %orderhash = ( |
'aa' => ['Import Content',$fileuploadform], |
'aa' => ['Import Content',$fileuploadform], |
'bb' => ['Published Content',$importpubform], |
'bb' => ['Published Content',$simpleeditdefaultform], |
'cc' => ['Grading Resources',$gradingform], |
'cc' => ['Grading Resources',$gradingform], |
); |
); |
unless ($env{'form.pagepath'}) { |
unless ($env{'form.pagepath'}) { |
Line 3973 unless ($env{'form.pagepath'}) {
|
Line 3844 unless ($env{'form.pagepath'}) {
|
$hadchanges=0; |
$hadchanges=0; |
unless (($supplementalflag || $toolsflag)) { |
unless (($supplementalflag || $toolsflag)) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%orderhash,$iconpath,$uploadtag); |
$supplementalflag,\%orderhash,$iconpath); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 4000 unless ($env{'form.pagepath'}) {
|
Line 3871 unless ($env{'form.pagepath'}) {
|
$env{'form.pagepath'} = ''; |
$env{'form.pagepath'} = ''; |
if ($allowed) { |
if ($allowed) { |
my $folderseq= |
my $folderseq= |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_new.sequence'; |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time. |
|
'.sequence'; |
|
|
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
|
|
|
my $supupdocformbtn = "<input type='submit' value='".$lt{'upld'}."' />$help{'Uploading_From_Harddrive'}"; |
my $supupdocform=(<<SUPDOCFORM); |
my $supupdocform=(<<SUPDOCFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppdoc');"> |
|
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
|
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<fieldset id="uploadsuppdocform" style="display: none;" /> |
|
<legend>$lt{'upfi'}</legend> |
|
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="ee" /> |
$fileupload |
$fileupload |
<br /> |
<br /> |
Line 4023 unless ($env{'form.pagepath'}) {
|
Line 3892 unless ($env{'form.pagepath'}) {
|
<br /> |
<br /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
<input type='submit' value="$lt{'upld'}" /> |
SUPDOCFORM |
</form> |
$supupdocform .= &create_form_ul(&Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."</form>"; |
|
|
my $supnewfolderform=(<<SNFFORM); |
my $supnewfolderform=(<<SNFFORM); |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
Line 4036 unless ($env{'form.pagepath'}) {
|
Line 3905 unless ($env{'form.pagepath'}) {
|
</form> |
</form> |
SNFFORM |
SNFFORM |
|
|
my $supextform=(<<ERFORM); |
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppext');">$lt{'extr'}</a>$help{'Adding_External_Resource'} |
my $supnewextform=(<<SNEFORM); |
<form action="/adm/coursedocs" method="post" name="newsuppext"> |
<form action="/adm/coursedocs" method="post" name="supnewext"> |
<fieldset id="uploadsuppextform" style="display: none;" /> |
<input type="hidden" name="active" value="ff" /> |
<legend>$lt{'extr'}</legend> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="importdetail" value="" /> |
$lt{'url'}:<br /> |
<a class="LC_menubuttons_link" href="javascript:makenewext('supnewext');">$lt{'extr'}</a> $help{'Adding_External_Resource'} |
<input type="text" size="60" name="exturl" id="exturl" value="http://" /> |
</form> |
<input type="button" name="view" value="$lt{'prev'}" onclick="javascript:extUrlPreview('exturl');" /><br /> |
SNEFORM |
$lt{'title'}:<br /> |
|
<input type="text" size="60" name="exttitle" value="$lt{'extr'}" /> |
|
$uploadtag |
|
<br /> |
|
<input type="hidden" name="importdetail" value="" /> |
|
<input type="button" value="$lt{'lnk'}" onclick="javascript:setExternal(this.form,0)" /> |
|
</fieldset> |
|
</form> |
|
ERFORM |
|
|
|
my $supnewsylform=(<<SNSFORM); |
my $supnewsylform=(<<SNSFORM); |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
Line 4085 my @specialdocs = (
|
Line 3945 my @specialdocs = (
|
=>$supnewaboutmeform}, |
=>$supnewaboutmeform}, |
); |
); |
my @supimportdoc = ( |
my @supimportdoc = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'supext\');" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'supnewext\');" />' |
=>$supextform}, |
=>$supnewextform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'suppdoc\');" />' |
|
=>$supupdocform}, |
|
); |
); |
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)); |
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)) . '<hr id="ee_hrule" style="width:0px;text-align:left;margin-left:0" />' . $supupdocform; |
my %suporderhash = ( |
my %suporderhash = ( |
'00' => ['Supnewfolder', $supnewfolderform], |
'00' => ['Supnewfolder', $supnewfolderform], |
'ee' => ['Import Content',$supupdocform], |
'ee' => ['Import Content',$supupdocform], |
Line 4098 my %suporderhash = (
|
Line 3956 my %suporderhash = (
|
); |
); |
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%suporderhash,$iconpath,$uploadtag); |
$supplementalflag,\%suporderhash,$iconpath); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,'',$iconpath,$uploadtag); |
$supplementalflag,'',$iconpath); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 4378 sub generate_edit_table {
|
Line 4236 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 { |
Line 4405 sub generate_edit_table {
|
Line 4263 sub generate_edit_table {
|
$active = 'class="active"'; |
$active = 'class="active"'; |
} |
} |
$form .= '<li style="float:right" '.$active |
$form .= '<li style="float:right" '.$active |
|
.' onmouseover="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');"' |
.' 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 '.$active.' style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n"; |
$form .= '<li '.$active.' style="float:right">'.${$orderhash{$name}}[1].'</li>'."\n"; |
Line 4461 sub editing_js {
|
Line 4320 sub editing_js {
|
p_ctr2a => 'Cut[_98]', |
p_ctr2a => 'Cut[_98]', |
p_ctr2b => '?[_98]', |
p_ctr2b => '?[_98]', |
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', |
|
imscms => 'You must select which Course Management System was the source of the IMS package', |
|
invurl => 'Invalid URL', |
|
titbl => 'Title is blank', |
|
); |
); |
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
Line 4484 sub editing_js {
|
Line 4339 sub editing_js {
|
$backtourl = '/adm/supplemental'; |
$backtourl = '/adm/supplemental'; |
} |
} |
|
|
my $fieldsets = "'ext','doc','ims'"; |
|
if ($supplementalflag) { |
|
$fieldsets = "'suppext','suppdoc'"; |
|
} |
|
|
|
my $urlregexp = <<'ENDREGEXP'; |
|
/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i |
|
ENDREGEXP |
|
|
|
return <<ENDNEWSCRIPT; |
return <<ENDNEWSCRIPT; |
function makenewfolder(targetform,folderseq) { |
function makenewfolder(targetform,folderseq) { |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
Line 4510 function makenewpage(targetform,folderse
|
Line 4356 function makenewpage(targetform,folderse
|
} |
} |
} |
} |
|
|
function editext(residx) { |
function makenewext(targetname) { |
if (document.getElementById('uploadext'+residx)) { |
this.document.forms.extimport.useform.value=targetname; |
var curr = document.getElementById('uploadext'+residx).style.display; |
this.document.forms.extimport.title.value=''; |
if (curr == 'none') { |
this.document.forms.extimport.url.value=''; |
disp = 'block'; |
this.document.forms.extimport.residx.value=''; |
} else { |
window.open('/adm/rat/extpickframe.html'); |
disp = 'none'; |
} |
} |
|
document.getElementById('uploadext'+residx).style.display=disp; |
function edittext(targetname,residx,title,url) { |
} |
this.document.forms.extimport.useform.value=targetname; |
resize_scrollbox('contentscroll','1','1'); |
this.document.forms.extimport.residx.value=residx; |
return; |
this.document.forms.extimport.url.value=url; |
|
this.document.forms.extimport.title.value=title; |
|
window.open('/adm/rat/extpickframe.html'); |
} |
} |
|
|
function makeexamupload() { |
function makeexamupload() { |
Line 4588 function makeabout() {
|
Line 4436 function makeabout() {
|
} |
} |
} |
} |
|
|
function toggleUpload(caller) { |
function makeims() { |
var blocks = Array($fieldsets); |
var caller = document.forms.ims.folder.value; |
for (var i=0; i<blocks.length; i++) { |
var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one"; |
var disp = 'none'; |
newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes"); |
if (caller == blocks[i]) { |
newWindow.location.href = newlocation; |
var curr = document.getElementById('upload'+caller+'form').style.display; |
|
if (curr == 'none') { |
|
disp='block'; |
|
} |
|
} |
|
document.getElementById('upload'+blocks[i]+'form').style.display=disp; |
|
} |
|
resize_scrollbox('contentscroll','1','1'); |
|
return; |
|
} |
} |
|
|
function toggleMap() { |
function finishpick() { |
var disp = 'none'; |
var title=this.document.forms.extimport.title.value; |
var curr = document.getElementById('importmapform').style.display; |
var url=this.document.forms.extimport.url.value; |
if (curr == 'none') { |
var form=this.document.forms.extimport.useform.value; |
disp='block'; |
var residx=this.document.forms.extimport.residx.value; |
} |
eval('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+'='+residx+'";this.document.forms.'+form+'.submit();'); |
document.getElementById('importmapform').style.display=disp; |
|
resize_scrollbox('contentscroll','1','1'); |
|
return; |
|
} |
|
|
|
|
|
function extUrlPreview(caller) { |
|
if (document.getElementById(caller)) { |
|
var url = document.getElementById(caller).value; |
|
var regexp = $urlregexp; |
|
if (regexp.test(url)) { |
|
openMyModal(url,500,400,'yes'); |
|
} else { |
|
alert("$lt{'invurl'}"); |
|
} |
|
} |
|
} |
|
|
|
function makeims(imsform) { |
|
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
|
alert("$lt{'imsfile'}"); |
|
return; |
|
} |
|
if (imsform.source.selectedIndex == 0) { |
|
alert("$lt{'imscms'}"); |
|
return; |
|
} |
|
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
|
imsform.submit(); |
|
} |
|
|
|
function setExternal(extform,residx) { |
|
var title=extform.exttitle.value; |
|
if (!String.trim) { |
|
String.prototype.trim = function() {return this.replace(\/^\\s+|\\s+$\/g, "");}; } |
|
var url=extform.exturl.value; |
|
var regexp = $urlregexp; |
|
if (title == null || title.trim()=="") { |
|
alert("$lt{'titbl'}"); |
|
extform.exttitle.focus(); |
|
return; |
|
} |
|
if (regexp.test(url)) { |
|
url = escape(url); |
|
if (residx > 0) { |
|
eval("extform.importdetail.value=title+'='+url+'='+residx;extform.submit();"); |
|
} else { |
|
eval("extform.importdetail.value=title+'='+url;extform.submit();"); |
|
} |
|
} else { |
|
alert("$lt{'invurl'}"); |
|
extform.exturl.focus(); |
|
return; |
|
} |
|
} |
} |
|
|
function changename(folderpath,index,oldtitle,container,pagesymb) { |
function changename(folderpath,index,oldtitle,container,pagesymb) { |
Line 4817 function showPage(current, pageId, nav,
|
Line 4602 function showPage(current, pageId, nav,
|
currentData = document.getElementById(pageId); |
currentData = document.getElementById(pageId); |
currentData.style.display = 'block'; |
currentData.style.display = 'block'; |
activeTab = pageId; |
activeTab = pageId; |
toggleUpload(); |
|
toggleMap(); |
|
if (nav == 'mainnav') { |
if (nav == 'mainnav') { |
var storedpath = "$docs_folderpath"; |
var storedpath = "$docs_folderpath"; |
if (storedpath == '') { |
if (storedpath == '') { |