\n");
+ $r->print(&Apache::loncommon::end_data_table());
&untiehash();
$r->print(
- '');
+ '');
}
}
-# ------------------------------------------------------ Generate "export" button
+=pod
+
+=item exportbutton()
+
+ Generate "export" button
+
+=cut
sub exportbutton {
my $type = &Apache::loncommon::course_type();
@@ -264,6 +327,12 @@ sub exportbutton {
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'';
}
+=pod
+
+=item exportcourse()
+
+=cut
+
sub exportcourse {
my $r=shift;
my $type = &Apache::loncommon::course_type();
@@ -309,10 +378,10 @@ sub exportcourse {
chdir $cwd;
$outcome .= &mt('Download the zip file from IMS '.lc($type).' archive ',$imszipfile,);
if ($copyresult) {
- $outcome .= 'The following errors occurred during export - '.$copyresult;
+ $outcome .= &mt('The following errors occurred during export - [_1]',$copyresult);
}
} else {
- $outcome = ' 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.').' ';
}
}
$r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'));
@@ -902,8 +971,15 @@ sub store_template {
}
}
-# Imports the given (name, url) resources into the course
-# coursenum, coursedom, and folder must precede the list
+=pod
+
+=item group_import()
+
+ Imports the given (name, url) resources into the course
+ coursenum, coursedom, and folder must precede the list
+
+=cut
+
sub group_import {
my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_;
@@ -924,7 +1000,7 @@ sub group_import {
my $result=&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,
'output',$1.$2);
if ($result != m|^/uploaded/|) {
- $errtext.='Map not saved: A network error occured when trying to save the new map. ';
+ $errtext.='Map not saved: A network error occurred when trying to save the new map. ';
$fatal = 2;
}
if ($fatal) {
@@ -1064,10 +1140,12 @@ sub log_docs {
}
}
+=pod
+
+=item docs_change_log()
+
+=cut
-#
-# Docs Change Log
-#
sub docs_change_log {
my ($r)=@_;
my $folder=$env{'form.folder'};
@@ -1208,7 +1286,10 @@ sub update_paste_buffer {
# Mark for copying
my ($title,$url)=split(':',$LONCAPA::map::resources[$LONCAPA::map::order[$env{'form.markcopy'}]]);
if (&is_supplemental_title($title)) {
+ &Apache::lonnet::appenv({'docs.markedcopy_supplemental' => $title});
($title) = &parse_supplemental_title($title);
+ } elsif ($env{'docs.markedcopy_supplemental'}) {
+ &Apache::lonnet::delenv('docs\\.markedcopy_supplemental');
}
$url=~s{http(:|:)//https(:|:)//}{https$2//};
@@ -1257,7 +1338,7 @@ ENDPASTE
}
sub do_paste_from_buffer {
- my ($coursenum,$coursedom) = @_;
+ my ($coursenum,$coursedom,$folder) = @_;
return 0 if (!$env{'form.pastemarked'});
@@ -1299,6 +1380,20 @@ sub do_paste_from_buffer {
$url = &LONCAPA::map::qtunescape($url);
# Now insert the URL at the bottom
my $newidx = &LONCAPA::map::getresidx($url);
+ if ($env{'docs.markedcopy_supplemental'}) {
+ if ($folder =~ /^supplemental/) {
+ $title = $env{'docs.markedcopy_supplemental'};
+ } else {
+ (undef,undef,$title) =
+ &parse_supplemental_title($env{'docs.markedcopy_supplemental'});
+ }
+ } else {
+ if ($folder=~/^supplemental/) {
+ $title=time.'___&&&___'.$env{'user.name'}.'___&&&___'.
+ $env{'user.domain'}.'___&&&___'.$title;
+ }
+ }
+
$LONCAPA::map::resources[$newidx]= $title.':'.$url.':'.$ext.':normal:res';
push(@LONCAPA::map::order, $newidx);
# Store the result
@@ -1419,7 +1514,7 @@ sub editor {
}
if ($env{'form.pastemarked'}) {
- &do_paste_from_buffer($coursenum,$coursedom);
+ &do_paste_from_buffer($coursenum,$coursedom,$folder);
($errtext,$fatal) = &storemap($coursenum,$coursedom,$folder.'.'.$container);
return $errtext if ($fatal);
}
@@ -1496,7 +1591,9 @@ sub editor {
$r->print('
'.&mt('Currently no documents.').'
');
}
$r->print("\n\n");
- &print_paste_buffer($r,$container);
+ if ($allowed) {
+ &print_paste_buffer($r,$container);
+ }
return;
}
@@ -1936,7 +2033,13 @@ ENDPARMS
return $line;
}
-# ---------------------------------------------------------------- tie the hash
+=pod
+
+=item tiehash()
+
+tie the hash
+
+=cut
sub tiehash {
my ($mode)=@_;
@@ -1962,7 +2065,15 @@ sub untiehash {
return OK;
}
-# --------------------------------------------------------------- check on this
+
+=pod
+
+=item checkonthis()
+
+check on this
+
+=cut
+
sub checkonthis {
my ($r,$url,$level,$title)=@_;
@@ -1971,6 +2082,9 @@ sub checkonthis {
$r->rflush();
if (($url) && ($url!~/^\/uploaded\//) && ($url!~/\*$/)) {
$r->print("\n ");
+ if ($level==0) {
+ $r->print(" ");
+ }
for (my $i=0;$i<=$level*5;$i++) {
$r->print(' ');
}
@@ -1980,7 +2094,7 @@ sub checkonthis {
my $result=&Apache::lonnet::repcopy(
&Apache::lonnet::filelocation('',$url));
if ($result eq 'ok') {
- $r->print(''.&mt('ok').'');
+ $r->print(''.&mt('ok').'');
$r->rflush();
&Apache::lonnet::countacc($url);
$url=~/\.(\w+)$/;
@@ -1990,7 +2104,7 @@ sub checkonthis {
for (my $i=0;$i<=$level*5;$i++) {
$r->print(' ');
}
- $r->print('- '.&mt('Rendering').': ');
+ $r->print('- '.&mt('Rendering:').' ');
my ($errorcount,$warningcount)=split(/:/,
&Apache::lonnet::ssi_body($url,
('grade_target'=>'web',
@@ -1999,13 +2113,11 @@ sub checkonthis {
($warningcount)) {
if ($errorcount) {
$r->print(''.
- $errorcount.' '.
- &mt('error(s)').' ');
+ &mt('[quant,_1,error]',$errorcount).'');
}
if ($warningcount) {
$r->print(''.
- $warningcount.' '.
- &mt('warning(s)').'');
+ &mt('[quant,_1,warning]',$warningcount).'');
}
} else {
$r->print(''.&mt('ok').'');
@@ -2023,21 +2135,27 @@ sub checkonthis {
$r->print(''.&mt('connection down').'');
} elsif ($result eq 'not_found') {
unless ($url=~/\$/) {
- $r->print(''.&mt('not found').'');
+ $r->print(''.&mt('not found').'');
} else {
$r->print(''.&mt('unable to verify variable URL').'');
}
} else {
$r->print(''.&mt('access denied').'');
}
- }
- }
+ }
+ }
}
-#
-# ----------------------------------------------------------------- List Symbs
-#
+
+=pod
+
+=item list_symbs()
+
+List Symbs
+
+=cut
+
sub list_symbs {
my ($r) = @_;
@@ -2053,9 +2171,14 @@ sub list_symbs {
}
-#
-# -------------------------------------------------------------- Verify Content
-#
+=pod
+
+=item verifycontent()
+
+Verify Content
+
+=cut
+
sub verifycontent {
my ($r) = @_;
my $type = &Apache::loncommon::course_type();
@@ -2085,8 +2208,13 @@ sub verifycontent {
&mt('Return to DOCS').'');
}
+=pod
+
+=item devalidateversioncache() & checkversions()
+
+Check Versions
-# -------------------------------------------------------------- Check Versions
+=cut
sub devalidateversioncache {
my $src=shift;
@@ -2390,7 +2518,13 @@ sub changewarning {
$help{'Caching'}.''."\n\n");
}
-# =========================================== Breadcrumbs for special functions
+=pod
+
+=item init_breadcrumbs()
+
+Breadcrumbs for special functions
+
+=cut
sub init_breadcrumbs {
my ($form,$text)=@_;
@@ -2406,7 +2540,15 @@ sub init_breadcrumbs {
bug=>'Instructor Interface'});
}
-# ================================================================ Main Handler
+
+=pod
+
+=item handler()
+
+Main Handler
+
+=cut
+
sub handler {
my $r = shift;
&Apache::loncommon::content_type($r,'text/html');
@@ -3311,3 +3453,9 @@ ENDNEWSCRIPT
}
1;
__END__
+
+=pod
+
+=back
+
+=cut