--- loncom/interface/londocs.pm 2010/12/05 16:40:11 1.411.2.7
+++ loncom/interface/londocs.pm 2010/03/18 16:33:44 1.423
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.411.2.7 2010/12/05 16:40:11 raeburn Exp $
+# $Id: londocs.pm,v 1.423 2010/03/18 16:33:44 onken Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -41,7 +41,6 @@ use Apache::lonratedt();
use Apache::lonxml;
use Apache::lonclonecourse;
use Apache::lonnavmaps;
-use Apache::londocsgci;
use HTML::Entities;
use GDBM_File;
use Apache::lonlocal;
@@ -121,14 +120,19 @@ sub dumpbutton {
my $crstype = &Apache::loncommon::course_type();
if ($home+$other==0) { return ''; }
if ($home) {
- my $link = "".&mt('Dump '.$crstype.' DOCS to Construction Space')." ";
- return $link.' '.
- &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').' ';
- } else {
- return '
'.
- &mt('Dump '.$crstype.
- ' DOCS to Construction Space: available on other servers').
- '
';
+ my $link =
+ "';
+ return
+ $link.' '
+ .&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs')
+ .' ';
+ } else {
+ return
+ &mt('Dump '.$crstype.' Documents to Construction Space: available on other servers');
}
}
@@ -143,9 +147,9 @@ sub clean {
sub dumpcourse {
my ($r) = @_;
my $crstype = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' DOCS to Construction Space').
+ $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Documents to Construction Space').
'');
+ '
');
}
}
@@ -264,7 +268,7 @@ sub dumpcourse {
sub exportbutton {
my $crstype = &Apache::loncommon::course_type();
- return "".&mt('IMS Export')." ".
+ return "".
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').' ';
}
@@ -342,20 +346,20 @@ sub exportcourse {
open(OUTPUT, "zip -r $imszip * 2> /dev/null |");
close(OUTPUT);
chdir $cwd;
+ $outcome .= ''
+ .&mt('[_1]Your IMS package[_2] is ready for download.'
+ ,'',' ')
+ .'
';
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,'
+ .' an IMS archive of your course at this time,'
.' because there was a problem creating a'
.' manifest file.')
.'
'
@@ -369,24 +373,26 @@ sub exportcourse {
$r->print($outcome);
$r->print(&Apache::loncommon::end_page());
} else {
- my $display;
- $display = '');
- $r->print(''.&mt('Done').'. ');
+ $r->print(''.&mt('Done').'
');
&untiehash();
}
@@ -2619,15 +2623,6 @@ sub handler {
return OK if $r->header_only;
my $crstype = &Apache::loncommon::course_type();
- my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
- if ($coursedom =~ /^\w+citest$/) {
- my $coursenum = $env{'course.'.$env{'request.course.id'}.'.num'};
- my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
- if ($allowed) {
- &concept_test_builder($r,$coursedom,$coursenum);
- return OK;
- }
- }
# --------------------------------------------- Initialize help topics for this
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents',
@@ -2667,7 +2662,7 @@ sub handler {
&init_breadcrumbs('versions','Check/Set Resource Versions');
&checkversions($r);
} elsif ($allowed && $env{'form.dumpcourse'}) {
- &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
+ &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' Documents to Construction Space');
&dumpcourse($r);
} elsif ($allowed && $env{'form.exportcourse'}) {
&init_breadcrumbs('exportcourse','IMS Export');
@@ -2908,13 +2903,13 @@ sub create_form_ul {
'upls' => 'Upload a new supplemental '.lc($crstype).' document',
'impp' => 'Import a document',
'copm' => 'All documents out of a published map into this folder',
- 'upld' => 'Upload Document',
+ 'upld' => 'Import Document',
'srch' => 'Search',
'impo' => 'Import',
'book' => 'Import Bookmarks',
'selm' => 'Select Map',
'load' => 'Load Map',
- 'reco' => 'Recover Deleted Resources',
+ 'reco' => 'Recover Deleted Documents',
'newf' => 'New Folder',
'newp' => 'New Composite Page',
'extr' => 'External Resource',
@@ -2982,9 +2977,9 @@ FUFORM
SEDFFORM
my @simpleeditdefaultforma = (
- { ' ' => "$uploadtag$lt{'srch'} " },
- { ' ' => "$lt{'impo'} $help{'Importing_LON-CAPA_Resource'}" },
- { ' ' => "$lt{'book'} " },
+ { ' ' => "$uploadtag" },
+ { ' ' => "$help{'Importing_LON-CAPA_Resource'}" },
+ { ' ' => "" },
);
$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
$simpleeditdefaultform .=(<
$uploadtag
- $lt{'extr'} $help{'Adding_External_Resource'}
+ $help{'Adding_External_Resource'}
ERFORM
@@ -3120,14 +3115,14 @@ HIDDENFORM
my $recoverform=(<
- $lt{'reco'}
+
RFORM
my $imspform=(<
- $lt{'imsf'}
+
IMSPFORM
@@ -3137,7 +3132,7 @@ IMSPFORM
$uploadtag
- $lt{'navc'}
+
$help{'Navigate_Content'}
NNFORM
@@ -3146,7 +3141,7 @@ NNFORM
$uploadtag
- $lt{'sipa'}
+
$help{'Simple Page'}
NSPFORM
@@ -3156,7 +3151,7 @@ NSPFORM
$uploadtag
- $lt{'sipr'}
+
$help{'Simple Problem'}
@@ -3167,7 +3162,7 @@ NSPROBFORM
$uploadtag
- $lt{'drbx'}
+
NDBFORM
@@ -3176,7 +3171,7 @@ NDBFORM
$uploadtag
- $lt{'scuf'}
+
$help{'Score_Upload_Form'}
NEXUFORM
@@ -3186,7 +3181,7 @@ NEXUFORM
$uploadtag
- $lt{'bull'}
+
$help{'Bulletin Board'}
NBFORM
@@ -3197,7 +3192,7 @@ NBFORM
$uploadtag
- $lt{'mypi'}
+
$help{'My Personal Information Page'}
NAMFORM
@@ -3207,7 +3202,7 @@ NAMFORM
$uploadtag
- $lt{'abou'}
+
NASOFORM
@@ -3218,7 +3213,7 @@ NASOFORM
$uploadtag
- $lt{'rost'}
+
$help{'Course Roster'}
NROSTFORM
@@ -3236,7 +3231,7 @@ my $newfolderb;
- $lt{'newp'}
+
$help{'Adding_Pages'}
NPFORM
@@ -3247,7 +3242,7 @@ NPFORM
- $lt{'newf'} $help{'Adding_Folders'}
+ $lt{'newf'} $help{'Adding_Folders'}
NFFORM
@@ -3257,7 +3252,7 @@ NFFORM
$uploadtag
- $lt{'syll'}
+
$help{'Syllabus'}
@@ -3269,47 +3264,52 @@ NSYLFORM
$uploadtag
- $lt{'grpo'}
+
$help{'Group Portfolio'}
NGFFORM
@specialdocumentsforma=(
- {' '=>$newpageform},
- {' '=>$newsylform},
- {' '=>$newgroupfileform},
+ {' '=>$newpageform},
+ {' '=>$newsylform},
+ {' '=>$newgroupfileform},
);
}
- push @specialdocumentsforma, ({' '=>$newnavform},
- {' '=>$newsmppageform},
- {' '=>$newsmpproblemform},
- {' '=>$newdropboxform},
- {' '=>$newexuploadform},
- {' '=>$newbulform},
- {' '=>$newaboutmeform},
- {' '=>$newaboutsomeoneform},
- {' '=>$newrosterform},);
+ push @specialdocumentsforma, ({' '=>$newnavform},
+ {' '=>$newsmppageform},
+ {' '=>$newsmpproblemform},
+ {' '=>$newdropboxform},
+ {' '=>$newexuploadform},
+ {' '=>$newbulform},
+ {' '=>$newaboutmeform},
+ {' '=>$newaboutsomeoneform},
+ {' '=>$newrosterform},);
$specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
if($env{'form.pagepath'}) {
@specialdocumentsforma=(
- {' '=>$newsmpproblemform},
- {' '=>$newexuploadform}
+ {' '=>$newsmpproblemform},
+ {' '=>$newexuploadform}
);
$specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
}
my @tools = (
- {' '=>$extresourcesform},
- {' '=>$imspform},
- {' '=>$recoverform},
+# {' '=>$extresourcesform},
+# {' '=>$imspform},
+ {' '=>$recoverform},
);
+my @importdoc = (
+ {' '=>$extresourcesform},
+ {' '=>$imspform},
+);
+$fileuploadform = create_form_ul(create_list_elements(@importdoc)) . ' ' . $fileuploadform;
my %orderhash = (
'00' => ['Newfolder',$newfolderform],
- 'aa' => ['Upload Document',$fileuploadform],
+ 'aa' => ['Import Documents',$fileuploadform],
'bb' => ['Published Resources',$simpleeditdefaultform],
'cc' => ['Special Documents',$specialdocumentsform],
'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
@@ -3380,7 +3380,7 @@ SUPDOCFORM
- $lt{'newf'}
+
$help{'Adding_Folders'}
SNFFORM
@@ -3391,7 +3391,7 @@ SNFFORM
- $lt{'extr'} $help{'Adding_External_Resource'}
+ $help{'Adding_External_Resource'}
SNEFORM
@@ -3401,7 +3401,7 @@ SNEFORM
- $lt{'syll'}
+
$help{'Syllabus'}
SNSFORM
@@ -3412,20 +3412,26 @@ SNSFORM
- $lt{'mypi'}
+
$help{'My Personal Information Page'}
SNAMFORM
my @specialdocs = (
- {' '=>$supnewextform},
- {' '=>$supnewsylform},
- {' '=>$supnewaboutmeform},
+ {' '
+ =>$supnewsylform},
+ {' '
+ =>$supnewaboutmeform},
);
+my @supimportdoc = (
+ {' '
+ =>$supnewextform},
+ );
+$supupdocform = create_form_ul(create_list_elements(@supimportdoc)) . ' ' . $supupdocform;
my %suporderhash = (
'00' => ['Supnewfolder', $supnewfolderform],
- 'ee' => ['Upload Document',$supupdocform],
+ 'ee' => ['Import Documents',$supupdocform],
'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))]
);
@@ -3476,22 +3482,29 @@ sub generate_admin_options {
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
'ls' => 'List Symbs',
- 'sl' => 'Show Log'
+ 'sl' => 'Show Log',
+ 'imse' => 'IMS Export',
+ 'dcd' => 'Dump Course Documents to Construction Space: available on other servers'
);
my %help = %{$help_ref};
my %env = %{$env_ref};
my $dumpbut=&dumpbutton();
my $exportbut=&exportbutton();
my @list = (
- {' '=>"$lt{'vc'} $help{'Verify_Content'}"},
- {' '=>"$lt{'cv'} $help{'Check_Resource_Versions'}"},
+ {' '
+ => "$help{'Verify_Content'}"},
+ {' '
+ =>"$help{'Check_Resource_Versions'}"},
);
if($dumpbut ne ''){
- push @list, {' '=>$dumpbut};
+ push @list, {' '=>$dumpbut};
}
- push @list, ({' '=>$exportbut},
- {' '=>"$lt{'ls'} "},
- {' '=>"$lt{'sl'} "},
+ push @list, ({' '
+ =>$exportbut},
+ {' '
+ =>" "},
+ {' '
+ =>""},
);
return ' '.create_form_ul(create_list_elements(@list)).' ';
@@ -3508,7 +3521,7 @@ sub generate_edit_table {
if($env{'form.active'} ne ''){
$activetab = $env{'form.active'};
}
- $form = '';
+ $form = '
';
$form .= '
';
foreach my $name (sort(keys(%orderhash))){
if($name ne '00'){
@@ -3517,7 +3530,7 @@ sub generate_edit_table {
}elsif($activetab eq $name){
$active = 'class="active"';
}
- $form .= ''.&mt(${$orderhash{$name}}[0]).' ';
+ $form .= ''.&mt(${$orderhash{$name}}[0]).' ';
} else {
$form .= ''.${$orderhash{$name}}[1].' ';
@@ -3527,14 +3540,14 @@ sub generate_edit_table {
$form .= '';
foreach my $field (keys(%orderhash)){
if($field ne '00'){
- if($activetab eq '' || $activetab ne $field){
+ if($activetab eq '' || $activetab ne $field){
$active = 'style="display: none;"';
- }elsif($activetab eq $field){
+ }elsif($activetab eq $field){
$active = 'style="display:block;"';
- }
- $form .= '
'.${$orderhash{$field}}[1]
- .'
';
+ }
+ $form .= '
'.${$orderhash{$field}}[1]
+ .'
';
}
}
$form .= '
';
@@ -3542,74 +3555,6 @@ sub generate_edit_table {
return $form;
}
-sub concept_test_builder {
- my ($r,$cdom,$cnum) = @_;
- &Apache::londocsgci::setdefaults($cdom);
- if ($env{'form.context'} eq 'requestcrs') {
- if ($env{'form.phase'} eq 'storemap') {
- &Apache::londocsgci::evaluate();
- my $error = &Apache::londocsgci::store('requestcrs',$cdom,$cnum);
- my $output = '
';
- if ($error) {
- $output .= ''.
- &mt('An error occurred saving your concept test: [_1].',$error).
- ' ';
- } else {
- &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
- $output .= &mt('Your concept test has been saved.');
- }
- $output .= '
';
- if (&Apache::lonrequestcourse::generate_page($r,'new','chooseitems')) {
- my $formname = 'requestcrs';
- $r->print('
');
- my $title = &mt('Concept Test Created');
- &Apache::lonrequestcourse::roster_upload_form($r,$output,$formname,$title);
- }
- $r->print(&Apache::loncommon::end_page());
- return;
- }
- }
- my $js = '
-
-';
- $r->print(&Apache::loncommon::start_page('Assemble Test',$js));
- &Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/coursedocs',
- text=>"Assemble Test"});
- if ($env{'form.phase'} eq 'storemap') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/coursedocs?phase=storemap',
- text=>"Validate Test"});
- &Apache::londocsgci::evaluate();
- $r->print(&Apache::lonhtmlcommon::breadcrumbs
- ('Build Concept Test','Concept_Test_Assembly'));
- $r->print(&Apache::londocsgci::store('edit',$cdom,$cnum));
- } elsif ($env{'form.phase'} eq 'storeparms') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/coursedocs?phase=storeparms',
- text=>"Set Availability"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs
- ('Build Concept Test','Concept_Test_Assembly'));
- $r->print(&Apache::londocsgci::store_dates_parms($cdom,$cnum));
- $r->print(&Apache::loncommon::end_page());
- return;
- } else {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs
- ('Build Concept Test','Concept_Test_Assembly'));
- }
- &Apache::londocsgci::load($cdom);
- &Apache::londocsgci::listresources($r,'edit',$cdom,$cnum);
- $r->print(&Apache::loncommon::end_page());
- return;
-}
-
sub editing_js {
my ($udom,$uname) = @_;
my $now = time();
@@ -3848,6 +3793,9 @@ function openTabs(pageId) {
if(currentLis[i].className == 'active') {
funcString = currentLis[i].onclick.toString();
tab = funcString.split('"');
+ if(tab.length < 2) {
+ tab = funcString.split("'");
+ }
currentData = document.getElementById(tab[1]);
currentData.style.display = 'block';
}