--- loncom/interface/londocs.pm 2009/10/16 19:00:44 1.393 +++ loncom/interface/londocs.pm 2009/10/20 20:43:54 1.400 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.393 2009/10/16 19:00:44 raeburn Exp $ +# $Id: londocs.pm,v 1.400 2009/10/20 20:43:54 droeschl 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 @@ -2047,7 +2061,7 @@ END $url.='pagepath='.&escape($pagepath). '&pagesymb='.&escape($symb).$cpinfo; } - if ($external) { + if (($external) && ($allowed)) { my $form = ($folder =~ /^default/)? 'newext' : 'supnewext'; $external = ' '.&mt('Edit').''; } else { @@ -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 = (); @@ -2905,9 +2921,7 @@ FIUP CHBO - my @fileuploada = ( - { 'pic01' => " $help{'Uploading_From_Harddrive'}" }, - ); + my $fileuploada = " $help{'Uploading_From_Harddrive'}"; my $fileuploadform=(< @@ -2922,7 +2936,9 @@ CHBO $checkbox FUFORM - $fileuploadform .= create_form_ul(create_list_elements(@fileuploada)); + #$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); + #$fileuploadform .= create_form_ul(create_list_elements(@fileuploada)); + $fileuploadform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'})); $fileuploadform .= (< FUFORM @@ -2932,9 +2948,9 @@ FUFORM SEDFFORM my @simpleeditdefaultforma = ( - { 'pic03' => "$uploadtag$lt{'srch'}" }, - { 'pic04' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, - { 'pic05' => "$lt{'book'}" }, + { 'pic03' => "$uploadtag$lt{'srch'}" }, + { 'pic04' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, + { 'pic05' => "$lt{'book'}" }, ); $simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma)); $simpleeditdefaultform .=(<print('' - .'
' + $r->print('
' .'
'); # --------------------------------------------------------- Standard documents my $savefolderpath; - my $active = 'style="display: none;"'; + $active = 'style="display: none;"'; if($activeClass == 0){ $active = 'style="display: block;"'; } @@ -3213,37 +3231,37 @@ NSYLFORM NGFFORM @specialdocumentsforma=( - {'pic06'=>$newpageform}, - {'pic07'=>$newsylform}, - {'pic08'=>$newgroupfileform}, + {'pic06'=>$newpageform}, + {'pic07'=>$newsylform}, + {'pic08'=>$newgroupfileform}, ); } - push @specialdocumentsforma, ({'pic09'=>$newnavform}, - {'pic10'=>$newsmppageform}, - {'pic11'=>$newsmpproblemform}, - {'pic12'=>$newdropboxform}, - {'pic13'=>$newexuploadform}, - {'pic14'=>$newbulform}, - {'pic15'=>$newaboutmeform}, - {'pic16'=>$newaboutsomeoneform}, - {'pic17'=>$newrosterform},); + push @specialdocumentsforma, ({'pic09'=>$newnavform}, + {'pic10'=>$newsmppageform}, + {'pic11'=>$newsmpproblemform}, + {'pic12'=>$newdropboxform}, + {'pic13'=>$newexuploadform}, + {'pic14'=>$newbulform}, + {'pic15'=>$newaboutmeform}, + {'pic16'=>$newaboutsomeoneform}, + {'pic17'=>$newrosterform},); $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma)); if($env{'form.pagepath'}) { @specialdocumentsforma=( - {'pic32'=>$newsmpproblemform}, - {'pic33'=>$newexuploadform} + {'pic32'=>$newsmpproblemform}, + {'pic33'=>$newexuploadform} ); $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma)); } my @tools = ( - {'pic18'=>$extresourcesform}, - {'pic19'=>$imspform}, - {'pic20'=>$recoverform}, + {'pic18'=>$extresourcesform}, + {'pic19'=>$imspform}, + {'pic20'=>$recoverform}, ); my %orderhash = ( @@ -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;"'; } @@ -3296,9 +3314,7 @@ $r->print('
'); my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); - my @supupdocform = ( - {'pic27'=>"$help{'Uploading_From_Harddrive'}"}, - ); + my $supupdocformbtn = "$help{'Uploading_From_Harddrive'}"; my $supupdocform=(< @@ -3315,7 +3331,7 @@ $r->print('
'); SUPDOCFORM - $supupdocform .= create_form_ul(create_list_elements(@supupdocform)).""; + $supupdocform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'})).""; my $supnewfolderform=(< @@ -3361,9 +3377,9 @@ SNAMFORM my @specialdocs = ( - {'pic29'=>$supnewextform}, - {'pic30'=>$supnewsylform}, - {'pic31'=>$supnewaboutmeform}, + {'pic29'=>$supnewextform}, + {'pic30'=>$supnewsylform}, + {'pic31'=>$supnewaboutmeform}, ); my %suporderhash = ( '00' => ['Supnewfolder', $supnewfolderform], @@ -3426,15 +3442,15 @@ sub generate_admin_options { my $dumpbut=&dumpbutton(); my $exportbut=&exportbutton(); my @list = ( - {'pic21'=>"$lt{'vc'}$help{'Verify_Content'}"}, - {'pic22'=>"$lt{'cv'}$help{'Check_Resource_Versions'}"}, + {'pic21'=>"$lt{'vc'}$help{'Verify_Content'}"}, + {'pic22'=>"$lt{'cv'}$help{'Check_Resource_Versions'}"}, ); if($dumpbut ne ''){ - push @list, {'pic23'=>$dumpbut}; + push @list, {'pic23'=>$dumpbut}; } - push @list, ({'pic24'=>$exportbut}, - {'pic25'=>"$lt{'ls'}"}, - {'pic26'=>"$lt{'sl'}"}, + push @list, ({'pic24'=>$exportbut}, + {'pic25'=>"$lt{'ls'}"}, + {'pic26'=>"$lt{'sl'}"}, ); return '
'.create_form_ul(create_list_elements(@list)).'
'; @@ -3466,7 +3482,7 @@ sub generate_edit_table { } } $form .= ''; - $form .= '
'; + $form .= '
'; foreach my $field (keys(%orderhash)){ if($field ne '00'){ if($activetab eq '' || $activetab ne $field){