'.
+ $r->print(''.
&mt('[quant,_1,error]',$errorcount).' ');
}
if ($warningcount) {
@@ -2174,7 +2118,7 @@ sub checkonthis {
unless ($url=~/\$/) {
$r->print(''.&mt('not found').' ');
} else {
- $r->print(''.&mt('unable to verify variable URL').' ');
+ $r->print(''.&mt('unable to verify variable URL').' ');
}
} else {
$r->print(''.&mt('access denied').' ');
@@ -2196,7 +2140,7 @@ List Symbs
sub list_symbs {
my ($r) = @_;
- my $crstype = &Apache::loncommon::course_type();
+ my $type = &Apache::loncommon::course_type();
$r->print(&Apache::loncommon::start_page('Symb List'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List'));
my $navmap = Apache::lonnavmaps::navmap->new();
@@ -2205,7 +2149,7 @@ sub list_symbs {
''.
&mt('Unable to retrieve information about course contents').
'
');
- &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
+ &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($type).':'.$env{'request.course.id'});
} else {
$r->print("\n");
foreach my $res ($navmap->retrieveResources()) {
@@ -2219,11 +2163,11 @@ sub list_symbs {
sub verifycontent {
my ($r) = @_;
- my $crstype = &Apache::loncommon::course_type();
+ my $type = &Apache::loncommon::course_type();
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
- $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
+ $r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$type.' Documents'));
$hashtied=0;
undef %alreadyseen;
%alreadyseen=();
@@ -2232,7 +2176,7 @@ sub verifycontent {
if ($hash{$key}=~/\.(page|sequence)$/) {
if (($key=~/^src_/) && ($alreadyseen{&unescape($hash{$key})})) {
$r->print(''.
- &mt('The following sequence or page is included more than once in your '.$crstype.': ').
+ &mt('The following sequence or page is included more than once in your '.$type.': ').
&unescape($hash{$key}).' '.
&mt('Note that grading records for problems included in this sequence or folder will overlap. '));
}
@@ -2255,9 +2199,9 @@ sub devalidateversioncache {
sub checkversions {
my ($r) = @_;
- my $crstype = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page("Check $crstype Document Versions"));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Document Versions"));
+ my $type = &Apache::loncommon::course_type();
+ $r->print(&Apache::loncommon::start_page("Check $type Document Versions"));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $type Document Versions"));
my $header='';
my $startsel='';
my $monthsel='';
@@ -2318,7 +2262,7 @@ sub checkversions {
&changewarning($r,'');
if ($env{'form.timerange'} eq 'all') {
# show all documents
- $header=&mt('All Documents in '.$crstype);
+ $header=&mt('All Documents in '.$type);
$allsel=1;
foreach my $key (keys(%hash)) {
if ($key=~/^ids\_(\/res\/.+)$/) {
@@ -2363,7 +2307,7 @@ sub checkversions {
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
my %lt=&Apache::lonlocal::texthash
- ('st' => 'Version changes since start of '.$crstype,
+ ('st' => 'Version changes since start of '.$type,
'lm' => 'Version changes since last Month',
'lw' => 'Version changes since last Week',
'sy' => 'Version changes since Yesterday',
@@ -2372,9 +2316,9 @@ sub checkversions {
'fi' => 'File',
'md' => 'Modification Date',
'mr' => 'Most recently published Version',
- 've' => 'Version used in '.$crstype,
- 'vu' => 'Set Version to be used in '.$crstype,
-'sv' => 'Set Versions to be used in '.$crstype.' according to Selections below',
+ 've' => 'Version used in '.$type,
+ 'vu' => 'Set Version to be used in '.$type,
+'sv' => 'Set Versions to be used in '.$type.' according to Selections below',
'sm' => 'Keep all Resources up-to-date with most recent Versions (default)',
'sc' => 'Set all Resource Versions to current Version (Fix Versions)',
'di' => 'Differences');
@@ -2421,7 +2365,7 @@ ENDHEADERS
'Most Recent: '.
''.$currentversion.' '.
' '.
- 'In '.$crstype.': '.
+ ' In '.$type.': '.
'');
# Used in course
my $usedversion=$hash{'version_'.$linkurl};
@@ -2438,7 +2382,7 @@ ENDHEADERS
('select_form_order' =>
['',1..$currentversion,'mostrecent'],
'' => '',
- 'mostrecent' => &mt('most recent'),
+ 'mostrecent' => 'most recent',
map {$_,$_} (1..$currentversion))));
$r->print(' ');
my $lastold=1;
@@ -2539,19 +2483,14 @@ 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\n");
-
+ &mt('re-initializing '.$course_type).'" onClick="reinit(this.form)" />').
+$help{'Caching'}.''."\n\n");
}
@@ -2559,7 +2498,7 @@ sub init_breadcrumbs {
my ($form,$text)=@_;
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
- text=>&Apache::loncommon::course_type().' Editor',
+ text=>"Edit ".&Apache::loncommon::course_type(),
faq=>273,
bug=>'Instructor Interface',
help => 'Docs_Adding_Course_Doc'});
@@ -2577,7 +2516,8 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
- my $crstype = &Apache::loncommon::course_type();
+ my $type = &Apache::loncommon::course_type();
+
# --------------------------------------------- Initialize help topics for this
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents',
@@ -2620,7 +2560,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','IMS Export');
+ &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');
&exportcourse($r);
} else {
# is this a standard course?
@@ -2632,6 +2572,8 @@ sub handler {
my $showdoc=0;
my $containertag;
my $uploadtag;
+
+
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['folderpath','pagepath',
'pagesymb']);
@@ -2649,7 +2591,7 @@ sub handler {
}
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$crstype.' Documents')).'&'.
+ &escape(&mt('Supplemental '.$type.' Documents')).'&'.
$env{'form.folderpath'};
}
&Apache::loncommon::store_course_settings('docs_folderpath',
@@ -2704,13 +2646,9 @@ sub handler {
$script .= &editing_js($udom,$uname);
}
# -------------------------------------------------------------------- Body tag
- $script = ''."\n";
- my $brcrum = [{href=>"/adm/createuser",text=>"$crstype Documents"}];
- $r->print(&Apache::loncommon::start_page("$crstype Documents", $script,
+ $script = '';
+ my $brcrum = [{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'));
@@ -2805,12 +2743,11 @@ sub handler {
unless ($showdoc || $upload_result eq 'phasetwo') {
# -----------------------------------------------------------------------------
my %lt=&Apache::lonlocal::texthash(
- 'uplm' => 'Upload a new main '.lc($crstype).' document',
- 'upls' => 'Upload a new supplemental '.lc($crstype).' document',
+ 'uplm' => 'Upload a new main '.lc($type).' document',
+ 'upls' => 'Upload a new supplemental '.lc($type).' document',
'impp' => 'Import a document',
- 'pubd' => 'Published documents',
+ 'pubd' => 'Published Documents',
'copm' => 'All documents out of a published map into this folder',
- 'spec' => 'Special documents',
'upld' => 'Upload Document',
'srch' => 'Search',
'impo' => 'Import',
@@ -2823,37 +2760,99 @@ sub handler {
'extr' => 'External Resource',
'syll' => 'Syllabus',
'navc' => 'Navigate Contents',
- 'sipa' => 'Simple Course Page',
+ 'sipa' => 'Simple Page',
'sipr' => 'Simple Problem',
'drbx' => 'Drop Box',
'scuf' => 'Score Upload Form',
- 'bull' => 'Discussion Board',
- 'mypi' => 'My Personal Information Page',
- 'grpo' => 'Group Portfolios',
+ 'bull' => 'Bulletin Board',
+ 'mypi' => 'My Personal Info',
+ 'grpo' => 'Group Files',
'rost' => 'Course Roster',
'abou' => 'About User',
- 'imsf' => 'IMS Import',
- 'imsl' => 'Import IMS package',
+ 'imsf' => 'Import IMS package',
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
- 'parse' => 'If HTML file, upload embedded images/multimedia files'
+ 'parse' => 'Upload embedded images/multimedia files if HTML file!',
+ 'nd' => 'New Document',
+ 'pm' => 'Published Map',
+ 'sd' => 'Special Document',
+ 'mo' => 'More Options',
+ 'hao' => 'Hide all Options'
);
# -----------------------------------------------------------------------------
- my %tabtitles = (
- main => {
- Course => &mt('Main Course Documents'),
- Community => &mt('Main Community Documents'),
- },
- supplemental => {
- Course => &mt('Supplemental Course Documents'),
- Community => &mt('Supplemental Community Documents'),
- },
- );
+ my $fileupload=(<
+
+FIUP
+
+ my $checkbox=(<$lt{'parse'}?
+
+ -->
+
+ $lt{'parse'}
+
+CHBO
+
+ my $fileuploadform=(<
+ $fileupload
+
+ $lt{'title'}:
+
+ $uploadtag
+
+
+
+ $checkbox
+
+
+
+
+
+ $help{'Uploading_From_Harddrive'}
+
+
+FUFORM
+
+ my $simpleeditdefaultform=(<
+ $lt{'pubd'}
+ $uploadtag
+
+
+
+
+ $help{'Importing_LON-CAPA_Resource'}
+
+
+
+
+
+ $lt{'copm'}
+
+
+ $help{'Load_Map'}
+
+
+SEDFFORM
+
+ my $extresourcesform=(<
+ $uploadtag
+
+
+ $help{'Adding_External_Resource'}
+
+
+ERFORM
+
if ($allowed) {
&update_paste_buffer($coursenum,$coursedom);
- my $dumpbut=&dumpbutton();
- my $exportbut=&exportbutton();
my %lt=&Apache::lonlocal::texthash(
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
@@ -2865,7 +2864,8 @@ sub handler {
if (!$folderpath) {
if ($env{'form.folder'} eq '' ||
$env{'form.folder'} eq 'supplemental') {
- $folderpath='default&'.&escape($tabtitles{'main'}{$crstype});
+ $folderpath='default&'.
+ &escape(&mt('Main '.$type.' Documents'));
}
}
unless ($env{'form.pagepath'}) {
@@ -2873,71 +2873,28 @@ sub handler {
$uploadtag = ' ';
}
- $r->print(<
-
-
-
-
- $containertag
-
-
-
-
-ENDCOURSEVERIFY
+ $r->print(&generate_admin_options($containertag,$uploadtag,\%lt,\%help,\%env));
$r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
- &mt('Editing the Table of Contents for your '.$crstype)));
+ &mt('Editing the Table of Contents for your '.$type)));
}
# --------------------------------------------------------- Standard documents
- $r->print('');
-
if (($standard) && ($allowed) && (!$forcesupplement)) {
- $r->print('');
-# ''.&mt('Main Course Documents').
-# ($allowed?' '.$help{'Main_Course_Documents'}:'').' ');
my $folder=$env{'form.folder'};
if ($folder eq '' || $folder eq 'supplemental') {
$folder='default';
- $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$crstype.' Documents'));
+ $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
$uploadtag = ' ';
}
my $postexec='';
if ($folder eq 'default') {
- $r->print(''."\n"
- );
+ $r->print('');
} else {
#$postexec='self.close();';
}
$hadchanges=0;
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,
- $upload_output,$crstype);
+ $upload_output,$type);
if ($error) {
$r->print(''.$error.'
');
}
@@ -2954,230 +2911,219 @@ ENDCOURSEVERIFY
$container='page';
}
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container;
- $r->print(<
-
-$lt{'uplm'}
-$lt{'impp'}
-$lt{'spec'}
-
-
-
-$lt{'file'}:
-
-
-
-
-
-
-ENDFORM
- unless ($env{'form.pagepath'}) {
- $r->print(<
-
-
-ENDFORM
- }
- $r->print(' ');
+
+
+
+ my $recoverform=(<
+
+
+RFORM
+
+ my $imspform=(<
+
+
+
+IMSPFORM
+
+ my $newnavform=(<
+ $uploadtag
+
+
+
+ $help{'Navigate_Content'}
+
+
+NNFORM
+ my $newsmppageform=(<
+ $uploadtag
+
+
+ $help{'Simple Page'}
+
+
+NSPFORM
+
+ my $newsmpproblemform=(<
+ $uploadtag
+
+
+ $help{'Simple Problem'}
+
+
+
+NSPROBFORM
+
+ my $newdropboxform=(<
+ $uploadtag
+
+
+
+
+
+NDBFORM
+
+ my $newexuploadform=(<
+ $uploadtag
+
+
+
+ $help{'Score_Upload_Form'}
+
+
+NEXUFORM
+
+ my $newbulform=(<
+ $uploadtag
+
+
+
+ $help{'Bulletin Board'}
+
+
+NBFORM
+
+ my $newaboutmeform=(<
+ $uploadtag
+
+
+
+ $help{'My Personal Info'}
+
+
+NAMFORM
+
+ my $newaboutsomeoneform=(<
+ $uploadtag
+
+
+
+
+
+NASOFORM
+
+
+ my $newrosterform=(<
+ $uploadtag
+
+
+
+ $help{'Course Roster'}
+
+
+NROSTFORM
+
unless ($env{'form.pagepath'}) {
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
- $r->print(<
-
-
-
-
-
-
-
-
-
-
-
-
-ENDFORM
- }
+
+ my $newpageform=(<
+
+
+
+ $help{'Adding_Pages'}
+
+
+NPFORM
+
+ my $newfolderform=(<
+
+
+
+ $help{'Adding_Folders'}
+
+
+NFFORM
+
+ my $newsylform=(<
+ $uploadtag
+
+
+
+ $help{'Syllabus'}
+
+
+NSYLFORM
+
+ my $newgroupfileform=(<
+ $uploadtag
+
+
+
+ $help{'Group Files'}
+
+
+NGFFORM
+
+
+ my $specialdocumentsform=(< $newfolderform
+ $newpageform
+ $newsylform
+ $newnavform
+ $newsmppageform
+ $newsmpproblemform
+ $newdropboxform
+ $newexuploadform
+ $newbulform
+ $newaboutmeform
+ $newaboutsomeoneform
+ $newgroupfileform
+ $newrosterform
+SPDOFORM
+
+
+my %orderhash = (
+ 'aa' => 'New Document',
+ 'bb' => 'Published Documents',
+ 'cc' => 'Special Documents',
+ 'dd' => 'More Options',
+ 'zz' => 'Hide all Option',
+ );
+my %namehash = (
+ 'New Document' => $fileuploadform,
+ 'Published Documents' => $simpleeditdefaultform,
+ 'Special Documents' => $specialdocumentsform,
+ 'More Options' => $extresourcesform.' '.$imspform.' '.$recoverform,
+ 'drei' => 'dr',
+ );
+my $tid = '1';
+my $varcd = 'Course Documents';
+$r->print(&generate_edit_table($varcd,\%namehash,\%orderhash));
+ }
if ($env{'form.pagepath'}) {
- $r->print(<
-$uploadtag
-
-
- $help{'Simple Problem'}
-
-
-
-ENDBLOCK
}
- $r->print(' '."\n".
-'
');
- $r->print(' ');
}
# ----------------------------------------------------- Supplemental documents
if (!$forcestandard) {
- $r->print('');
-# ''.&mt('Supplemental Course Documents').
-# ($allowed?' '.$help{'Supplemental'}:'').' ');
my $folder=$env{'form.folder'};
unless ($folder=~/^supplemental/) {
$folder='supplemental';
@@ -3185,9 +3131,9 @@ ENDBLOCK
if ($folder =~ /^supplemental$/ &&
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape($tabtitles{'supplemental'}{$crstype});
+ &escape(&mt('Supplemental '.$type.' Documents'));
}
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
if ($error) {
$r->print(''.$error.'
');
}
@@ -3197,77 +3143,104 @@ ENDBLOCK
'.sequence';
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
- $r->print(<
-$lt{'upls'}
-$lt{'spec'}
-
-
-
-
-
-
-
-
-
- $help{'Adding_Folders'}
-
-
-
-
-
-
- $help{'Adding_External_Resource'}
-
-
-
-
-
-
-
-$help{'Syllabus'}
-
-
-
-
-
-
-
-$help{'My Personal Info'}
-
-
-
-
-ENDSUPFORM
- }
- }
- $r->print('');
+
+ my $supupdocform=(<
+ $fileupload
+
+
+
+ $checkbox
+
+
+ $lt{'comment'}:
+
+
+
+
+
+
+
+ $help{'Uploading_From_Harddrive'}
+
+
+SUPDOCFORM
+
+ my $supnewfolderform=(<
+
+
+
+ $help{'Adding_Folders'}
+
+
+SNFFORM
+
+
+ my $supnewextform=(<
+
+
+
+ $help{'Adding_External_Resource'}
+
+
+SNEFORM
+
+ my $supnewsylform=(<
+
+
+
+
+ $help{'Syllabus'}
+
+
+SNSFORM
+
+ my $supnewaboutmeform=(<
+
+
+
+
+ $help{'My Personal Info'}
+
+
+SNAMFORM
+
+
+
+my %suporderhash = (
+ 'ee' => 'New Document',
+ 'ff' => 'Special Documents',
+ 'zz' => 'Hide all Options',
+ );
+
+my %supnamehash = (
+ 'New Document' => $supupdocform,
+ 'Special Documents' => $supnewfolderform.' '.$supnewextform.' '.$supnewsylform.' '.$supnewaboutmeform,
+ );
+my $tid='2';
+my $varscd = 'Supplemented Course Documents';
+
+$r->print(<
+ New Document
+ Special Documents
+
+FORM
+
+#$r->print(&generate_edit_table($varscd,\%supnamehash,\%suporderhash));
+
+ }
+ }
if ($allowed) {
$r->print('
@@ -3291,6 +3264,79 @@ ENDSUPFORM
return OK;
}
+sub generate_admin_options {
+ my ($containertag,$uploadtag,$lt_ref,$help_ref,$env_ref) = @_;
+ my %lt = %{$lt_ref};
+ my %help = %{$help_ref};
+ my %env = %{$env_ref};
+ my $dumpbut=&dumpbutton();
+ my $exportbut=&exportbutton();
+ return (<
+
+
+
+
+ $containertag
+
+
+
+ $uploadtag
+
+
+
+
+
+ENDOPTIONFORM
+
+}
+
+
+sub generate_edit_table {
+ my ($varcd,$namehash_ref,$orderhash_ref) = @_;
+ my %namehash = %{$namehash_ref}; #name verlinkt mit id
+ my %orderhash = %{$orderhash_ref}; #name mit kürzel verlinkt mit name
+ my $form;
+
+ {
+
+ $form = ''.&mt('Upload '.$varcd).' ';
+ $form .= '
';
+ foreach my $name (sort(keys(%orderhash))){
+ if($name eq 'zz'){
+ $form .= ''.&mt($orderhash{$name}).' ';
+ }else{
+ $form .= ''.&mt($orderhash{$name}).' ';
+ }
+ }
+ $form .= '';
+ foreach my $field (keys(%namehash)){
+ $form .= '
'.$namehash{$field}.'
';
+ }
+ $form .= '
';
+ }
+ return $form;
+}
sub editing_js {
my ($udom,$uname) = @_;
@@ -3301,10 +3347,10 @@ sub editing_js {
p_mnp => 'Name of New Page',
t_mnp => 'New Page',
p_mxu => 'Title for the Uploaded Score',
- p_msp => 'Name of the Simple Course Page',
+ p_msp => 'Title for the Page',
p_msb => 'Title for the Problem',
p_mdb => 'Title for the Drop Box',
- p_mbb => 'Title for the Discussion Board',
+ p_mbb => 'Title for the Bulletin Board',
p_mab => "Enter user:domain for User's 'About Me' Page",
p_mab2 => "About [_99]",
p_mab_alrt1 => 'Not a valid user:domain',
@@ -3493,6 +3539,34 @@ function markcopy(folderpath,index,oldti
this.document.forms.renameform.submit();
}
+function unselectInactive() {
+ currentTable = document.getElementById('tableId');
+ currentNav = document.getElementById('navigation');
+ currentLis = currentNav.getElementsByTagName('LI');
+ for (i = 0; i < currentLis.length; i++) {
+ currentLis[i].className = 'i';
+ }
+}
+
+function hideAll(current) {
+ unselectInactive();
+ current.className = 'active';
+ currentData = document.getElementById('content');
+ currentDivs = currentData.getElementsByTagName('DIV');
+ for (i = 0; i < currentDivs.length; i++) {
+ currentDivs[i].style.display = 'none';
+ }
+}
+
+function showPage(current, pageId) {
+ hideAll(current);
+ unselectInactive();
+ current.className = 'active';
+ currentData = document.getElementById(pageId);
+ currentData.style.display = 'block';
+ return false;
+}
+
ENDNEWSCRIPT
}
1;