'.
''.&mt('Content items').' '.
@@ -507,7 +517,7 @@ function containerCheck(item) {
// ]]>
|;
- $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package',
+ $r->print(&Apache::loncommon::start_page('Export '.$crstype.' to IMS Package',
$scripttag));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export'));
$r->print($display.
@@ -998,7 +1008,7 @@ sub group_import {
}
sub breadcrumbs {
- my ($allowed,$type)=@_;
+ my ($allowed,$crstype)=@_;
&Apache::lonhtmlcommon::clear_breadcrumbs();
my (@folders);
if ($env{'form.pagepath'}) {
@@ -1041,7 +1051,7 @@ sub breadcrumbs {
if ($3) { $isencrypted=1; }
if ($4 ne '') { $is_random_order = 1; }
if ($folder eq 'supplemental') {
- $name = &mt('Supplemental '.$type.' Documents');
+ $name = &mt('Supplemental '.$crstype.' Documents');
}
&Apache::lonhtmlcommon::add_breadcrumb(
{'href'=>$url.$cpinfo,
@@ -1497,7 +1507,7 @@ sub handle_edit_cmd {
}
sub editor {
- my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_;
+ my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype)=@_;
my $container= ($env{'form.pagepath'}) ? 'page'
: 'sequence';
@@ -1515,7 +1525,7 @@ sub editor {
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
if ($allowed) {
($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) =
- &breadcrumbs($allowed,$type);
+ &breadcrumbs($allowed,$crstype);
$r->print($breadcrumbtrail);
} else {
$randompick = -1;
@@ -1636,7 +1646,7 @@ sub editor {
unless ($name) { $name=(split(/\//,$url))[-1]; }
unless ($name) { $idx++; next; }
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
- $coursenum);
+ $coursenum,$crstype);
$idx++;
$shown++;
}
@@ -1804,7 +1814,7 @@ sub parse_supplemental_title {
# --------------------------------------------------------------- An entry line
sub entryline {
- my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_;
+ my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$crstype)=@_;
my ($foldertitle,$pagetitle,$renametitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &parse_supplemental_title($title);
@@ -2067,12 +2077,18 @@ END
} else {
undef($external);
}
+ my $reinit;
+ if ($crstype eq 'Community') {
+ $reinit = &mt('(re-initialize community to access)');
+ } else {
+ $reinit = &mt('(re-initialize course to access)');
+ }
$line.='
'.($url?'':'').' '.($url?' ':'').'
- '.($url?"":'').$title.($url?' ':' '.&mt('(re-initialize course to access)').' ').$external."
+ '.($url?"":'').$title.($url?' ':' '.$reinit.' ').$external."
";
if (($allowed) && ($folder!~/^supplemental/)) {
my %lt=&Apache::lonlocal::texthash(
@@ -2220,7 +2236,7 @@ List Symbs
sub list_symbs {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &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();
@@ -2229,7 +2245,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($type).':'.$env{'request.course.id'});
+ &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
} else {
$r->print("\n");
foreach my $res ($navmap->retrieveResources()) {
@@ -2243,11 +2259,11 @@ sub list_symbs {
sub verifycontent {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
- $r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$type.' Documents'));
+ $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
$hashtied=0;
undef %alreadyseen;
%alreadyseen=();
@@ -2256,7 +2272,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 '.$type.': ').
+ &mt('The following sequence or page is included more than once in your '.$crstype.': ').
&unescape($hash{$key}).' '.
&mt('Note that grading records for problems included in this sequence or folder will overlap. '));
}
@@ -2279,9 +2295,9 @@ sub devalidateversioncache {
sub checkversions {
my ($r) = @_;
- 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 $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 $header='';
my $startsel='';
my $monthsel='';
@@ -2342,7 +2358,7 @@ sub checkversions {
&changewarning($r,'');
if ($env{'form.timerange'} eq 'all') {
# show all documents
- $header=&mt('All Documents in '.$type);
+ $header=&mt('All Documents in '.$crstype);
$allsel=1;
foreach my $key (keys(%hash)) {
if ($key=~/^ids\_(\/res\/.+)$/) {
@@ -2387,7 +2403,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 '.$type,
+ ('st' => 'Version changes since start of '.$crstype,
'lm' => 'Version changes since last Month',
'lw' => 'Version changes since last Week',
'sy' => 'Version changes since Yesterday',
@@ -2396,9 +2412,9 @@ sub checkversions {
'fi' => 'File',
'md' => 'Modification Date',
'mr' => 'Most recently published Version',
- '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',
+ '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',
'sm' => 'Keep all Resources up-to-date with most recent Versions (default)',
'sc' => 'Set all Resource Versions to current Version (Fix Versions)',
'di' => 'Differences');
@@ -2445,7 +2461,7 @@ ENDHEADERS
'Most Recent: '.
''.$currentversion.' '.
' '.
- 'In '.$type.': '.
+ ' In '.$crstype.': '.
'');
# Used in course
my $usedversion=$hash{'version_'.$linkurl};
@@ -2462,7 +2478,7 @@ ENDHEADERS
('select_form_order' =>
['',1..$currentversion,'mostrecent'],
'' => '',
- 'mostrecent' => 'most recent',
+ 'mostrecent' => &mt('most recent'),
map {$_,$_} (1..$currentversion))));
$r->print(' ');
my $lastold=1;
@@ -2600,7 +2616,7 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
# --------------------------------------------- Initialize help topics for this
@@ -2666,7 +2682,12 @@ sub handler {
&Apache::loncommon::restore_course_settings('docs_folderpath',
{'folderpath' => 'scalar'});
}
- if (!$env{'form.folderpath'}) {
+ if (!$allowed) {
+ unless($env{'form.folderpath'} =~ /^supplemental/) {
+ $env{'form.folderpath'} = '';
+ }
+ }
+ if (!$env{'form.folderpath'} && $allowed) {
&Apache::loncommon::restore_course_settings('docs_folderpath',
{'pagepath' => 'scalar'});
}
@@ -2675,7 +2696,7 @@ sub handler {
}
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents')).'&'.
+ &escape(&mt('Supplemental '.$crstype.' Documents')).'&'.
$env{'form.folderpath'};
}
&Apache::loncommon::store_course_settings('docs_folderpath',
@@ -2760,25 +2781,25 @@ sub create_form_ul {
&Apache::lonhtmlcommon::clear_breadcrumbs();
if ($allowed) {
&Apache::lonhtmlcommon::add_breadcrumb({
- href=>"/adm/coursedocs",text=>"$type Editor"});
+ href=>"/adm/coursedocs",text=>"$crstype Editor"});
- $r->print(&Apache::loncommon::start_page("$type Editor", $script,
+ $r->print(&Apache::loncommon::start_page("$crstype Editor", $script,
{'force_register' => $showdoc,})
.&Apache::loncommon::help_open_menu('','',273,'RAT')
.&Apache::lonhtmlcommon::breadcrumbs(
- 'Editing the Table of Contents for your '.$type,
+ 'Editing the Table of Contents for your '.$crstype,
'Docs_Adding_Course_Doc')
);
} elsif ($showdoc) {
- $r->print(&Apache::loncommon::start_page("$type documents",undef,
+ $r->print(&Apache::loncommon::start_page("$crstype documents",undef,
{'force_register' => $showdoc,}));
} else {
my $folder=$env{'form.folder'};
if ($folder eq '' || $folder eq 'supplemental') {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents'));
+ &escape(&mt('Supplemental '.$crstype.' Documents'));
}
- my ($breadcrumbtrail) = &breadcrumbs($allowed,$type);
+ my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype);
$r->print(&Apache::loncommon::start_page("Supplemental documents").
$breadcrumbtrail);
}
@@ -2873,8 +2894,8 @@ sub create_form_ul {
unless ($showdoc || $upload_result eq 'phasetwo') {
# -----------------------------------------------------------------------------
my %lt=&Apache::lonlocal::texthash(
- 'uplm' => 'Upload a new main '.lc($type).' document',
- 'upls' => 'Upload a new supplemental '.lc($type).' document',
+ 'uplm' => 'Upload a new main '.lc($crstype).' document',
+ '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',
@@ -2951,9 +2972,9 @@ FUFORM
SEDFFORM
my @simpleeditdefaultforma = (
- { ' ' => "$uploadtag$lt{'srch'} " },
- { ' ' => "$lt{'impo'} $help{'Importing_LON-CAPA_Resource'}" },
- { ' ' => "$lt{'book'} " },
+ { ' ' => "$uploadtag$lt{'srch'} " },
+ { ' ' => "$lt{'impo'} $help{'Importing_LON-CAPA_Resource'}" },
+ { ' ' => "$lt{'book'} " },
);
$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
$simpleeditdefaultform .=(< {
+ Course => &mt('Main Course Documents'),
+ Community => &mt('Main Community Documents'),
+ },
+ supplemental => {
+ Course => &mt('Supplemental Course Documents'),
+ Community => &mt('Supplemental Community Documents'),
+ },
+ );
if ($allowed) {
$r->print('');
if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
@@ -3025,14 +3055,14 @@ HIDDENFORM
$activeClass = 0;
}
}
- $r->print(''.&mt('Main Course Documents').' ');
+ $r->print(''.$tabtitles{'main'}{$crstype}.' ');
$active = '';
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
if($activeClass == 1){
$active = 'class="active"';
}
}
- $r->print(''.&mt('Supplemental Course Documents').' ');
+ $r->print(''.$tabtitles{'supplemental'}{$crstype}.' ');
$r->print(' ');
} else {
$r->print(' ');
@@ -3051,7 +3081,7 @@ HIDDENFORM
if ($folder eq '' || $folder=~/^supplemental/) {
$folder='default';
$savefolderpath = $env{'form.folderpath'};
- $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
+ $env{'form.folderpath'}='default&'.&escape($tabtitles{'main'}{$crstype});
$uploadtag = ' ';
}
@@ -3234,37 +3264,37 @@ NSYLFORM
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 %orderhash = (
@@ -3276,7 +3306,7 @@ my %orderhash = (
);
my $tid='1';
$hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
if ($error) {
$r->print(''.$error.'
');
}
@@ -3304,7 +3334,7 @@ $r->print('');
if ($folder =~ /^supplemental$/ &&
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents'));
+ &escape(&mt('Supplemental '.$crstype.' Documents'));
} elsif ($allowed) {
$env{'form.folderpath'} = $savefolderpath;
}
@@ -3379,9 +3409,9 @@ SNAMFORM
my @specialdocs = (
- {' '=>$supnewextform},
- {' '=>$supnewsylform},
- {' '=>$supnewaboutmeform},
+ {' '=>$supnewextform},
+ {' '=>$supnewsylform},
+ {' '=>$supnewaboutmeform},
);
my %suporderhash = (
'00' => ['Supnewfolder', $supnewfolderform],
@@ -3389,14 +3419,14 @@ my %suporderhash = (
'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))]
);
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
if ($error) {
$r->print(''.$error.'
');
}
my $tid='2';
$r->print(&generate_edit_table($tid,\%suporderhash));
} else {
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
if ($error) {
$r->print(''.$error.'
');
}
@@ -3443,15 +3473,15 @@ sub generate_admin_options {
my $dumpbut=&dumpbutton();
my $exportbut=&exportbutton();
my @list = (
- {' '=>"$lt{'vc'} $help{'Verify_Content'}"},
- {' '=>"$lt{'cv'} $help{'Check_Resource_Versions'}"},
+ {' '=>"$lt{'vc'} $help{'Verify_Content'}"},
+ {' '=>"$lt{'cv'} $help{'Check_Resource_Versions'}"},
);
if($dumpbut ne ''){
- push @list, {' '=>$dumpbut};
+ push @list, {' '=>$dumpbut};
}
- push @list, ({' '=>$exportbut},
- {' '=>"$lt{'ls'} "},
- {' '=>"$lt{'sl'} "},
+ push @list, ({' '=>$exportbut},
+ {' '=>"$lt{'ls'} "},
+ {' '=>"$lt{'sl'} "},
);
return '';