--- loncom/interface/londocs.pm 2007/06/15 19:12:56 1.277 +++ loncom/interface/londocs.pm 2007/06/29 21:08:07 1.280 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.277 2007/06/15 19:12:56 albertel Exp $ +# $Id: londocs.pm,v 1.280 2007/06/29 21:08:07 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1155,7 +1155,7 @@ sub docs_change_log { for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) { my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0]; my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0]; - if ($oldname ne $newname) { + if ($oldname ne '' && $oldname ne $newname) { $r->print(&LONCAPA::map::qtescape($newname)); } } @@ -1185,7 +1185,6 @@ sub docs_change_log { || $shown<=$env{'form.show'})) { last; } } $r->print(&Apache::loncommon::end_data_table()); - $r->print(&Apache::loncommon::end_page()); } sub editor { @@ -1446,13 +1445,14 @@ sub editor { $r->print('

'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'

'); } $r->print(''); - foreach (@LONCAPA::map::order) { - my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]); + foreach my $res (@LONCAPA::map::order) { + my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); $name=&LONCAPA::map::qtescape($name); $url=&LONCAPA::map::qtescape($url); unless ($name) { $name=(split(/\//,$url))[-1]; } unless ($name) { $idx++; next; } - $r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum)); + $r->print(&entryline($idx,$name,$url,$folder,$allowed,$res, + $coursenum)); $idx++; $shown++; } @@ -1466,11 +1466,19 @@ sub editor { ENDPASTE - $r->print( - ' '.&Apache::loncommon::filedescription( - (split(/\./,$env{'form.markedcopy_url'}))[-1]).': '. - $env{'form.markedcopy_title'}); + $r->print(' '); + + my $type; + if ($env{'form.markedcopy_url'} =~ m{^/adm/wrapper/ext}) { + $type = &mt('External Resource'); + $r->print($type.': '. $env{'form.markedcopy_title'}); + } else { + my $extension = (split(/\./,$env{'form.markedcopy_url'}))[-1]; + my $type = &Apache::loncommon::filedescription($extension); + my $icon = ''; + $r->print($icon.$type.': '. $env{'form.markedcopy_title'}); + } if ($container eq 'page') { $r->print(< @@ -1663,17 +1671,17 @@ sub entryline { my $line=''; # Edit commands my $container; - my $folderpath; + my ($container, $type, $esc_path, $path, $symb); if ($env{'form.folderpath'}) { + $type = 'folder'; $container = 'sequence'; - $folderpath=&escape($env{'form.folderpath'}); + $esc_path=&escape($path = $env{'form.folderpath'}); # $htmlfoldername=&HTML::Entities::encode($env{'form.foldername'},'<>&"'); } - my ($pagepath,$pagesymb); if ($env{'form.pagepath'}) { - $container = 'page'; - $pagepath=&escape($env{'form.pagepath'}); - $pagesymb=&escape($env{'form.pagesymb'}); + $type = $container = 'page'; + $esc_path=&escape($path = $env{'form.pagepath'}); + $symb=&escape($env{'form.pagesymb'}); } my $cpinfo=''; if ($env{'form.markedcopy_url'}) { @@ -1729,82 +1737,52 @@ sub entryline { } my $copylink=' '; my $cutlink=' '; - if ($env{'form.pagepath'}) { - if (!$nocopy) { - $copylink=(< -$lt{'cp'} + + if (!$nocopy) { + $copylink=(< +$lt{'cp'} ENDCOPY - } - if (!$nocut) { - $cutlink=(< -$lt{'ct'} -ENDCUT - } - $line.=(< - - - - - - - - -ENDCOPY - } - if (!$nocut) { - $cutlink=(< + } + if (!$nocut) { + $cutlink=(< $lt{'ct'} ENDCUT - } - $line.=(< - - - - - - - + + END - } + } # Figure out what kind of a resource this is my ($extension)=($url=~/\.(\w+)$/);
- - -
- -$lt{
- -$lt{
$selectbox - - -$lt{'rm'} -$cutlink - -$lt{'rn'} -$copylink -END - } else { - if (!$nocopy) { - $copylink=(< -$lt{'cp'} - - -
- -$lt{
- -$lt{
$selectbox - - -$lt{'rm'} + } + $line.=(< + + + + + + + + + + + + + + +
+ $lt{ +
+ $lt{ +
+
+ $selectbox + + $lt{'rm'} $cutlink - -$lt{'rn'} + $lt{'rn'} $copylink +