--- loncom/interface/londocs.pm 2009/10/17 00:09:26 1.394 +++ loncom/interface/londocs.pm 2009/10/18 15:32:36 1.395 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.394 2009/10/17 00:09:26 droeschl Exp $ +# $Id: londocs.pm,v 1.395 2009/10/18 15:32:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -998,7 +998,7 @@ sub group_import { } sub breadcrumbs { - my ($where,$allowed,$type)=@_; + my ($allowed,$type)=@_; &Apache::lonhtmlcommon::clear_breadcrumbs(); my (@folders); if ($env{'form.pagepath'}) { @@ -1013,6 +1013,15 @@ sub breadcrumbs { my $isencrypted=0; my $ishidden=0; my $is_random_order=0; + if (!$allowed) { + my $description = $env{'course.'.$env{'request.course.id'}.'.description'}; + &Apache::lonhtmlcommon::add_breadcrumb( + {'href' => '/adm/menu', + 'title'=> 'Go to main menu', + 'text' => $description, + }); + $plain .= $description.' >'; + } while (@folders) { my $folder=shift(@folders); my $foldername=shift(@folders); @@ -1503,9 +1512,14 @@ sub editor { $LONCAPA::map::resources[$idx]=''; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= - &breadcrumbs($folder,$allowed,$type); - $r->print($breadcrumbtrail); + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + if ($allowed) { + ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = + &breadcrumbs($allowed,$type); + $r->print($breadcrumbtrail); + } else { + $randompick = -1; + } # ------------------------------------------------------------ Process commands @@ -2756,12 +2770,14 @@ sub create_form_ul { 'Docs_Adding_Course_Doc') ); } else { - my $lc_type = lc($type); - &Apache::lonhtmlcommon::add_breadcrumb({ - href=>"/adm/coursedocs",text=>"Supplemental $lc_type documents"}); - + my $folder=$env{'form.folder'}; + if ($folder eq '' || $folder eq 'supplemental') { + $env{'form.folderpath'} = 'supplemental&'. + &escape(&mt('Supplemental '.$type.' Documents')); + } + my ($breadcrumbtrail) = &breadcrumbs($allowed,$type); $r->print(&Apache::loncommon::start_page("Supplemental documents"). - &Apache::lonhtmlcommon::breadcrumbs()); + $breadcrumbtrail); } my %allfiles = (); @@ -2994,33 +3010,35 @@ ERFORM HIDDENFORM } # --------------------------------------------------------- Main tab structure - + my $activeClass = 1; my $active = ''; - $r->print('' - .'
' + $r->print('
' .'
'); # --------------------------------------------------------- Standard documents my $savefolderpath; - my $active = 'style="display: none;"'; + $active = 'style="display: none;"'; if($activeClass == 0){ $active = 'style="display: block;"'; } @@ -3272,7 +3290,7 @@ $r->print('
'); if ($env{'form.pagepath'}) { } # ----------------------------------------------------- Supplemental documents - my $active = 'style="display: none;"'; + $active = 'style="display: none;"'; if($activeClass == 1){ $active = 'style="display: block;"'; }