[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 16 Jun 2007 17:42:24 -0000
albertel Sat Jun 16 13:42:24 2007 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- adding icon to paste buffer
- don't try to find the filetype of an external resource
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.277 loncom/interface/londocs.pm:1.278
--- loncom/interface/londocs.pm:1.277 Fri Jun 15 15:12:56 2007
+++ loncom/interface/londocs.pm Sat Jun 16 13:42:24 2007
@@ -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.278 2007/06/16 17:42:24 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1446,13 +1446,14 @@
$r->print('<p>'.&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.').'</p>');
}
$r->print('<table>');
- 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 +1467,19 @@
<input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
<input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
ENDPASTE
- $r->print(
- '<input type="submit" name="pastemarked" value="'.&mt('Paste').
- '" /> '.&Apache::loncommon::filedescription(
- (split(/\./,$env{'form.markedcopy_url'}))[-1]).': '.
- $env{'form.markedcopy_title'});
+ $r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ');
+
+ 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 = '<img src="'.&Apache::loncommon::icon($extension).
+ '" class="LC_icon" />';
+ $r->print($icon.$type.': '. $env{'form.markedcopy_title'});
+ }
if ($container eq 'page') {
$r->print(<<PAGEINFO);
<input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />