--- loncom/interface/londocs.pm 2009/06/17 17:15:00 1.372
+++ loncom/interface/londocs.pm 2009/10/20 20:23:23 1.399
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.372 2009/06/17 17:15:00 bisitz Exp $
+# $Id: londocs.pm,v 1.399 2009/10/20 20:23:23 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,6 +35,7 @@ use Apache::Constants qw(:common :http);
use Apache::imsexport;
use Apache::lonnet;
use Apache::loncommon;
+use Apache::lonhtmlcommon;
use LONCAPA::map();
use Apache::lonratedt();
use Apache::lonxml;
@@ -119,8 +120,8 @@ sub dumpbutton {
my $type = &Apache::loncommon::course_type();
if ($home+$other==0) { return ''; }
if ($home) {
- return ''.
+ my $link = "".&mt('Dump '.$type.' DOCS to Construction Space')."";
+ return $link.' '.
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').'
';
} else {
return '
' + .&mt('As you did not select any content items or discussions' + .' for export, an IMS package has not been created.') + .'
' + .'' + .&mt('Please [_1]go back[_2] to select either content items' + .' or discussions for export.' + ,'' + ,'') + .'
'; } else { my $now = time; my %symbs; @@ -321,22 +331,30 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= '' - .&mt('Download the zip file from [_1]IMS '.lc($type).' archive[_2]' - ,'','') - .'
'; if ($copyresult) { $outcome .= '' .&mt('The following errors occurred during export - [_1]' ,$copyresult) .'
'; } + $outcome .= '' + .&mt('[_1]Your IMS package[_2] is ready for download.' + ,'','') + .'
'; } else { - $outcome = '' + .&mt('Unfortunately you will not be able to retrieve' + .' an IMS archive of this posts at this time,' + .' because there was a problem creating a' + .' manifest file.') + .'
' + .''; } } - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { @@ -489,13 +507,13 @@ function containerCheck(item) { // ]]> |; - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package', $scripttag)); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($display. ''. '
'); + &mt('Export').'" />'); } } @@ -980,7 +998,7 @@ sub group_import { } sub breadcrumbs { - my ($where,$allowed,$type)=@_; + my ($allowed,$type)=@_; &Apache::lonhtmlcommon::clear_breadcrumbs(); my (@folders); if ($env{'form.pagepath'}) { @@ -995,6 +1013,15 @@ sub breadcrumbs { my $isencrypted=0; my $ishidden=0; my $is_random_order=0; + if (!$allowed) { + my $description = $env{'course.'.$env{'request.course.id'}.'.description'}; + &Apache::lonhtmlcommon::add_breadcrumb( + {'href' => '/adm/menu', + 'title'=> 'Go to main menu', + 'text' => $description, + }); + $plain .= $description.' >'; + } while (@folders) { my $folder=shift(@folders); my $foldername=shift(@folders); @@ -1014,11 +1041,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, @@ -1030,7 +1053,7 @@ sub breadcrumbs { } $plain=~s/\>\;\s*$//; return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); } sub log_docs { @@ -1254,10 +1277,11 @@ sub print_paste_buffer { my ($r,$container) = @_; return if (!defined($env{'docs.markedcopy_url'})); - $r->print(<-ENDPASTE - $r->print(' '); + $r->print('
'); } sub do_paste_from_buffer { @@ -1474,7 +1498,6 @@ sub handle_edit_cmd { sub editor { my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; - my $container= ($env{'form.pagepath'}) ? 'page' : 'sequence'; @@ -1489,9 +1512,14 @@ sub editor { $LONCAPA::map::resources[$idx]=''; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= - &breadcrumbs($folder,$allowed,$type); - $r->print($breadcrumbtrail); + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + if ($allowed) { + ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = + &breadcrumbs($allowed,$type); + $r->print($breadcrumbtrail); + } else { + $randompick = -1; + } # ------------------------------------------------------------ Process commands @@ -1569,34 +1597,70 @@ sub editor { my $idx=0; my $shown=0; if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { - $r->print(''.&mt('Parameters').':
'.&mt('Parameters:'). + '
' + .&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.') + .'
' + ); + } + $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.').'
'); - } - $r->print(''.&mt('Currently no documents.').' | '.&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('
---|