version 1.484.2.28, 2013/03/17 18:49:16
|
version 1.534, 2013/03/11 22:16:11
|
Line 353 $initialtext
|
Line 353 $initialtext
|
</html> |
</html> |
END |
END |
$env{'form.output'}=$newhtml; |
$env{'form.output'}=$newhtml; |
my $result = |
my $result = |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
'output', |
'output', |
"$filepath/$residx/$fname.html"); |
"$filepath/$residx/$fname.html"); |
Line 377 END
|
Line 377 END
|
removefrommap => \%removefrommap, |
removefrommap => \%removefrommap, |
removeparam => \%removeparam, |
removeparam => \%removeparam, |
); |
); |
my ($result,$msgsarray,$lockerror) = |
my ($result,$msgsarray,$lockerror) = |
&apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated); |
&apply_fixups($folder,1,$coursedom,$coursenum,\%import_errors,\%updated); |
if (keys(%import_errors) > 0) { |
if (keys(%import_errors) > 0) { |
$fixuperrors = |
$fixuperrors = |
Line 804 sub print_paste_buffer {
|
Line 804 sub print_paste_buffer {
|
$r->print('<form name="pasteform" action="/adm/coursedocs" method="post">'.$buffer); |
$r->print('<form name="pasteform" action="/adm/coursedocs" method="post">'.$buffer); |
if ((!$areachange) && (!$othercourse) && |
if ((!$areachange) && (!$othercourse) && |
($env{'docs.markedcopy_cmd'} eq 'cut')) { |
($env{'docs.markedcopy_cmd'} eq 'cut')) { |
if (($is_uploaded_map) || |
if (($is_uploaded_map) || |
($env{'docs.markedcopy_url'} =~ /(bulletinboard|smppg)$/) || |
($env{'docs.markedcopy_url'} =~ /(bulletinboard|smppg)$/) || |
($env{'docs.markedcopy_url'} =~ m{^/uploaded/$coursedom/$coursenum/(?:docs|supplemental)/(.+)$})) { |
($env{'docs.markedcopy_url'} =~ m{^/uploaded/$coursedom/$coursenum/(?:docs|supplemental)/(.+)$})) { |
my ($copytext,$movetext); |
my ($copytext,$movetext); |
Line 1049 sub do_paste_from_buffer {
|
Line 1049 sub do_paste_from_buffer {
|
&url_paste_fixups($url,$folder,$prefixchg,$coursedom,$coursenum, |
&url_paste_fixups($url,$folder,$prefixchg,$coursedom,$coursenum, |
$srcdom,$srcnum,$allmaps,\%rewrites, |
$srcdom,$srcnum,$allmaps,\%rewrites, |
\%retitles,\%copies,\%dbcopies,\%zombies,\%params,\%mapmoves, |
\%retitles,\%copies,\%dbcopies,\%zombies,\%params,\%mapmoves, |
\%mapchanges,\%tomove,\%newsubdir,\%newurls); |
\%mapchanges,\%tomove,\%newsubdir,\%newurls); |
} |
} |
} elsif ($url=~m {^/res/}) { |
} elsif ($url=~m {^/res/}) { |
# published maps can only exists once, so remove it from paste buffer when done |
# published maps can only exists once, so remove it from paste buffer when done |
Line 1085 sub do_paste_from_buffer {
|
Line 1085 sub do_paste_from_buffer {
|
$msg = &mt('Paste failed: An error occurred when copying the bulletin board.').' '.$errtext; |
$msg = &mt('Paste failed: An error occurred when copying the bulletin board.').' '.$errtext; |
} |
} |
return ($result,undef,[$msg],$lockerr{$prefix}); |
return ($result,undef,[$msg],$lockerr{$prefix}); |
} |
} |
if ($lockerr{$prefix}) { |
if ($lockerr{$prefix}) { |
$lockerrors = $lockerr{$prefix}; |
$lockerrors = $lockerr{$prefix}; |
} |
} |
} |
} |
} |
} |
Line 1116 sub do_paste_from_buffer {
|
Line 1116 sub do_paste_from_buffer {
|
if ($newdocsdir eq '') { |
if ($newdocsdir eq '') { |
$newdocsdir = 'default'; |
$newdocsdir = 'default'; |
} |
} |
if (($prefixchg) || |
if (($prefixchg) || |
($srcdom ne $coursedom) || ($srcnum ne $coursenum) || |
($srcdom ne $coursedom) || ($srcnum ne $coursenum) || |
($env{'form.docs.markedcopy_options'} ne 'move')) { |
($env{'form.docs.markedcopy_options'} ne 'move')) { |
my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; |
my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; |
Line 1194 sub do_paste_from_buffer {
|
Line 1194 sub do_paste_from_buffer {
|
$save_err = $errtext; |
$save_err = $errtext; |
} |
} |
} |
} |
|
|
if ($env{'form.docs.markedcopy_options'} eq 'move') { |
if ($env{'form.docs.markedcopy_options'} eq 'move') { |
&Apache::lonnet::delenv('docs.markedcopy'); |
&Apache::lonnet::delenv('docs.markedcopy'); |
&Apache::lonnet::delenv('docs.markedcopy_nested'); |
&Apache::lonnet::delenv('docs.markedcopy_nested'); |
Line 1270 sub dbcopy {
|
Line 1270 sub dbcopy {
|
if (ref($dbref) eq 'HASH') { |
if (ref($dbref) eq 'HASH') { |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
my $prefix = $1; |
my $prefix = $1; |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
($dbref->{'cnum'} =~ /^$match_courseid$/)) { |
($dbref->{'cnum'} =~ /^$match_courseid$/)) { |
my $db_name; |
my $db_name; |
my $marker = (split(m{/},$url))[4]; |
my $marker = (split(m{/},$url))[4]; |
Line 1305 sub dbcopy {
|
Line 1305 sub dbcopy {
|
my $photo = $contents{'uploaded.photourl'}; |
my $photo = $contents{'uploaded.photourl'}; |
my ($subdir,$fname) = |
my ($subdir,$fname) = |
($photo =~ m{^/uploaded/$match_domain/$match_courseid/+(bulletin|simplepage)/(?:|\d+/)([^/]+)$}); |
($photo =~ m{^/uploaded/$match_domain/$match_courseid/+(bulletin|simplepage)/(?:|\d+/)([^/]+)$}); |
my $newphoto; |
my $newphoto; |
if ($fname ne '') { |
if ($fname ne '') { |
my $content = &Apache::lonnet::getfile($photo); |
my $content = &Apache::lonnet::getfile($photo); |
unless ($content eq '-1') { |
unless ($content eq '-1') { |
$env{'form.'.$suffix.'.photourl'} = $content; |
$env{'form.'.$suffix.'.photourl'} = $content; |
$newphoto = |
$newphoto = |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$suffix.'.photourl',"$subdir/$suffix/$fname"); |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom,$suffix.'.photourl',"$subdir/$suffix/$fname"); |
delete($env{'form.'.$suffix.'.photourl'}); |
delete($env{'form.'.$suffix.'.photourl'}); |
} |
} |
Line 1327 sub dbcopy {
|
Line 1327 sub dbcopy {
|
} |
} |
} |
} |
if (($freedlock ne 'ok') && (ref($lockerrorsref) eq 'HASH')) { |
if (($freedlock ne 'ok') && (ref($lockerrorsref) eq 'HASH')) { |
$lockerrorsref->{$prefix} = |
$lockerrorsref->{$prefix} = |
'<div class="LC_error">'. |
'<div class="LC_error">'. |
&mt('There was a problem removing a lockfile.'); |
&mt('There was a problem removing a lockfile.'); |
if ($prefix eq 'smppg') { |
if ($prefix eq 'smppg') { |
$lockerrorsref->{$prefix} .= |
$lockerrorsref->{$prefix} .= |
&mt('This will prevent creation of additional simple pages in this course.'); |
&mt('This will prevent creation of additional simple pages in this course.'); |
} else { |
} else { |
$lockerrorsref->{$prefix} .= &mt('This will prevent creation of additional bulletin boards in this course.'); |
$lockerrorsref->{$prefix} .= &mt('This will prevent creation of additional bulletin boards in this course.'); |
Line 1505 sub url_paste_fixups {
|
Line 1505 sub url_paste_fixups {
|
} |
} |
} |
} |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/.+$}) { |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/.+$}) { |
next if ($skip); |
next if ($skip); |
my $srcdom = $1; |
my $srcdom = $1; |
my $srcnum = $2; |
my $srcnum = $2; |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
Line 2017 sub editor {
|
Line 2017 sub editor {
|
\%paste_errors); |
\%paste_errors); |
if (ref($pastemsgarray) eq 'ARRAY') { |
if (ref($pastemsgarray) eq 'ARRAY') { |
if (@{$pastemsgarray} > 0) { |
if (@{$pastemsgarray} > 0) { |
|
|
$r->print('<p class="LC_info">'. |
$r->print('<p class="LC_info">'. |
join('<br />',@{$pastemsgarray}). |
join('<br />',@{$pastemsgarray}). |
'</p>'); |
'</p>'); |
Line 2063 sub editor {
|
Line 2063 sub editor {
|
my ($name,$url,$residx)= |
my ($name,$url,$residx)= |
map { &unescape($_); } split(/\=/,$item); |
map { &unescape($_); } split(/\=/,$item); |
if ($url =~ m{^\Q/uploaded/$coursedom/$coursenum/\E(default|supplemental)_new\.(sequence|page)$}) { |
if ($url =~ m{^\Q/uploaded/$coursedom/$coursenum/\E(default|supplemental)_new\.(sequence|page)$}) { |
my ($suffix,$errortxt,$locknotfreed) = |
my ($suffix,$errortxt,$locknotfreed) = |
&new_timebased_suffix($coursedom,$coursenum,'map',$1,$2); |
&new_timebased_suffix($coursedom,$coursenum,'map',$1,$2); |
if ($locknotfreed) { |
if ($locknotfreed) { |
$r->print($locknotfreed); |
$r->print($locknotfreed); |
Line 2432 sub entryline {
|
Line 2432 sub entryline {
|
my $line=&Apache::loncommon::start_data_table_row(); |
my $line=&Apache::loncommon::start_data_table_row(); |
my ($form_start,$form_end,$form_common); |
my ($form_start,$form_end,$form_common); |
# Edit commands |
# Edit commands |
my ($esc_path, $path, $symb); |
my ($type, $esc_path, $path, $symb); |
|
if ($container eq 'page') { |
|
$type = 'page'; |
|
} else { |
|
$type = 'folder'; |
|
} |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$esc_path=&escape($env{'form.folderpath'}); |
$esc_path=&escape($env{'form.folderpath'}); |
$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
Line 2600 ENDREN
|
Line 2605 ENDREN
|
<form action="/adm/coursedocs" method="post"> |
<form action="/adm/coursedocs" method="post"> |
'; |
'; |
$form_common=(<<END); |
$form_common=(<<END); |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="${type}path" value="$path" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="${type}symb" value="$symb" /> |
<input type="hidden" name="setparms" value="$orderidx" /> |
<input type="hidden" name="setparms" value="$orderidx" /> |
<input type="hidden" name="changeparms" value="0" /> |
<input type="hidden" name="changeparms" value="0" /> |
END |
END |
Line 2609 END
|
Line 2614 END
|
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=up_$index&folderpath=$esc_path&symb=$symb'> |
<a href='/adm/coursedocs?cmd=up_$index&${type}path=$esc_path&${type}symb=$symb'> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=down_$index&folderpath=$esc_path&symb=$symb'> |
<a href='/adm/coursedocs?cmd=down_$index&${type}path=$esc_path&${type}symb=$symb'> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
Line 2857 sub new_timebased_suffix {
|
Line 2862 sub new_timebased_suffix {
|
} |
} |
} |
} |
if ($freedlock ne 'ok') { |
if ($freedlock ne 'ok') { |
$locknotfreed = |
$locknotfreed = |
'<div class="LC_error">'. |
'<div class="LC_error">'. |
&mt('There was a problem removing a lockfile.').' '; |
&mt('There was a problem removing a lockfile.').' '; |
if ($type eq 'map') { |
if ($type eq 'map') { |
Line 3412 sub startContentScreen {
|
Line 3417 sub startContentScreen {
|
if (($mode eq 'navmaps') || ($mode eq 'supplemental')) { |
if (($mode eq 'navmaps') || ($mode eq 'supplemental')) { |
$output .= '<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Content Overview').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Content Overview').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
|
$output .= '<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
} else { |
} else { |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Content Editor').' </b></a></li>'."\n"; |
Line 3478 sub handler {
|
Line 3484 sub handler {
|
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
$help{'Course Roster'} = &Apache::loncommon::help_open_topic('Docs_Course_Roster'); |
$help{'Course Roster'} = &Apache::loncommon::help_open_topic('Docs_Course_Roster'); |
$help{'Web Page'} = &Apache::loncommon::help_open_topic('Docs_Web_Page'); |
$help{'Web Page'} = &Apache::loncommon::help_open_topic('Docs_Web_Page'); |
|
|
my $allowed; |
my $allowed; |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
unless ($r->uri eq '/adm/supplemental') { |
unless ($r->uri eq '/adm/supplemental') { |
Line 3812 sub handler {
|
Line 3818 sub handler {
|
'navc' => 'Table of Contents', |
'navc' => 'Table of Contents', |
'sipa' => 'Simple Course Page', |
'sipa' => 'Simple Course Page', |
'sipr' => 'Simple Problem', |
'sipr' => 'Simple Problem', |
'webp' => 'Blank Web Page (editable)', |
'webp' => 'Blank Web Page (editable)', |
'drbx' => 'Drop Box', |
'drbx' => 'Drop Box', |
'scuf' => 'External Scores (handgrade, upload, clicker)', |
'scuf' => 'External Scores (handgrade, upload, clicker)', |
'bull' => 'Discussion Board', |
'bull' => 'Discussion Board', |
Line 4095 NROSTFORM
|
Line 4101 NROSTFORM
|
$help{'Web Page'} |
$help{'Web Page'} |
</form> |
</form> |
NWEBFORM |
NWEBFORM |
|
|
|
|
my $specialdocumentsform; |
my $specialdocumentsform; |
my @specialdocumentsforma; |
my @specialdocumentsforma; |
Line 4685 sub editing_js {
|
Line 4691 sub editing_js {
|
p_msb => 'Title for the Problem', |
p_msb => 'Title for the Problem', |
p_mdb => 'Title for the Drop Box', |
p_mdb => 'Title for the Drop Box', |
p_mbb => 'Title for the Discussion Board', |
p_mbb => 'Title for the Discussion Board', |
p_mwp => 'Title for Web Page', |
p_mwp => 'Title for Web Page', |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab2 => 'Personal Information Page of ', |
p_mab2 => 'Personal Information Page of ', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt1 => 'Not a valid user:domain', |
Line 4787 function makewebpage(type) {
|
Line 4793 function makewebpage(type) {
|
formname = this.document.forms.newwebpage; |
formname = this.document.forms.newwebpage; |
} |
} |
if (title) { |
if (title) { |
var webpage = formname.importdetail.value; |
var webpage = formname.importdetail.value; |
formname.importdetail.value = escape(title)+'='+webpage; |
formname.importdetail.value = escape(title)+'='+webpage; |
formname.submit(); |
formname.submit(); |
} |
} |