--- loncom/interface/londocs.pm 2007/07/19 00:08:04 1.293.2.1
+++ loncom/interface/londocs.pm 2008/09/04 17:07:28 1.309
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.293.2.1 2007/07/19 00:08:04 albertel Exp $
+# $Id: londocs.pm,v 1.309 2008/09/04 17:07:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -818,7 +818,7 @@ sub extract_media {
$dirpath = $url;
$container = '';
}
- &Apache::lonnet::extract_embedded_items(undef,undef,\%allfiles,\%codebase,$content);
+ &Apache::lonnet::extract_embedded_items(undef,\%allfiles,\%codebase,$content);
foreach my $embed_file (keys(%allfiles)) {
my $filename;
if ($embed_file =~ m#([^/]+)$#) {
@@ -949,7 +949,7 @@ sub group_import {
}
sub breadcrumbs {
- my ($where)=@_;
+ my ($where,$allowed,$type)=@_;
&Apache::lonhtmlcommon::clear_breadcrumbs();
my (@folders);
if ($env{'form.pagepath'}) {
@@ -966,7 +966,7 @@ sub breadcrumbs {
my $is_random_order=0;
while (@folders) {
my $folder=shift(@folders);
- my $foldername=shift(@folders);
+ my $foldername=shift(@folders);
if ($folderpath) {$folderpath.='&';}
$folderpath.=$folder.'&'.$foldername;
my $url='/adm/coursedocs?folderpath='.
@@ -982,6 +982,13 @@ sub breadcrumbs {
if ($2) { $ishidden=1; }
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');
+ }
+ }
&Apache::lonhtmlcommon::add_breadcrumb(
{'href'=>$url.$cpinfo,
'title'=>$name,
@@ -1205,8 +1212,8 @@ sub update_paste_buffer {
}
$url=~s{http(:|:)//https(:|:)//}{https$2//};
- &Apache::lonnet::appenv('docs.markedcopy_title' => $title,
- 'docs.markedcopy_url' => $url);
+ &Apache::lonnet::appenv({'docs.markedcopy_title' => $title,
+ 'docs.markedcopy_url' => $url});
delete($env{'form.markcopy'});
}
@@ -1227,9 +1234,13 @@ ENDPASTE
&LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')');
} else {
my $extension = (split(/\./,$env{'docs.markedcopy_url'}))[-1];
- my $type = &Apache::loncommon::filedescription($extension);
- my $icon = '';
+ my $icon = &Apache::loncommon::icon($extension);
+ if ($extension eq 'sequence' &&
+ $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
+ $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
+ $icon .= '/folder_closed.gif';
+ }
+ $icon = '
';
$r->print($icon.$type.': '. &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})));
}
if ($container eq 'page') {
@@ -1366,7 +1377,7 @@ sub handle_edit_cmd {
}
sub editor {
- my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$which)=@_;
+ my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_;
my $container= ($env{'form.pagepath'}) ? 'page'
: 'sequence';
@@ -1383,7 +1394,7 @@ sub editor {
}
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)=
- &breadcrumbs($folder);
+ &breadcrumbs($folder,$allowed,$type);
$r->print($breadcrumbtrail);
# ------------------------------------------------------------ Process commands
@@ -1467,7 +1478,7 @@ 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.').'
'); } if ($is_random_order) { - $r->print(''.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown. Do not modify the contents of this folder if it is in active student use.').'
'); + $r->print(''.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'
'); } $r->print(''.&mt('Currently no documents.').' |
'.$error.'
'); } @@ -2803,7 +2788,7 @@ $uploadtag