--- loncom/interface/londocs.pm 2013/03/17 17:21:34 1.484.2.26 +++ loncom/interface/londocs.pm 2012/11/14 02:49:19 1.508 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.26 2013/03/17 17:21:34 raeburn Exp $ +# $Id: londocs.pm,v 1.508 2012/11/14 02:49:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ use Apache::lonxml; use Apache::lonclonecourse; use Apache::lonnavmaps; use Apache::lonnavdisplay(); -use Apache::lonextresedit(); +use Apache::lonuserstate(); use HTML::Entities; use HTML::TokeParser; use GDBM_File; @@ -152,7 +152,7 @@ sub dumpcourse { $r->print(&endContentScreen()); return ''; } - my ($ca,$cd)=split(/\:/,$env{'form.authorspace'}); + my ($ca,$cd)=split(/\@/,$env{'form.authorspace'}); $r->print('
'."\n". - &mt('The following files are either dependencies of a web page or references within a folder and/or composite page for which errors occurred during import:')."\n". - '
'.
- join('
',@{$msgsarray}).
- '
'. - $lockerror. - '
'; - } - } - my ($errtext,$fatal) = - &storemap($coursenum, $coursedom, $folder.'.'.$container,1); - return ($errtext,$fatal,$fixuperrors); + return &storemap($coursenum, $coursedom, $folder.'.'.$container,1); +} + +sub breadcrumbs { + my ($allowed,$crstype)=@_; + &Apache::lonhtmlcommon::clear_breadcrumbs(); + my (@folders); + if ($env{'form.pagepath'}) { + @folders = split('&',$env{'form.pagepath'}); + } else { + @folders=split('&',$env{'form.folderpath'}); + } + my $folderpath; + my $plain=''; + my $randompick=-1; + my $isencrypted=0; + my $ishidden=0; + my $is_random_order=0; + while (@folders) { + my $folder=shift(@folders); + my $foldername=shift(@folders); + if ($folderpath) {$folderpath.='&';} + $folderpath.=$folder.'&'.$foldername; + my $url; + if ($allowed) { + $url = '/adm/coursedocs?folderpath='; + } else { + $url = '/adm/supplemental?folderpath='; + } + $url .= &escape($folderpath); + my $name=&unescape($foldername); +# randompick number, hidden, encrypted, random order, is appended with ":"s to the foldername + $name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//; + if ($1 ne '') { + $randompick=$1; + } else { + $randompick=-1; + } + if ($2) { $ishidden=1; } + if ($3) { $isencrypted=1; } + if ($4 ne '') { $is_random_order = 1; } + if ($folder eq 'supplemental') { + $name = &mt('Supplemental '.$crstype.' Content'); + } + &Apache::lonhtmlcommon::add_breadcrumb( + {'href'=>$url, + 'title'=>$name, + 'text'=>$name, + 'no_mt'=>1, + }); + $plain.=$name.' > '; + } + $plain=~s/\>\;\s*$//; + return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', + undef, undef, 1 ),$randompick,$ishidden, + $isencrypted,$plain,$is_random_order); } sub log_docs { @@ -443,15 +445,18 @@ sub docs_change_log { my %orderhash; my $container='sequence'; my $pathitem; - if ($env{'form.folderpath'} =~ /\:1$/) { + if ($env{'form.pagepath'}) { $container='page'; + $pathitem = ''; + } else { + my $folderpath=$env{'form.folderpath'}; + if ($folderpath eq '') { + $folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents')); + } + $pathitem = ''; } - my $folderpath=$env{'form.folderpath'}; - if ($folderpath eq '') { - $folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents').':::::'); - } - $pathitem = ''; my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; my $jumpto = $readfile; $jumpto =~ s{^/}{}; @@ -459,8 +464,7 @@ sub docs_change_log { if ($supplementalflag) { $tid = 2; } - my ($breadcrumbtrail) = - &Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); + my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype); $r->print($breadcrumbtrail. &generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto, $readfile)); @@ -703,7 +707,7 @@ sub print_paste_buffer { $is_external = 1; } - my ($canpaste,$nopaste,$othercrs,$areachange); + my ($canpaste,$nopaste,$othercrs,$areachange,$is_uploaded_map); if ($folder =~ /^supplemental/) { $canpaste = &supp_pasteable($env{'docs.markedcopy_url'}); unless ($canpaste) { @@ -748,7 +752,7 @@ sub print_paste_buffer { $buffer = $type.': '. &LONCAPA::map::qtescape($env{'docs.markedcopy_title'}).' ('. &LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')'; - } else { + } else { my $icon = &Apache::loncommon::icon($extension); if ($extension eq 'sequence' && $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) { @@ -760,36 +764,19 @@ sub print_paste_buffer { } if ($canpaste) { $r->print('