version 1.484.2.20, 2013/01/04 00:17:48
|
version 1.511, 2012/11/29 20:37:07
|
Line 391 sub docs_change_log {
|
Line 391 sub docs_change_log {
|
my %orderhash; |
my %orderhash; |
my $container='sequence'; |
my $container='sequence'; |
my $pathitem; |
my $pathitem; |
if ($env{'form.folderpath'} =~ /\:1$/) { |
if ($env{'form.pagepath'}) { |
$container='page'; |
$container='page'; |
|
$pathitem = '<input type="hidden" name="pagepath" value="'. |
|
&HTML::Entities::encode($env{'form.pagepath'},'<>&"').'" />'; |
|
} else { |
|
my $folderpath=$env{'form.folderpath'}; |
|
if ($folderpath eq '') { |
|
$folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents')); |
|
} |
|
$pathitem = '<input type="hidden" name="folderpath" value="'. |
|
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
} |
} |
my $folderpath=$env{'form.folderpath'}; |
|
if ($folderpath eq '') { |
|
$folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents').':::::'); |
|
} |
|
$pathitem = '<input type="hidden" name="folderpath" value="'. |
|
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
|
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
my $jumpto = $readfile; |
my $jumpto = $readfile; |
$jumpto =~ s{^/}{}; |
$jumpto =~ s{^/}{}; |
Line 651 sub print_paste_buffer {
|
Line 654 sub print_paste_buffer {
|
$is_external = 1; |
$is_external = 1; |
} |
} |
|
|
my ($canpaste,$nopaste,$othercrs,$areachange); |
my ($canpaste,$nopaste,$othercrs,$areachange,$is_uploaded_map); |
if ($folder =~ /^supplemental/) { |
if ($folder =~ /^supplemental/) { |
$canpaste = &supp_pasteable($env{'docs.markedcopy_url'}); |
$canpaste = &supp_pasteable($env{'docs.markedcopy_url'}); |
unless ($canpaste) { |
unless ($canpaste) { |
Line 758 sub print_paste_buffer {
|
Line 761 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); |
$r->print(' |
if ($container eq 'page') { |
|
$r->print(' |
|
<input type="hidden" name="pagepath" value="'.&HTML::Entities::encode($env{'form.pagepath'},'<>&"').'" /> |
|
<input type="hidden" name="pagesymb" value="'.&HTML::Entities::encode($env{'form.pagesymb'},'<>&"').'" /> |
|
'); |
|
} else { |
|
$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'},'<>&"').'" /> |
'); |
'); |
|
} |
$r->print('</form>'); |
$r->print('</form>'); |
} else { |
} else { |
$r->print(&mt('Paste buffer contains:').' '.$buffer. |
$r->print(&mt('Paste buffer contains:').' '.$buffer. |
Line 1543 sub apply_fixups {
|
Line 1553 sub apply_fixups {
|
if ($folder !~ /^supplemental/) { |
if ($folder !~ /^supplemental/) { |
$report = 1; |
$report = 1; |
} |
} |
(my $outtext,$errtext) = |
my ($outtext,$errtext) = |
&LONCAPA::map::storemap("/uploaded/$cdom/$cnum/$storefn",1,$report); |
&LONCAPA::map::storemap("/uploaded/$cdom/$cnum/$storefn",1,$report); |
if ($errtext) { |
if ($errtext) { |
return &mt('Paste failed: an error occurred saving the folder or page.'); |
return &mt('Paste failed: an error occurred saving the folder or page.'); |
Line 1682 sub handle_edit_cmd {
|
Line 1692 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,$pathitem)=@_; |
$supplementalflag,$orderhash,$iconpath,$pathitem)=@_; |
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order,$container); |
my $container= ($env{'form.pagepath'}) ? 'page' |
|
: 'sequence'; |
|
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order); |
if ($allowed) { |
if ($allowed) { |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain, |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = |
$is_random_order,$container) = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); |
$r->print($breadcrumbtrail); |
$r->print($breadcrumbtrail); |
} elsif ($env{'form.folderpath'} =~ /\:1$/) { |
|
$container = 'page'; |
|
} else { |
|
$container = 'sequence'; |
|
} |
} |
|
|
my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container"; |
my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container"; |
Line 1855 sub editor {
|
Line 1862 sub editor {
|
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,$coursedom,$crstype, |
$pathitem,$supplementalflag,$container); |
$pathitem,$supplementalflag); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
&Apache::loncommon::end_data_table_count(); |
&Apache::loncommon::end_data_table_count(); |
|
|
if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) { |
if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) { |
my $toolslink = '<table><tr><td>' |
|
.&Apache::loncommon::help_open_menu('Navigation Screen', |
|
'Navigation_Screen',undef,'RAT') |
|
.'</td><td class="LC_middle">'.&mt('Tools:').'</td>' |
|
.'<td align="left"><ul id="LC_toolbar">' |
|
.'<li><a href="/adm/coursedocs?forcesupplement=1" ' |
|
.'id="LC_content_toolbar_edittoplevel" ' |
|
.'class="LC_toolbarItem" ' |
|
.'title="'.&mt('Supplemental Content Editor').'">' |
|
.'</a></li></ul></td></tr></table><br />'; |
|
if ($shown) { |
if ($shown) { |
if ($allowed) { |
if ($allowed) { |
$to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll') |
$to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll') |
Line 1889 sub editor {
|
Line 1886 sub editor {
|
.'<br style="line-height:2px;" />' |
.'<br style="line-height:2px;" />' |
.&Apache::loncommon::end_scrollbox(); |
.&Apache::loncommon::end_scrollbox(); |
} else { |
} else { |
$to_show .= $toolslink |
$to_show = '<table><tr><td>'.&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT') |
|
.'</td><td class="LC_middle">'.&mt('Tools:').'</td>' |
|
.'<td align="left"><ul id="LC_toolbar">' |
|
.'<li><a href="/adm/coursedocs?forcesupplement=1" ' |
|
.'id="LC_content_toolbar_edittoplevel" ' |
|
.'class="LC_toolbarItem" ' |
|
.'title="'.&mt('Supplemental Content Editor').'">' |
|
.'</a></li></ul></td></tr></table><br />' |
.&Apache::loncommon::start_data_table('LC_tableOfContent') |
.&Apache::loncommon::start_data_table('LC_tableOfContent') |
.$output.' ' |
.$output.' ' |
.&Apache::loncommon::end_data_table(); |
.&Apache::loncommon::end_data_table(); |
} |
} |
} else { |
} else { |
if (!$allowed) { |
|
$to_show .= $toolslink; |
|
} |
|
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
.'<div class="LC_info" id="contentlist">' |
.'<div class="LC_info" id="contentlist">' |
.&mt('Currently no documents.') |
.&mt('Currently no documents.') |
Line 1947 sub process_file_upload {
|
Line 1948 sub process_file_upload {
|
my $errtext=''; |
my $errtext=''; |
my $fatal=0; |
my $fatal=0; |
my $container='sequence'; |
my $container='sequence'; |
if ($env{'form.folderpath'} =~ /:1$/) { |
if ($env{'form.pagepath'}) { |
$container='page'; |
$container='page'; |
} |
} |
($errtext,$fatal)= |
($errtext,$fatal)= |
Line 2037 sub process_file_upload {
|
Line 2038 sub process_file_upload {
|
my $archiveurl = &HTML::Entities::encode($url,'<>&"'); |
my $archiveurl = &HTML::Entities::encode($url,'<>&"'); |
my %archiveitems = ( |
my %archiveitems = ( |
folderpath => $env{'form.folderpath'}, |
folderpath => $env{'form.folderpath'}, |
|
pagepath => $env{'form.pagepath'}, |
cmd => $nextphase, |
cmd => $nextphase, |
newidx => $newidx, |
newidx => $newidx, |
position => $position, |
position => $position, |
Line 2091 sub is_supplemental_title {
|
Line 2093 sub is_supplemental_title {
|
|
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
$crstype,$pathitem,$supplementalflag,$container)=@_; |
$crstype,$pathitem,$supplementalflag)=@_; |
my ($foldertitle,$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); |
|
$pagetitle = $foldertitle; |
} else { |
} else { |
$title=&HTML::Entities::encode($title,'"<>&\''); |
$title=&HTML::Entities::encode($title,'"<>&\''); |
$renametitle=$title; |
$renametitle=$title; |
$foldertitle=$title; |
$foldertitle=$title; |
|
$pagetitle=$title; |
} |
} |
|
|
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
Line 2109 sub entryline {
|
Line 2113 sub entryline {
|
my $line=&Apache::loncommon::start_data_table_row(); |
my $line=&Apache::loncommon::start_data_table_row(); |
my ($form_start,$form_end,$form_common); |
my ($form_start,$form_end,$form_common); |
# Edit commands |
# Edit commands |
my ($type, $esc_path, $path, $symb); |
my ($container, $type, $esc_path, $path, $symb); |
if ($container eq 'page') { |
|
$type = 'page'; |
|
} else { |
|
$type = 'folder'; |
|
} |
|
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
|
$type = 'folder'; |
|
$container = 'sequence'; |
$esc_path=&escape($env{'form.folderpath'}); |
$esc_path=&escape($env{'form.folderpath'}); |
$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"'); |
# $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"'); |
} |
} |
|
if ($env{'form.pagepath'}) { |
|
$type = $container = 'page'; |
|
$esc_path=&escape($env{'form.pagepath'}); |
|
$path = &HTML::Entities::encode($env{'form.pagepath'},'<>&"'); |
|
} |
my $isexternal; |
my $isexternal; |
if ($residx) { |
if ($residx) { |
my $currurl = $url; |
my $currurl = $url; |
Line 2136 sub entryline {
|
Line 2142 sub entryline {
|
&Apache::lonnet::declutter($currurl)); |
&Apache::lonnet::declutter($currurl)); |
} |
} |
} |
} |
my ($renamelink,%lt); |
my %lt; |
if ($allowed) { |
if ($allowed) { |
my $incindex=$index+1; |
my $incindex=$index+1; |
my $selectbox=''; |
my $selectbox=''; |
Line 2233 sub entryline {
|
Line 2239 sub entryline {
|
$nocopy=1; |
$nocopy=1; |
} |
} |
} |
} |
my ($copylink,$cutlink,$removelink); |
my ($copylink,$cutlink,$removelink,$renamelink); |
my $skip_confirm = 0; |
my $skip_confirm = 0; |
if ( $folder =~ /^supplemental/ |
if ( $folder =~ /^supplemental/ |
|| ($url =~ m{( /smppg$ |
|| ($url =~ m{( /smppg$ |
Line 2252 sub entryline {
|
Line 2258 sub entryline {
|
ENDCOPY |
ENDCOPY |
} else { |
} else { |
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY); |
<a href="javascript:markcopy('$esc_path','$index','$renametitle','$container','$folder');" class="LC_docs_copy">$lt{'cp'}</a> |
<a href="javascript:markcopy('$esc_path','$index','$renametitle','$container','$symb','$folder');" class="LC_docs_copy">$lt{'cp'}</a> |
ENDCOPY |
ENDCOPY |
} |
} |
if ($nocut) { |
if ($nocut) { |
Line 2261 ENDCOPY
|
Line 2267 ENDCOPY
|
ENDCUT |
ENDCUT |
} else { |
} else { |
$cutlink=(<<ENDCUT); |
$cutlink=(<<ENDCUT); |
<a href="javascript:cutres('$esc_path','$index','$renametitle','$container','$folder',$skip_confirm);" class="LC_docs_cut">$lt{'ct'}</a> |
<a href="javascript:cutres('$esc_path','$index','$renametitle','$container','$symb','$folder',$skip_confirm);" class="LC_docs_cut">$lt{'ct'}</a> |
ENDCUT |
ENDCUT |
} |
} |
if ($noremove) { |
if ($noremove) { |
Line 2270 ENDCUT
|
Line 2276 ENDCUT
|
ENDREM |
ENDREM |
} else { |
} else { |
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<a href='javascript:removeres("$esc_path","$index","$renametitle",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a> |
<a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb",$skip_confirm);' class="LC_docs_remove">$lt{'rm'}</a> |
ENDREM |
ENDREM |
} |
} |
unless ($isexternal) { |
$renamelink=(<<ENDREN); |
$renamelink=(<<ENDREN); |
<a href='javascript:changename("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_rename">$lt{'rn'}</a> |
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
|
ENDREN |
ENDREN |
} |
|
$form_start = ' |
$form_start = ' |
<form action="/adm/coursedocs" method="post"> |
<form action="/adm/coursedocs" method="post"> |
'; |
'; |
Line 2309 END
|
Line 2313 END
|
</td> |
</td> |
<td class="LC_docs_entry_commands"><span class="LC_nobreak"> |
<td class="LC_docs_entry_commands"><span class="LC_nobreak"> |
$removelink |
$removelink |
|
$renamelink |
$cutlink |
$cutlink |
$copylink |
$copylink |
</span> |
</span> |
Line 2320 END
|
Line 2325 END
|
my ($extension)=($url=~/\.(\w+)$/); |
my ($extension)=($url=~/\.(\w+)$/); |
my $uploaded=($url=~/^\/*uploaded\//); |
my $uploaded=($url=~/^\/*uploaded\//); |
my $icon=&Apache::loncommon::icon($url); |
my $icon=&Apache::loncommon::icon($url); |
my $isfolder; |
my $isfolder=0; |
my $ispage; |
my $ispage=0; |
my $containerarg; |
my $folderarg; |
|
my $pagearg; |
|
my $pagefile; |
if ($uploaded) { |
if ($uploaded) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
$containerarg = $1; |
my $containerarg = $1; |
if ($extension eq 'sequence') { |
if ($extension eq 'sequence') { |
$icon=$iconpath.'navmap.folder.closed.gif'; |
$icon=$iconpath.'navmap.folder.closed.gif'; |
|
$folderarg=$containerarg; |
$isfolder=1; |
$isfolder=1; |
} else { |
} else { |
$icon=$iconpath.'page.gif'; |
$icon=$iconpath.'page.gif'; |
|
$pagearg=$containerarg; |
$ispage=1; |
$ispage=1; |
} |
} |
if ($allowed) { |
if ($allowed) { |
Line 2344 END
|
Line 2353 END
|
} |
} |
} |
} |
|
|
my ($editlink,$extresform); |
my $editlink; |
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
if (!$supplementalflag && $residx && $symb) { |
if (!$supplementalflag && $residx && $symb) { |
|
if ($container eq 'page') { |
|
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
|
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
|
} |
if ((!$isfolder) && (!$ispage)) { |
if ((!$isfolder) && (!$ispage)) { |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
$url=&Apache::lonnet::clutter($url); |
$url=&Apache::lonnet::clutter($url); |
Line 2373 END
|
Line 2386 END
|
} |
} |
} |
} |
my ($rand_pick_text,$rand_order_text); |
my ($rand_pick_text,$rand_order_text); |
if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') { |
if ($isfolder || $extension eq 'sequence') { |
my $foldername=&escape($foldertitle); |
my $foldername=&escape($foldertitle); |
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath) { $folderpath.='&' }; |
if ($folderpath) { $folderpath.='&' }; |
if (!$allowed && $supplementalflag) { |
if (!$allowed && $supplementalflag) { |
$folderpath.=$containerarg.'&'.$foldername; |
$folderpath.=$folderarg.'&'.$foldername; |
$url.='folderpath='.&escape($folderpath); |
$url.='folderpath='.&escape($folderpath); |
} else { |
} else { |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# so it gets transferred between levels |
# so it gets transferred between levels |
$folderpath.=$containerarg.'&'.$foldername. |
$folderpath.=$folderarg.'&'.$foldername. |
':'.(&LONCAPA::map::getparameter($orderidx, |
':'.(&LONCAPA::map::getparameter($orderidx, |
'parameter_randompick'))[0] |
'parameter_randompick'))[0] |
.':'.((&LONCAPA::map::getparameter($orderidx, |
.':'.((&LONCAPA::map::getparameter($orderidx, |
Line 2391 END
|
Line 2404 END
|
.':'.((&LONCAPA::map::getparameter($orderidx, |
.':'.((&LONCAPA::map::getparameter($orderidx, |
'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); |
.':'.$ispage; |
|
$url.='folderpath='.&escape($folderpath); |
$url.='folderpath='.&escape($folderpath); |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
'parameter_randompick'))[0]; |
'parameter_randompick'))[0]; |
Line 2426 $form_common.'
|
Line 2438 $form_common.'
|
$url .= '&idx='.$orderidx; |
$url .= '&idx='.$orderidx; |
} |
} |
} |
} |
my ($tdalign,$tdwidth); |
if ($ispage) { |
|
my $pagename=&escape($pagetitle); |
|
my $pagepath; |
|
my $folderpath=$env{'form.folderpath'}; |
|
if ($folderpath) { $pagepath = $folderpath.'&' }; |
|
$pagepath.=$pagearg.'&'.$pagename; |
|
$url.='pagepath='.&escape($pagepath). |
|
'&pagesymb='.&escape($symb); |
|
} |
if ($allowed) { |
if ($allowed) { |
my $fileloc = |
my $fileloc = |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
if ($isexternal) { |
if ($isexternal) { |
($editlink,$extresform) = |
$editlink = ' '. |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem); |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem); |
} elsif (!$isfolder && !$ispage) { |
} elsif (!$isfolder && !$ispage) { |
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
Line 2443 $form_common.'
|
Line 2463 $form_common.'
|
$forceedit, |
$forceedit, |
undef,$symb, |
undef,$symb, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
$renametitle,'','',1); |
$renametitle); |
if ($jscall) { |
if ($jscall) { |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$editlink = ' <a class="LC_docs_ext_edit" href="javascript:'. |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
$jscall.'" >'.&mt('Edit').'</a>'; |
} |
} |
} |
} |
} |
} |
$tdalign = ' align="right" valign="top"'; |
|
$tdwidth = ' width="80%"'; |
|
} |
} |
my $reinit; |
my $reinit; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$reinit = &mt('(re-initialize community to access)'); |
$reinit = &mt('(re-initialize community to access)'); |
} else { |
} else { |
$reinit = &mt('(re-initialize course to access)'); |
$reinit = &mt('(re-initialize course to access)'); |
} |
} |
$line.='<td class="LC_docs_entry_commands"'.$tdalign.'><span class="LC_nobreak">'.$editlink.$renamelink; |
$line.='<td>'; |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
} elsif ($url) { |
} elsif ($url) { |
Line 2468 $form_common.'
|
Line 2486 $form_common.'
|
} else { |
} else { |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
} |
} |
$line.='</span></td><td'.$tdwidth.'>'; |
$line.='</td><td>'; |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
} elsif ($url) { |
} elsif ($url) { |
Line 2477 $form_common.'
|
Line 2495 $form_common.'
|
} else { |
} else { |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
} |
} |
$line.="$extresform</td>"; |
$line.=$editlink."</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 2627 sub checkonthis {
|
Line 2645 sub checkonthis {
|
$r->print('<span class="LC_error">'.&mt('connection down').'</span>'); |
$r->print('<span class="LC_error">'.&mt('connection down').'</span>'); |
} elsif ($result eq 'not_found') { |
} elsif ($result eq 'not_found') { |
unless ($url=~/\$/) { |
unless ($url=~/\$/) { |
$r->print('<span class="LC_error">'.&mt('not found').'</span>'); |
$r->print('<span class="LC_error">'.&mt('not found').'</b></span>'); |
} else { |
} else { |
$r->print('<span class="LC_error">'.&mt('unable to verify variable URL').'</span>'); |
$r->print('<span class="LC_error">'.&mt('unable to verify variable URL').'</span>'); |
} |
} |
Line 2673 sub list_symbs {
|
Line 2691 sub list_symbs {
|
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td>'.$res->compTitle().'</td>'. |
'<td>'.$res->compTitle().'</td>'. |
'<td>'.$res->symb().'</td>'. |
'<td>'.$res->symb().'</td>'. |
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::start_data_table_row()); |
$count ++; |
$count ++; |
} |
} |
if (!$count) { |
if (!$count) { |
Line 2683 sub list_symbs {
|
Line 2701 sub list_symbs {
|
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} |
} |
$r->print(&endContentScreen()); |
|
} |
} |
|
|
|
|
Line 2714 sub verifycontent {
|
Line 2731 sub verifycontent {
|
} |
} |
&untiehash(); |
&untiehash(); |
$r->print('<p class="LC_success">'.&mt('Done').'</p>'); |
$r->print('<p class="LC_success">'.&mt('Done').'</p>'); |
$r->print(&endContentScreen()); |
|
} |
} |
|
|
|
|
Line 2794 sub checkversions {
|
Line 2810 sub checkversions {
|
if ($env{'form.timerange'} eq 'all') { |
if ($env{'form.timerange'} eq 'all') { |
# show all documents |
# show all documents |
$header=&mt('All Documents in '.$crstype); |
$header=&mt('All Documents in '.$crstype); |
$allsel=' selected="selected"'; |
$allsel=1; |
foreach my $key (keys(%hash)) { |
foreach my $key (keys(%hash)) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
my $src=$1; |
my $src=$1; |
Line 2815 sub checkversions {
|
Line 2831 sub checkversions {
|
.&mt('seconds'); |
.&mt('seconds'); |
if ($env{'form.timerange'}==-1) { |
if ($env{'form.timerange'}==-1) { |
$seltext='since start of course'; |
$seltext='since start of course'; |
$startsel=' selected="selected"'; |
$startsel='selected'; |
$env{'form.timerange'}=time; |
$env{'form.timerange'}=time; |
} |
} |
$starttime=time-$env{'form.timerange'}; |
$starttime=time-$env{'form.timerange'}; |
if ($env{'form.timerange'}==2592000) { |
if ($env{'form.timerange'}==2592000) { |
$seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$monthsel=' selected="selected"'; |
$monthsel='selected'; |
} elsif ($env{'form.timerange'}==604800) { |
} elsif ($env{'form.timerange'}==604800) { |
$seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$weeksel=' selected="selected"'; |
$weeksel='selected'; |
} elsif ($env{'form.timerange'}==86400) { |
} elsif ($env{'form.timerange'}==86400) { |
$seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; |
$daysel=' selected="selected"'; |
$daysel='selected'; |
} |
} |
$header=&mt('Content changed').' '.$seltext; |
$header=&mt('Content changed').' '.$seltext; |
} else { |
} else { |
Line 2865 sub checkversions {
|
Line 2881 sub checkversions {
|
<fieldset> |
<fieldset> |
<legend>$lt{'cd'}</legend> |
<legend>$lt{'cd'}</legend> |
<select name="timerange"> |
<select name="timerange"> |
<option value='all'$allsel>$lt{'al'}</option> |
<option value='all' $allsel>$lt{'al'}</option> |
<option value="-1"$startsel>$lt{'st'}</option> |
<option value="-1" $startsel>$lt{'st'}</option> |
<option value="2592000"$monthsel>$lt{'lm'}</option> |
<option value="2592000" $monthsel>$lt{'lm'}</option> |
<option value="604800"$weeksel>$lt{'lw'}</option> |
<option value="604800" $weeksel>$lt{'lw'}</option> |
<option value="86400"$daysel>$lt{'sy'}</option> |
<option value="86400" $daysel>$lt{'sy'}</option> |
</select> |
</select> |
<input type="submit" name="display" value="$lt{'sd'}" /> |
<input type="submit" name="display" value="$lt{'sd'}" /> |
</fieldset> |
</fieldset> |
Line 2885 $lt{'sc'}: <input type="submit" name="se
|
Line 2901 $lt{'sc'}: <input type="submit" name="se
|
<hr /> |
<hr /> |
<h4>$lt{'vers'}</h4> |
<h4>$lt{'vers'}</h4> |
<input type="submit" name="setversions" value="$lt{'save'}" /> |
<input type="submit" name="setversions" value="$lt{'save'}" /> |
|
<table border="0"> |
ENDHEADERS |
ENDHEADERS |
#number of columns for version history |
#number of columns for version history |
|
my $num_ver_col = 1; |
$r->print( |
$r->print( |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('Resources').'</th>'. |
'<th>'.&mt('Resources').'</th>'. |
"<th>$lt{'mr'}</th>". |
"<th>$lt{'mr'}</th>". |
"<th>$lt{'ve'}</th>". |
"<th>$lt{'ve'}</th>". |
"<th>$lt{'vu'}</th>". |
"<th>$lt{'vu'}</th>". |
'<th>'.&mt('History').'</th>'. |
'<th colspan="'.$num_ver_col.'">'.&mt('History').'</th>'. |
&Apache::loncommon::end_data_table_header_row() |
'</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) { |
$currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>'; |
$currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>'; |
} |
} |
my $linkurl=&Apache::lonnet::clutter($key); |
my $linkurl=&Apache::lonnet::clutter($key); |
$r->print( |
$r->print( |
|
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br />'. |
'<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br>'. |
'<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'. |
'<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'. |
'<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br />('. |
'<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br>('. |
&Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).')</span></td>'. |
&Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).')</span></td>'. |
'<td align="right">' |
'<td align="right">'); |
); |
# Used in course |
# Used in course |
my $usedversion=$hash{'version_'.$linkurl}; |
my $usedversion=$hash{'version_'.$linkurl}; |
if (($usedversion) && ($usedversion ne 'mostrecent')) { |
if (($usedversion) && ($usedversion ne 'mostrecent')) { |
if($usedversion != $currentversion){ |
if ($usedversion != $currentversion) { |
|
$r->print('<span class="LC_warning">'.$usedversion.'</span>'); |
$r->print('<span class="LC_warning">'.$usedversion.'</span>'); |
} else { |
}else{ |
$r->print($usedversion); |
$r->print($usedversion); |
} |
} |
|
} else { |
|
$r->print($currentversion); |
|
} |
|
$r->print('</td><td title="'.$lt{'vu'}.'">'); |
|
# Set version |
|
$r->print(&Apache::loncommon::select_form($setversions{$linkurl}, |
|
'set_version_'.$linkurl, |
|
{'select_form_order' => |
|
['',1..$currentversion,'mostrecent'], |
|
'' => '', |
|
'mostrecent' => &mt('most recent'), |
|
map {$_,$_} (1..$currentversion)})); |
|
my $lastold=1; |
|
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
|
my $url=$root.'.'.$prevvers.'.'.$extension; |
|
if (&Apache::lonnet::metadata($url,'lastrevisiondate')< |
|
$starttime) { |
|
$lastold=$prevvers; |
|
} |
|
} |
|
# |
|
# Code to figure out how many version entries should go in |
|
# each of the four columns |
|
my $entries_per_col = 0; |
|
my $num_entries = ($currentversion-$lastold); |
|
if ($num_entries % $num_ver_col == 0) { |
|
$entries_per_col = $num_entries/$num_ver_col; |
} else { |
} else { |
$r->print($currentversion); |
$entries_per_col = $num_entries/$num_ver_col + 1; |
} |
} |
$r->print('</td><td title="'.$lt{'vu'}.'">'); |
my $entries_count = 0; |
# Set version |
$r->print('<td valign="top"><span class="LC_fontsize_medium">'); |
$r->print(&Apache::loncommon::select_form( |
my $cols_output = 1; |
$setversions{$linkurl}, |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
'set_version_'.$linkurl, |
my $url=$root.'.'.$prevvers.'.'.$extension; |
{'select_form_order' => ['',1..$currentversion,'mostrecent'], |
$r->print('<span class="LC_nobreak"><a href="'.&Apache::lonnet::clutter($url). |
'' => '', |
'">'.&mt('Version').' '.$prevvers.'</a> ('. |
'mostrecent' => &mt('most recent'), |
&Apache::lonlocal::locallocaltime( |
map {$_,$_} (1..$currentversion)})); |
&Apache::lonnet::metadata($url, |
my $lastold=1; |
'lastrevisiondate') |
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
). |
my $url=$root.'.'.$prevvers.'.'.$extension; |
')'); |
if (&Apache::lonnet::metadata($url,'lastrevisiondate')<$starttime) { |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { |
$lastold=$prevvers; |
$r->print(' <a href="/adm/diff?filename='. |
} |
&Apache::lonnet::clutter($root.'.'.$extension). |
} |
'&versionone='.$prevvers. |
$r->print('</td>'); |
'" target="diffs">'.&mt('Diffs').'</a>'); |
# List all available versions |
} |
$r->print('<td valign="top"><span class="LC_fontsize_medium">'); |
$r->print('</span><br />'); |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
if (++$entries_count % $entries_per_col == 0) { |
my $url=$root.'.'.$prevvers.'.'.$extension; |
$r->print('</span></td>'); |
$r->print( |
if ($cols_output != $num_ver_col) { |
'<span class="LC_nobreak">' |
$r->print('<td valign="top"><span class="LC_fontsize_medium">'); |
.'<a href="'.&Apache::lonnet::clutter($url).'">' |
$cols_output++; |
.&mt('Version [_1]',$prevvers).'</a>' |
} |
.' ('.&Apache::lonlocal::locallocaltime( |
} |
&Apache::lonnet::metadata($url,'lastrevisiondate')) |
} |
.')'); |
while($cols_output++ < $num_ver_col) { |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { |
$r->print('</span></td><td>'); |
$r->print( |
|
' <a href="/adm/diff?filename='. |
|
&Apache::lonnet::clutter($root.'.'.$extension). |
|
&HTML::Entities::encode('&versionone='.$prevvers,'"<>&'). |
|
'" target="diffs">'.&mt('Diffs').'</a>'); |
|
} |
} |
$r->print('</span><br />'); |
} |
} |
|
$r->print('</span></td>'.&Apache::loncommon::end_data_table_row()); |
|
} |
} |
$r->print( |
$r->print('</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'. |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'); |
'</form>' |
|
); |
|
|
|
&untiehash(); |
&untiehash(); |
$r->print(&endContentScreen()); |
|
} |
} |
|
|
sub mark_hash_old { |
sub mark_hash_old { |
Line 3003 sub changewarning {
|
Line 3037 sub changewarning {
|
my $pathvar='folderpath'; |
my $pathvar='folderpath'; |
my $path=&escape($env{'form.folderpath'}); |
my $path=&escape($env{'form.folderpath'}); |
if (!defined($url)) { |
if (!defined($url)) { |
|
if (defined($env{'form.pagepath'})) { |
|
$pathvar='pagepath'; |
|
$path=&escape($env{'form.pagepath'}); |
|
$path.='&pagesymb='.&escape($env{'form.pagesymb'}); |
|
} |
$url='/adm/coursedocs?'.$pathvar.'='.$path; |
$url='/adm/coursedocs?'.$pathvar.'='.$path; |
} |
} |
my $course_type = &Apache::loncommon::course_type(); |
my $course_type = &Apache::loncommon::course_type(); |
Line 3068 sub startContentScreen {
|
Line 3107 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 3175 sub handler {
|
Line 3215 sub handler {
|
# Get the parameters that may be needed |
# Get the parameters that may be needed |
# |
# |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['folderpath', |
['folderpath','pagepath', |
'forcesupplement','forcestandard', |
'pagesymb','forcesupplement','forcestandard', |
'tools','symb','command','supppath']); |
'tools','symb','command','supppath']); |
|
|
# standard=1: this is a "new-style" course with an uploaded map as top level |
# standard=1: this is a "new-style" course with an uploaded map as top level |
Line 3191 sub handler {
|
Line 3231 sub handler {
|
|
|
|
|
my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); |
my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); |
if (($env{'form.folderpath'}=~/^default/) || ($env{'form.folderpath'} eq "")) { |
if (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'} eq "" || ($env{'form.pagepath'})) { |
$supplementalflag=0; |
$supplementalflag=0; |
} |
} |
if ($env{'form.forcesupplement'}) { $supplementalflag=1; } |
if ($env{'form.forcesupplement'}) { $supplementalflag=1; } |
Line 3213 sub handler {
|
Line 3253 sub handler {
|
if ($env{'form.command'} eq 'direct') { |
if ($env{'form.command'} eq 'direct') { |
my ($mapurl,$id,$resurl); |
my ($mapurl,$id,$resurl); |
if ($env{'form.symb'} ne '') { |
if ($env{'form.symb'} ne '') { |
$env{'form.folderpath'}= |
($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($env{'form.symb'}); |
&Apache::loncommon::symb_to_docspath($env{'form.symb'}); |
if ($resurl=~/\.(sequence|page)$/) { |
|
$mapurl=$resurl; |
|
} elsif ($resurl eq 'adm/navmaps') { |
|
$mapurl=$env{'course.'.$env{'request.course.id'}.'.url'}; |
|
} |
|
my $mapresobj; |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (ref($navmap)) { |
|
$mapresobj = $navmap->getResourceByUrl($mapurl); |
|
} |
|
$mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1}; |
|
my $type=$2; |
|
my $path; |
|
if (ref($mapresobj)) { |
|
my $pcslist = $mapresobj->map_hierarchy(); |
|
if ($pcslist ne '') { |
|
foreach my $pc (split(/,/,$pcslist)) { |
|
next if ($pc <= 1); |
|
my $res = $navmap->getByMapPc($pc); |
|
if (ref($res)) { |
|
my $thisurl = $res->src(); |
|
$thisurl=~s{^.*/([^/]+)\.\w+$}{$1}; |
|
my $thistitle = $res->title(); |
|
$path .= '&'. |
|
&Apache::lonhtmlcommon::entity_encode($thisurl).'&'. |
|
&Apache::lonhtmlcommon::entity_encode($thistitle). |
|
':'.$res->randompick(). |
|
':'.$res->randomout(). |
|
':'.$res->encrypted(). |
|
':'.$res->randomorder(); |
|
} |
|
} |
|
} |
|
$path =~ s/^\&//; |
|
my $maptitle = $mapresobj->title(); |
|
if ($mapurl eq 'default') { |
|
$maptitle = 'Main Course Documents'; |
|
} |
|
$path .= ($path ne '')? '&' : ''. |
|
&Apache::lonhtmlcommon::entity_encode($mapurl).'&'. |
|
&Apache::lonhtmlcommon::entity_encode($maptitle). |
|
':'.$mapresobj->randompick(). |
|
':'.$mapresobj->randomout(). |
|
':'.$mapresobj->encrypted(). |
|
':'.$mapresobj->randomorder(); |
|
} else { |
|
my $maptitle = &Apache::lonnet::gettitle($mapurl); |
|
if ($mapurl eq 'default') { |
|
$maptitle = 'Main Course Documents'; |
|
} |
|
$path = &Apache::lonhtmlcommon::entity_encode($mapurl).'&'. |
|
&Apache::lonhtmlcommon::entity_encode($maptitle).'::::'; |
|
} |
|
unless ($mapurl eq 'default') { |
|
$path = 'default&'. |
|
&Apache::lonhtmlcommon::entity_encode('Main Course Documents'). |
|
'::::&'.$path; |
|
} |
|
if ($type eq 'sequence') { |
|
$env{'form.folderpath'}=$path; |
|
$env{'form.pagepath'}=''; |
|
} else { |
|
$env{'form.pagepath'}=$path; |
|
$env{'form.folderpath'}=''; |
|
} |
} elsif ($env{'form.supppath'} ne '') { |
} elsif ($env{'form.supppath'} ne '') { |
$env{'form.folderpath'}=$env{'form.supppath'}; |
$env{'form.folderpath'}=$env{'form.supppath'}; |
} |
} |
} elsif ($env{'form.command'} eq 'editdocs') { |
} elsif ($env{'form.command'} eq 'editdocs') { |
$env{'form.folderpath'} = 'default&'. |
$env{'form.folderpath'} = 'default&'. |
&Apache::lonhtmlcommon::entity_encode('Main Course Content'). |
&Apache::lonhtmlcommon::entity_encode('Main Course Content'); |
':::::'; |
$env{'form.pagepath'}=''; |
} elsif ($env{'form.command'} eq 'editsupp') { |
} elsif ($env{'form.command'} eq 'editsupp') { |
$env{'form.folderpath'} = 'default&'. |
$env{'form.folderpath'} = 'default&'. |
&Apache::lonhtmlcommon::entity_encode('Supplemental Content'); |
&Apache::lonhtmlcommon::entity_encode('Supplemental Content'); |
|
$env{'form.pagepath'}=''; |
} |
} |
|
|
# Where do we store these for when we come back? |
# Where do we store these for when we come back? |
Line 3233 sub handler {
|
Line 3338 sub handler {
|
$stored_folderpath='docs_sup_folderpath'; |
$stored_folderpath='docs_sup_folderpath'; |
} |
} |
|
|
# No folderpath, and in edit mode, see if we have something stored |
# No folderpath, no pagepath, and in edit mode, see if we have something stored |
if ((!$env{'form.folderpath'}) && $allowed) { |
if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'}) && $allowed) { |
&Apache::loncommon::restore_course_settings($stored_folderpath, |
&Apache::loncommon::restore_course_settings($stored_folderpath, |
{'folderpath' => 'scalar'}); |
{'folderpath' => 'scalar'}); |
unless (&unescape($env{'form.folderpath'}) =~ m{^(default|supplemental)&}) { |
|
undef($env{'form.folderpath'}); |
|
} |
|
} |
} |
|
|
# If we are not allowed to make changes, all we can see are supplemental docs |
# If we are not allowed to make changes, all we can see are supplemental docs |
if (!$allowed) { |
if (!$allowed) { |
|
$env{'form.pagepath'}=''; |
unless ($env{'form.folderpath'} =~ /^supplemental/) { |
unless ($env{'form.folderpath'} =~ /^supplemental/) { |
$env{'form.folderpath'} = &supplemental_base(); |
$env{'form.folderpath'} = &supplemental_base(); |
} |
} |
} |
} |
|
# If we still not have a folderpath, see if we can resurrect at pagepath |
|
if (!$env{'form.folderpath'} && $allowed) { |
|
&Apache::loncommon::restore_course_settings($stored_folderpath, |
|
{'pagepath' => 'scalar'}); |
|
} |
# Make the zeroth entry in supplemental docs page paths, so we can get to top level |
# Make the zeroth entry in supplemental docs page paths, so we can get to top level |
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) { |
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) { |
$env{'form.folderpath'} = &supplemental_base() |
$env{'form.folderpath'} = &supplemental_base() |
Line 3255 sub handler {
|
Line 3363 sub handler {
|
$env{'form.folderpath'}; |
$env{'form.folderpath'}; |
} |
} |
# If after all of this, we still don't have any paths, make them |
# If after all of this, we still don't have any paths, make them |
unless ($env{'form.folderpath'}) { |
unless (($env{'form.pagepath'}) || ($env{'form.folderpath'})) { |
if ($supplementalflag) { |
if ($supplementalflag) { |
$env{'form.folderpath'}=&supplemental_base(); |
$env{'form.folderpath'}=&supplemental_base(); |
} else { |
} else { |
$env{'form.folderpath'}='default'.&escape(&mt('Main '.$crstype.' Documents')). |
$env{'form.folderpath'}='default'; |
':::::'; |
|
} |
} |
} |
} |
|
|
Line 3268 sub handler {
|
Line 3375 sub handler {
|
unless ($toolsflag) { |
unless ($toolsflag) { |
if ($allowed) { |
if ($allowed) { |
&Apache::loncommon::store_course_settings($stored_folderpath, |
&Apache::loncommon::store_course_settings($stored_folderpath, |
{'folderpath' => 'scalar'}); |
{'pagepath' => 'scalar', |
|
'folderpath' => 'scalar'}); |
} |
} |
my $folderpath; |
|
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$folderpath = $env{'form.folderpath'}; |
my (@folderpath)=split('&',$env{'form.folderpath'}); |
my (@folders)=split('&',$env{'form.folderpath'}); |
$env{'form.foldername'}=&unescape(pop(@folderpath)); |
$env{'form.foldername'}=&unescape(pop(@folders)); |
$env{'form.folder'}=pop(@folderpath); |
if ($env{'form.foldername'} =~ /\:1$/) { |
$container='sequence'; |
$container = 'page'; |
} |
} else { |
if ($env{'form.pagepath'}) { |
$container = 'sequence'; |
my (@pagepath)=split('&',$env{'form.pagepath'}); |
} |
$env{'form.pagename'}=&unescape(pop(@pagepath)); |
$env{'form.folder'}=pop(@folders); |
$env{'form.folder'}=pop(@pagepath); |
|
$container='page'; |
|
$containertag = '<input type="hidden" name="pagepath" value="" />'. |
|
'<input type="hidden" name="pagesymb" value="" />'; |
|
$pathitem = |
|
'<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="folderpath" value="" />'; |
} else { |
} else { |
if ($env{'form.folder'} eq '' || |
my $folderpath=$env{'form.folderpath'}; |
$env{'form.folder'} eq 'supplemental') { |
if (!$folderpath) { |
$folderpath='default&'. |
if ($env{'form.folder'} eq '' || |
&escape(&mt('Main '.$crstype.' Documents')). |
$env{'form.folder'} eq 'supplemental') { |
':::::'; |
$folderpath='default&'. |
|
&escape(&mt('Main '.$crstype.' Documents')); |
|
} |
} |
} |
|
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
|
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
} |
} |
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
|
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
|
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { |
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { |
$showdoc='/'.$1; |
$showdoc='/'.$1; |
} |
} |
Line 3328 sub handler {
|
Line 3444 sub handler {
|
@tabids = ('002','ee2','ff2'); |
@tabids = ('002','ee2','ff2'); |
} else { |
} else { |
@tabids = ('aa1','bb1','cc1','ff1'); |
@tabids = ('aa1','bb1','cc1','ff1'); |
unless ($env{'form.folderpath'} =~ /\:1$/) { |
unless ($env{'form.pagepath'}) { |
unshift(@tabids,'001'); |
unshift(@tabids,'001'); |
push(@tabids,('dd1','ee1')); |
push(@tabids,('dd1','ee1')); |
} |
} |
Line 3480 sub handler {
|
Line 3596 sub handler {
|
'prev' => 'Preview', |
'prev' => 'Preview', |
'lnk' => 'Add Link', |
'lnk' => 'Add Link', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
|
'nd' => 'Upload Document', |
|
'pm' => 'Published Map', |
|
'sd' => 'Special Document', |
|
'mo' => 'More Options', |
); |
); |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
my $fileupload=(<<FIUP); |
my $fileupload=(<<FIUP); |
Line 3503 CHBO
|
Line 3623 CHBO
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ims');"> |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('ims');"> |
$lt{'imsf'}</a> $help{'Importing_IMS_Course'} |
$lt{'imsf'}</a> $help{'Importing_IMS_Course'} |
<form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport"> |
<form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport"> |
<fieldset id="uploadimsform" style="display: none;"> |
<fieldset id="uploadimsform" style="display: none;" /> |
<legend>$lt{'imsf'}</legend> |
<legend>$lt{'imsf'}</legend> |
$fileupload |
$fileupload |
<br /> |
<br /> |
Line 3528 IMSFORM
|
Line 3648 IMSFORM
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('doc');"> |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('doc');"> |
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data"> |
<fieldset id="uploaddocform" style="display: none;"> |
<fieldset id="uploaddocform" style="display: none;" /> |
<legend>$lt{'upfi'}</legend> |
<legend>$lt{'upfi'}</legend> |
<input type="hidden" name="active" value="aa" /> |
<input type="hidden" name="active" value="aa" /> |
$fileupload |
$fileupload |
Line 3548 IMSFORM
|
Line 3668 IMSFORM
|
FUFORM |
FUFORM |
|
|
my $importpubform=(<<SEDFFORM); |
my $importpubform=(<<SEDFFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleMap('map');"> |
<a class="LC_menubuttons_link" href="javascript:toggleMap();"> |
$lt{'impm'}</a>$help{'Load_Map'} |
$lt{'impm'}</a>$help{'Load_Map'} |
<form action="/adm/coursedocs" method="post" name="mapimportform"> |
<form action="/adm/coursedocs" method="post" name="mapimportform"> |
<fieldset id="importmapform" style="display: none;"> |
<fieldset id="importmapform" style="display: none;" /> |
<legend>$lt{'impm'}</legend> |
<legend>$lt{'impm'}</legend> |
<input type="hidden" name="active" value="bb" /> |
<input type="hidden" name="active" value="bb" /> |
$lt{'copm'}<br /> |
$lt{'copm'}<br /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input type="text" name="importmap" size="40" value="" |
<input type="text" name="importmap" size="40" value="" |
onfocus="this.blur();openbrowser('mapimportform','importmap','sequence,page','');" /> |
onfocus="this.blur();openbrowser('mapimportform','importmap','sequence,page','');" /> |
<a href="javascript:openbrowser('mapimportform','importmap','sequence,page','');">$lt{'selm'}</a></span><br /> |
<a href="javascript:openbrowser('mapimportform','importmap','sequence,page','');">$lt{'selm'}</a><br /> |
<input type="submit" name="loadmap" value="$lt{'load'}" /> |
<input type="submit" name="loadmap" value="$lt{'load'}" /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
Line 3568 SEDFFORM
|
Line 3688 SEDFFORM
|
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'" onclick="javascript:groupsearch()" />' => $pathitem."<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()" />' => $pathitem."<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(\'map\');" />' => $importpubform } |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/sequence.png" alt="'.$lt{impm}.'" onclick="javascript:toggleMap();" />' => $importpubform } |
); |
); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
my $extresourcesform = |
my $extresourcesform = |
Line 3635 HIDDENFORM
|
Line 3755 HIDDENFORM
|
} |
} |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.sequence'; |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.sequence'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.page'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_new.page'; |
|
my $container='sequence'; |
|
if ($env{'form.pagepath'}) { |
|
$container='page'; |
|
} |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; |
|
|
my $newnavform=(<<NNFORM); |
my $newnavform=(<<NNFORM); |
Line 3792 NGFFORM
|
Line 3916 NGFFORM
|
|
|
|
|
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="toggleUpload(\'ext\');" />'=>$extresourcesform}, |
); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:toggleUpload(\'ims\');" />'=>$imspform}, |
unless ($container eq 'page') { |
{'<img class="LC_noBorder_LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'doc\');" />'=>$fileuploadform, |
push(@importdoc, |
}); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:toggleUpload(\'ims\');" />'=>$imspform} |
|
); |
|
} |
|
push(@importdoc, |
|
{'<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)); |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); |
|
|
@gradingforma=( |
@gradingforma=( |
Line 3826 my %orderhash = (
|
Line 3944 my %orderhash = (
|
'bb' => ['Published Content',$importpubform], |
'bb' => ['Published Content',$importpubform], |
'cc' => ['Grading Resources',$gradingform], |
'cc' => ['Grading Resources',$gradingform], |
); |
); |
unless ($container eq 'page') { |
unless ($env{'form.pagepath'}) { |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
$orderhash{'dd'} = ['Collaboration',$communityform]; |
$orderhash{'dd'} = ['Collaboration',$communityform]; |
$orderhash{'ee'} = ['Special Pages',$specialdocumentsform]; |
$orderhash{'ee'} = ['Special Documents',$specialdocumentsform]; |
} |
} |
|
|
$hadchanges=0; |
$hadchanges=0; |
Line 3859 unless ($container eq 'page') {
|
Line 3977 unless ($container eq 'page') {
|
} elsif ($allowed) { |
} elsif ($allowed) { |
$env{'form.folderpath'} = $savefolderpath; |
$env{'form.folderpath'} = $savefolderpath; |
} |
} |
|
$env{'form.pagepath'} = ''; |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
if ($allowed) { |
if ($allowed) { |
Line 3869 unless ($container eq 'page') {
|
Line 3988 unless ($container eq 'page') {
|
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppdoc');"> |
<a class="LC_menubuttons_link" href="javascript:toggleUpload('suppdoc');"> |
$lt{'upfi'}</a> $help{'Uploading_From_Harddrive'} |
$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;"> |
<fieldset id="uploadsuppdocform" style="display: none;" /> |
<legend>$lt{'upfi'}</legend> |
<legend>$lt{'upfi'}</legend> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="ee" /> |
$fileupload |
$fileupload |
Line 3932 my @specialdocs = (
|
Line 4051 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:toggleUpload(\'suppext\')" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="toggleUpload(\'suppext\')" />' |
=>$supextform}, |
=>$supextform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'suppdoc\');" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'suppdoc\');" />' |
=>$supupdocform}, |
=>$supupdocform}, |
Line 3942 $supupdocform = &create_form_ul(&create
|
Line 4061 $supupdocform = &create_form_ul(&create
|
my %suporderhash = ( |
my %suporderhash = ( |
'00' => ['Supnewfolder', $supnewfolderform], |
'00' => ['Supnewfolder', $supnewfolderform], |
'ee' => ['Import Content',$supupdocform], |
'ee' => ['Import Content',$supupdocform], |
'ff' => ['Special Pages',&create_form_ul(&create_list_elements(@specialdocs))] |
'ff' => ['Special Documents',&create_form_ul(&create_list_elements(@specialdocs))] |
); |
); |
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
Line 4027 sub decompression_info {
|
Line 4146 sub decompression_info {
|
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $container='sequence'; |
my $container='sequence'; |
my ($pathitem,$hiddenelem); |
my ($pathitem,$hiddenelem); |
my @hiddens = ('newidx','comment','position','folderpath'); |
my @hiddens = ('newidx','comment','position'); |
if ($env{'form.folderpath'} =~ /\:1$/) { |
if ($env{'form.pagepath'}) { |
$container='page'; |
$container='page'; |
|
$pathitem = 'pagepath'; |
|
} else { |
|
$pathitem = 'folderpath'; |
} |
} |
unshift(@hiddens,$pathitem); |
unshift(@hiddens,$pathitem); |
foreach my $item (@hiddens) { |
foreach my $item (@hiddens) { |
Line 4219 sub generate_edit_table {
|
Line 4341 sub generate_edit_table {
|
my $form; |
my $form; |
my $activetab; |
my $activetab; |
my $active; |
my $active; |
if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) { |
if($env{'form.active'} ne ''){ |
$activetab = $env{'form.active'}; |
$activetab = $env{'form.active'}; |
} |
} |
my $backicon = $iconpath.'clickhere.gif'; |
my $backicon = $iconpath.'clickhere.gif'; |
my $backtext = &mt('Exit'); |
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">'. |
Line 4316 sub editing_js {
|
Line 4438 sub editing_js {
|
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
|
my $docs_pagepath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.pagepath'},'<>&"'); |
my $main_container_page; |
my $main_container_page; |
if (&HTML::Entities::decode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'}) =~ /\:1$/) { |
if ($docs_folderpath eq '') { |
$main_container_page = 1; |
if ($docs_pagepath ne '') { |
|
$main_container_page = 1; |
|
} |
} |
} |
my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents%3A%3A%3A%3A%3A'; |
my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents'; |
my $toplevelsupp = &supplemental_base(); |
my $toplevelsupp = &supplemental_base(); |
|
|
my $backtourl = '/adm/navmaps'; |
my $backtourl = '/adm/navmaps'; |
Line 4328 sub editing_js {
|
Line 4453 sub editing_js {
|
$backtourl = '/adm/supplemental'; |
$backtourl = '/adm/supplemental'; |
} |
} |
|
|
my $fieldsets = "'ext','doc'"; |
my $fieldsets = "'ext','doc','ims'"; |
unless ($main_container_page) { |
|
$fieldsets .=",'ims'"; |
|
} |
|
if ($supplementalflag) { |
if ($supplementalflag) { |
$fieldsets = "'suppext','suppdoc'"; |
$fieldsets = "'suppext','suppdoc'"; |
} |
} |
Line 4433 function toggleUpload(caller) {
|
Line 4555 function toggleUpload(caller) {
|
return; |
return; |
} |
} |
|
|
function toggleMap(caller) { |
function toggleMap() { |
var disp = 'none'; |
var disp = 'none'; |
if (document.getElementById('importmapform')) { |
if (document.getElementById('importmapform')) { |
if (caller == 'map') { |
var curr = document.getElementById('importmapform').style.display; |
var curr = document.getElementById('importmapform').style.display; |
if (curr == 'none') { |
if (curr == 'none') { |
disp='block'; |
disp='block'; |
|
} |
|
} |
} |
document.getElementById('importmapform').style.display=disp; |
document.getElementById('importmapform').style.display=disp; |
resize_scrollbox('contentscroll','1','1'); |
resize_scrollbox('contentscroll','1','1'); |
Line 4461 function makeims(imsform) {
|
Line 4581 function makeims(imsform) {
|
imsform.submit(); |
imsform.submit(); |
} |
} |
|
|
function changename(folderpath,index,oldtitle) { |
function changename(folderpath,index,oldtitle,container,pagesymb) { |
var title=prompt('$lt{"p_chn"}',oldtitle); |
var title=prompt('$lt{"p_chn"}',oldtitle); |
if (title) { |
if (title) { |
this.document.forms.renameform.markcopy.value=-1; |
this.document.forms.renameform.markcopy.value=-1; |
this.document.forms.renameform.title.value=title; |
this.document.forms.renameform.title.value=title; |
this.document.forms.renameform.cmd.value='rename_'+index; |
this.document.forms.renameform.cmd.value='rename_'+index; |
this.document.forms.renameform.folderpath.value=folderpath; |
if (container == 'sequence') { |
|
this.document.forms.renameform.folderpath.value=folderpath; |
|
} |
|
if (container == 'page') { |
|
this.document.forms.renameform.pagepath.value=folderpath; |
|
this.document.forms.renameform.pagesymb.value=pagesymb; |
|
} |
this.document.forms.renameform.submit(); |
this.document.forms.renameform.submit(); |
} |
} |
} |
} |
|
|
function removeres(folderpath,index,oldtitle,skip_confirm) { |
function removeres(folderpath,index,oldtitle,container,pagesymb,skip_confirm) { |
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
this.document.forms.renameform.markcopy.value=-1; |
this.document.forms.renameform.markcopy.value=-1; |
this.document.forms.renameform.cmd.value='del_'+index; |
this.document.forms.renameform.cmd.value='del_'+index; |
this.document.forms.renameform.folderpath.value=folderpath; |
if (container == 'sequence') { |
|
this.document.forms.renameform.folderpath.value=folderpath; |
|
} |
|
if (container == 'page') { |
|
this.document.forms.renameform.pagepath.value=folderpath; |
|
this.document.forms.renameform.pagesymb.value=pagesymb; |
|
} |
this.document.forms.renameform.submit(); |
this.document.forms.renameform.submit(); |
} |
} |
} |
} |
|
|
function cutres(folderpath,index,oldtitle,container,folder,skip_confirm) { |
function cutres(folderpath,index,oldtitle,container,pagesymb,folder,skip_confirm) { |
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
this.document.forms.renameform.cmd.value='cut_'+index; |
this.document.forms.renameform.cmd.value='cut_'+index; |
this.document.forms.renameform.markcopy.value=index; |
this.document.forms.renameform.markcopy.value=index; |
this.document.forms.renameform.copyfolder.value=folder+'.'+container; |
this.document.forms.renameform.copyfolder.value=folder+'.'+container; |
this.document.forms.renameform.folderpath.value=folderpath; |
if (container == 'sequence') { |
|
this.document.forms.renameform.folderpath.value=folderpath; |
|
} |
|
if (container == 'page') { |
|
this.document.forms.renameform.pagepath.value=folderpath; |
|
this.document.forms.renameform.pagesymb.value=pagesymb; |
|
} |
this.document.forms.renameform.submit(); |
this.document.forms.renameform.submit(); |
} |
} |
} |
} |
|
|
function markcopy(folderpath,index,oldtitle,container,folder) { |
function markcopy(folderpath,index,oldtitle,container,pagesymb,folder) { |
this.document.forms.renameform.markcopy.value=index; |
this.document.forms.renameform.markcopy.value=index; |
this.document.forms.renameform.copyfolder.value=folder+'.'+container; |
this.document.forms.renameform.copyfolder.value=folder+'.'+container; |
|
if (container == 'sequence') { |
this.document.forms.renameform.folderpath.value=folderpath; |
this.document.forms.renameform.folderpath.value=folderpath; |
|
} |
|
if (container == 'page') { |
|
this.document.forms.renameform.pagepath.value=folderpath; |
|
this.document.forms.renameform.pagesymb.value=pagesymb; |
|
} |
this.document.forms.renameform.submit(); |
this.document.forms.renameform.submit(); |
} |
} |
|
|
Line 4592 function showPage(current, pageId, nav,
|
Line 4736 function showPage(current, pageId, nav,
|
toggleMap(); |
toggleMap(); |
if (nav == 'mainnav') { |
if (nav == 'mainnav') { |
var storedpath = "$docs_folderpath"; |
var storedpath = "$docs_folderpath"; |
|
if (storedpath == '') { |
|
storedpath = "$docs_pagepath"; |
|
} |
var storedpage = "$main_container_page"; |
var storedpage = "$main_container_page"; |
var reg = new RegExp("^supplemental"); |
var reg = new RegExp("^supplemental"); |
if (pageId == 'mainCourseDocuments') { |
if (pageId == 'mainCourseDocuments') { |