--- loncom/interface/londocs.pm 2009/10/16 18:50:18 1.392 +++ loncom/interface/londocs.pm 2009/10/16 19:00:44 1.393 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.392 2009/10/16 18:50:18 raeburn Exp $ +# $Id: londocs.pm,v 1.393 2009/10/16 19:00:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1032,11 +1032,7 @@ sub breadcrumbs { if ($3) { $isencrypted=1; } if ($4 ne '') { $is_random_order = 1; } if ($folder eq 'supplemental') { - if ($allowed) { - $name = &mt('Supplemental '.$type.' Documents'); - } else { - $name = &mt($type.' Documents'); - } + $name = &mt('Supplemental '.$type.' Documents'); } &Apache::lonhtmlcommon::add_breadcrumb( {'href'=>$url.$cpinfo, @@ -1493,7 +1489,6 @@ sub handle_edit_cmd { sub editor { my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; - my $container= ($env{'form.pagepath'}) ? 'page' : 'sequence'; @@ -1632,18 +1627,21 @@ sub editor { $shown++; } if ($shown) { - $r->print(&Apache::loncommon::start_data_table() - .&Apache::loncommon::start_data_table_header_row() - .''.&mt('Move').'' - .''.&mt('Actions').'' - .''.&mt('Document').'' - .''.&mt('Settings').'' - .&Apache::loncommon::end_data_table_header_row() - .$output - .&Apache::loncommon::end_data_table() - ) - } - unless($shown) { + $r->print(&Apache::loncommon::start_data_table()); + if ($allowed) { + $r->print(&Apache::loncommon::start_data_table_header_row() + .''.&mt('Move').'' + .''.&mt('Actions').'' + .''.&mt('Document').''); + if ($folder !~ /^supplemental/) { + $->print(''.&mt('Settings').''); + } + $r->print(&Apache::loncommon::end_data_table_header_row()); + } + $r->print($output + .&Apache::loncommon::end_data_table() + ); + } else { $r->print('

' .&mt('Currently no documents.') .'

' @@ -1793,7 +1791,6 @@ sub parse_supplemental_title { sub entryline { my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_; - my ($foldertitle,$pagetitle,$renametitle); if (&is_supplemental_title($title)) { ($title,$foldertitle,$renametitle) = &parse_supplemental_title($title); @@ -3008,8 +3005,8 @@ HIDDENFORM $activeClass = 0; } } - if($env{'request.role'}=~/^cc/){ - $r->print('
  • '.&mt('Main Course Documents').'
  • '); + if ($allowed){ + $r->print('
  • '.&mt('Main Course Documents').'
  • '); } $active = ''; if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) { @@ -3027,7 +3024,7 @@ HIDDENFORM if($activeClass == 0){ $active = 'style="display: block;"'; } - if($env{'request.role'}=~/^cc/){ + if ($allowed) { $r->print('
    '); my $folder=$env{'form.folder'}; if ($folder eq '' || $folder=~/^supplemental/) { @@ -3288,7 +3285,7 @@ $r->print('
    '); (($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { $env{'form.folderpath'} = 'supplemental&'. &escape(&mt('Supplemental '.$type.' Documents')); - }else{ + } elsif ($allowed) { $env{'form.folderpath'} = $savefolderpath; } $env{'form.pagepath'} = ''; @@ -3374,14 +3371,19 @@ my %suporderhash = ( 'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))] ); -my $tid='2'; -my $varscd = 'Supplemental Course Documents'; -my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); - if ($error) { - $r->print('

    '.$error.'

    '); + my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); + if ($error) { + $r->print('

    '.$error.'

    '); } -$r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); -} + my $tid='2'; + my $varscd = 'Supplemental Course Documents'; + $r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); + } else { + my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); + if ($error) { + $r->print('

    '.$error.'

    '); + } + } $r->print('');