--- loncom/interface/londocs.pm 2025/01/07 03:51:55 1.720 +++ loncom/interface/londocs.pm 2025/02/03 22:52:36 1.723 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.720 2025/01/07 03:51:55 raeburn Exp $ +# $Id: londocs.pm,v 1.723 2025/02/03 22:52:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1177,9 +1177,9 @@ ENDJS $r->print('

'.&mt('Copied the following files to [_1]:',''.$desturl.'/'.$subdir.''). '

'."\n". '

'."\n"); - foreach my $key (keys(%newfile)) { - my %storehash = ( - 'priv' => $newfile{$key}, + foreach my $file (keys(%newfile)) { + my %storehash = ( + 'priv' => $newfile{$file}, 'who' => $env{'user.name'}.':'.$env{'user.domain'}, ); if (exists($newresfile{$file})) { @@ -1277,7 +1277,32 @@ ENDJS &mt('Choose the files and/or folders to copy from Course Authoring to User Authoring'). '

'."\n"; my $count = 0; - my $startcount = 4 + $home; +# +# Warning to developers: +# +# If you add or remove form elements which precede the table of items to copy +# you will need to modify the value for startcount. Form elements include both: +# and
tags. +# $startcount (set to 9) contains the following: +# fieldsets with following legends: (a) Folder in Authoring Space, (b) Distribution to set in metadata +# (c) Content to copy +# inputs: textbox for destination folder; dropdown lists: (a) Copyright, (b) Source +# hidden: customrights file; buttons: (a) check all, (b) uncheck all. +# authorspace: if more than 1: a fieldset with legend: Select the Authoring Space, +# or if 1: an input (hidden) with available author/coauthor role. +# if there are multiple possible author/coauthor roles (i.e., $home > 1), +# incerement startcount by 1 for the dropdown list uses to select the target. +# +# If there are published files, increment startcount by 3: +# fieldset (legend: Published Resources), and two radio buttons (Yes/No). +# + my $startcount = 9; + if ($home > 1) { + $startcount ++; + } + if ($numpub) { + $startcount += 3; + } my $lastcontainer = $startcount; $display .= &Apache::loncommon::start_data_table()."\n". &Apache::loncommon::start_data_table_header_row(). @@ -2501,6 +2526,15 @@ sub print_paste_buffer { &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix}); } else { my $icon = &Apache::loncommon::icon($extension); + my $icontext; + if ($extension eq 'sequence') { + $icontext = &mt('folder icon'); + } elsif ($extension eq 'page') { + $icontext = &mt('composite page icon'); + } else { + $icontext = &mt('file icon'); + } + $icontext = &HTML::Entities::encode($icontext); if ($extension eq 'sequence' && $url =~ m{/default_\d+\.sequence$}x) { $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); @@ -2510,7 +2544,7 @@ sub print_paste_buffer { if ($title eq '') { ($title) = ($url =~ m{/([^/]+)$}); } - $buffer = ''. + $buffer = ''.$icontext.''. ': '. &Apache::loncommon::parse_supplemental_title( &LONCAPA::map::qtescape($title)); @@ -4946,16 +4980,18 @@ sub editor { if (!$allowed) { $helpitem = 'Supplemental_Navigation'; } - $toolslink = '' - .'
' + $toolslink = '
' + .'
' .&Apache::loncommon::help_open_menu('Navigation Screen', $helpitem,undef,'RAT') - .'
'.&mt('Tools:').'
    ' + .'
    '.&mt('Tools:').'
    ' + .'
    '."\n".'

'; + .''."\n" + .'

'."\n"; } if ($shown) { if ($allowed) { @@ -5458,7 +5494,7 @@ ENDCOPY $copylink=(< $form_common -$lt{'cp'} + $form_end ENDCOPY if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { @@ -5476,7 +5512,7 @@ ENDCUT
$form_common -$lt{'ct'} + $form_end ENDCUT if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { @@ -5495,7 +5531,7 @@ ENDREM $form_common -$lt{'rm'} + $form_end ENDREM if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { @@ -5540,8 +5576,17 @@ $copylink END } + my $icontext; # Figure out what kind of a resource this is my ($extension)=($url=~/\.(\w+)$/); + if ($extension eq 'sequence') { + $icontext = &mt('folder icon'); + } elsif ($extension eq 'page') { + $icontext = &mt('composite page icon'); + } else { + $icontext = &mt('file icon'); + } + $icontext = &HTML::Entities::encode($icontext); my $uploaded=($url=~/^\/*uploaded\//); my $icon=&Apache::loncommon::icon($url); my $isfolder; @@ -5883,9 +5928,9 @@ $form_end; } } if ($nolink) { - $line .= ''; + $line .= ''.$icontext.''; } else { - $line.=''; + $line.=''.$icontext.''; } } elsif ($url) { if ($anchor ne '') { @@ -5915,16 +5960,16 @@ $form_end; } } if ($nolink) { - $line.=''; + $line.=''.$icontext.''; } elsif ($nomodal) { $line.=''. - ''; + ''.$icontext.''; } else { $line.=&Apache::loncommon::modal_link($link, - '',600,500); + ''.$icontext.'',600,500); } } else { - $line.=''; + $line.=''.$icontext.''; } $line.=''; if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { @@ -7566,10 +7611,6 @@ sub handler { my $quotainfo = '

'.&mt('Currently using [_1] of the [_2] available.', $percent.'%',$quota.' MB').'

'; - my $fileupload=(< -FIUP my $checkbox=(<$lt{'parse'}? @@ -7588,8 +7629,9 @@ CHBO