--- loncom/interface/londocs.pm 2009/06/09 18:42:42 1.371
+++ loncom/interface/londocs.pm 2009/09/02 16:24:28 1.385
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.371 2009/06/09 18:42:42 tempelho Exp $
+# $Id: londocs.pm,v 1.385 2009/09/02 16:24:28 bisitz 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 '
'.
@@ -262,8 +263,7 @@ sub dumpcourse {
sub exportbutton {
my $type = &Apache::loncommon::course_type();
- return ''.
+ return "".&mt('IMS Export')."".
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').' ';
}
@@ -277,8 +277,8 @@ sub exportcourse {
my $numdisc = keys(%discussiontime);
my $navmap = Apache::lonnavmaps::navmap->new();
if (!defined($navmap)) {
- $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package').
- '
IMS Export Failed
'.
+ $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package').
+ '
'.&mt('IMS Export Failed').'
'.
'
'.
&mt('Unable to retrieve information about course contents').
'
'.&mt('Return to Course Editor').'');
@@ -298,7 +298,17 @@ sub exportcourse {
my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');
my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');
if (@exportitems == 0 && @discussions == 0) {
- $outcome = ' As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export';
+ $outcome =
+ '
'
+ .&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.'
+ ,''
+ ,'')
+ .'
'
- .&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.').' ';
+ $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.')
+ .'
'
+ .&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.')
+ .'
'
+ .&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('
');
}
- if ($randompick>=0) {
- $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.').'
\n");
if ($allowed) {
&print_paste_buffer($r,$container);
}
@@ -1667,7 +1719,7 @@ sub process_file_upload {
return 'failed';
} else {
if ($parseaction eq 'parse') {
- my $total_embedded = keys(%{$allfiles});
+ my $total_embedded = scalar(keys(%{$allfiles}));
if ($total_embedded > 0) {
my $num = 0;
my $state = '
@@ -1759,7 +1811,7 @@ sub entryline {
$renametitle=~s/\\/\\\\/g;
$renametitle=~s/\"\;/\\\"/g;
$renametitle=~s/ /%20/g;
- my $line='
';
+ my $line=&Apache::loncommon::start_data_table_row();
my ($form_start,$form_end);
# Edit commands
my ($container, $type, $esc_path, $path, $symb);
@@ -1790,7 +1842,7 @@ sub entryline {
ne '')) {
$selectbox=
''.
- '
";
+ $line.=&Apache::loncommon::end_data_table_row();
return $line;
}
@@ -2502,18 +2552,18 @@ sub changewarning {
$message='Changes will become active for your current session after [_1], or the next time you log in.';
}
$r->print("\n\n".
-''."\n".
'
'."\n\n");
+$help{'Caching'}.''."\n\n");
}
@@ -2583,7 +2633,7 @@ sub handler {
&init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
&dumpcourse($r);
} elsif ($allowed && $env{'form.exportcourse'}) {
- &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');
+ &init_breadcrumbs('exportcourse','IMS Export');
&exportcourse($r);
} else {
# is this a standard course?
@@ -2652,6 +2702,26 @@ sub handler {
$allowed=0;
}
+# subroutine to list form elements
+sub create_list_elements {
+ my @formarr = @_;
+ my $list = '';
+ for my $button (@formarr){
+ for my $picture(keys %$button) {
+ #my $link = Apache::lonhtmlcommon::htmltag('a' ,$button->{$picture}, {href => "test"});
+ $list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'});
+ }
+ }
+ return $list;
+}
+
+# subroutine to create ul from list elements
+sub create_form_ul {
+ my $list = shift;
+ my $ul = Apache::lonhtmlcommon::htmltag('ul',$list, {class => 'LC_ListStyleNormal'});
+ return $ul;
+}
+
# get course data
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -2670,15 +2740,23 @@ sub handler {
}
# -------------------------------------------------------------------- Body tag
$script = '';
- my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
+ .'// '."\n"
+ .''."\n";
+
+ # Breadcrumbs
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb({
+ href=>"/adm/createuser",text=>"$type Documents"});
+
$r->print(&Apache::loncommon::start_page("$type Documents", $script,
- {'force_register' => $showdoc,
- 'bread_crumbs' => $brcrum}).
- &Apache::loncommon::help_open_menu('','',273,'RAT'));
+ {'force_register' => $showdoc,})
+ .&Apache::loncommon::help_open_menu('','',273,'RAT')
+ .&Apache::lonhtmlcommon::breadcrumbs(
+ 'Editing the Table of Contents for your '.$type,
+ 'Docs_Adding_Course_Doc')
+ );
my %allfiles = ();
my %codebase = ();
@@ -2773,7 +2851,6 @@ sub handler {
'uplm' => 'Upload a new main '.lc($type).' document',
'upls' => 'Upload a new supplemental '.lc($type).' document',
'impp' => 'Import a document',
- 'pubd' => 'Published Documents',
'copm' => 'All documents out of a published map into this folder',
'upld' => 'Upload Document',
'srch' => 'Search',
@@ -2796,7 +2873,8 @@ sub handler {
'grpo' => 'Group Portfolio',
'rost' => 'Course Roster',
'abou' => 'Personal Information Page for a User',
- 'imsf' => 'Import IMS package',
+ 'imsf' => 'IMS Import',
+ 'imsl' => 'Import IMS package',
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
@@ -2805,7 +2883,6 @@ sub handler {
'pm' => 'Published Map',
'sd' => 'Special Document',
'mo' => 'More Options',
- 'hao' => 'Hide all Options'
);
# -----------------------------------------------------------------------------
my $fileupload=(<
CHBO
+ my @fileuploada = (
+ { pic01 => "$lt{'upld'} $help{'Uploading_From_Harddrive'}" },
+ );
my $fileuploadform=(<
@@ -2835,28 +2915,23 @@ CHBO
$checkbox
-
-
-
-
- $help{'Uploading_From_Harddrive'}
-
+FUFORM
+ $fileuploadform .= create_form_ul(create_list_elements(@fileuploada));
+ $fileuploadform .= (<
FUFORM
my $simpleeditdefaultform=(<
- $lt{'pubd'}
- $uploadtag
-
-
-
-
- $help{'Importing_LON-CAPA_Resource'}
-
-
-
+SEDFFORM
+ my @simpleeditdefaultforma = (
+ { pic03 => "$uploadtag$lt{'srch'}" },
+ { pic04 => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" },
+ { pic05 => "$lt{'book'}" },
+ );
+ $simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
+ $simpleeditdefaultform .=(<
$lt{'copm'}
@@ -2873,10 +2948,7 @@ SEDFFORM
ERFORM
@@ -2916,30 +2988,37 @@ ERFORM
HIDDENFORM
}
# --------------------------------------------------------- Main tab structure
+
my $activeClass = 1;
my $active = '';
+
$r->print('