version 1.538, 2013/03/31 22:36:01
|
version 1.551, 2013/05/25 21:56:23
|
Line 340 sub group_import {
|
Line 340 sub group_import {
|
} |
} |
my $initialtext = &mt('Replace with your own content.'); |
my $initialtext = &mt('Replace with your own content.'); |
my $newhtml = <<END; |
my $newhtml = <<END; |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html> |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
|
<head> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
<title>$name</title> |
<title>$name</title> |
</head> |
</head> |
<body bgcolor="#ffffff"> |
<body bgcolor="#ffffff"> |
Line 490 sub docs_change_log {
|
Line 488 sub docs_change_log {
|
} |
} |
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath eq '') { |
if ($folderpath eq '') { |
$folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Content').':::::'); |
$folderpath = 'default&'.&escape(&mt('Main Content').':::::'); |
} |
} |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
Line 834 sub print_paste_buffer {
|
Line 832 sub print_paste_buffer {
|
$othercourse = 1; |
$othercourse = 1; |
if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) { |
if ($canpaste) { |
if ($canpaste) { |
$othercrs = '<br />'.&mt('(from another course).'); |
$othercrs = '<br />'.&mt('(from another course)'); |
} |
} |
} else { |
} else { |
$canpaste = 0; |
$canpaste = 0; |
Line 902 sub print_paste_buffer {
|
Line 900 sub print_paste_buffer {
|
my ($pasteform,$form_start,$buttons,$form_end); |
my ($pasteform,$form_start,$buttons,$form_end); |
if ($pasteitems) { |
if ($pasteitems) { |
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post">'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post" onsubmit="return validateClipboard();">'; |
if (@pasteable) { |
if (@pasteable) { |
$buttons = '<input type="submit" name="pastemarked" value="'.&mt('Paste selected').'" />'.(' 'x2); |
$buttons = '<input type="submit" name="pastemarked" value="'.&mt('Paste selected').'" />'.(' 'x2); |
} |
} |
Line 1009 sub paste_popup_js {
|
Line 1007 sub paste_popup_js {
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
show => 'Show Options', |
show => 'Show Options', |
hide => 'Hide Options', |
hide => 'Hide Options', |
|
none => 'No items selected from clipboard.', |
); |
); |
return <<"END"; |
return <<"END"; |
|
|
Line 1038 function showOptions(caller,suffix) {
|
Line 1037 function showOptions(caller,suffix) {
|
return; |
return; |
} |
} |
|
|
|
function validateClipboard() { |
|
var numchk = 0; |
|
if (document.pasteform.pasting.length > 1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
if (document.pasteform.pasting[i].checked) { |
|
numchk ++; |
|
} |
|
} |
|
} else { |
|
if (document.pasteform.pasting.type == 'checkbox') { |
|
if (document.pasteform.pasting.checked) { |
|
numchk ++; |
|
} |
|
} |
|
} |
|
if (numchk > 0) { |
|
return true; |
|
} else { |
|
alert("$lt{'none'}"); |
|
return false; |
|
} |
|
} |
|
|
END |
END |
|
|
} |
} |
|
|
|
|
sub do_paste_from_buffer { |
sub do_paste_from_buffer { |
my ($coursenum,$coursedom,$folder,$container,$errors) = @_; |
my ($coursenum,$coursedom,$folder,$container,$errors) = @_; |
|
|
Line 2170 sub update_parameter {
|
Line 2191 sub update_parameter {
|
} |
} |
} |
} |
} else { |
} else { |
map { $allchecked{$which}{$_} = 1; } split(/,/,$env{'form.all'.$which}); |
if ($env{'form.all'.$which}) { |
|
map { $allchecked{$which}{$_} = 1; } split(/,/,$env{'form.all'.$which}); |
|
} |
} |
} |
} |
} |
my $haschanges = 0; |
my $haschanges = 0; |
Line 2244 sub update_parameter {
|
Line 2267 sub update_parameter {
|
|
|
sub handle_edit_cmd { |
sub handle_edit_cmd { |
my ($coursenum,$coursedom) =@_; |
my ($coursenum,$coursedom) =@_; |
return if ($env{'form.cmd'} eq ''); |
if ($env{'form.cmd'} eq '') { |
|
return 0; |
|
} |
my ($cmd,$idx)=split('_',$env{'form.cmd'}); |
my ($cmd,$idx)=split('_',$env{'form.cmd'}); |
|
|
my $ratstr = $LONCAPA::map::resources[$LONCAPA::map::order[$idx]]; |
my $ratstr = $LONCAPA::map::resources[$LONCAPA::map::order[$idx]]; |
Line 2305 sub editor {
|
Line 2330 sub editor {
|
my $jumpto; |
my $jumpto; |
|
|
unless ($supplementalflag) { |
unless ($supplementalflag) { |
$jumpto = "'uploaded/$coursedom/$coursenum/$folder.$container'"; |
$jumpto = "uploaded/$coursedom/$coursenum/$folder.$container"; |
} |
} |
|
|
unless ($allowed) { |
unless ($allowed) { |
Line 2349 sub editor {
|
Line 2374 sub editor {
|
my ($paste_res,$save_error,$pastemsgarray,$lockerror) = |
my ($paste_res,$save_error,$pastemsgarray,$lockerror) = |
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
\%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>'); |
|
} |
|
} |
|
if ($lockerror) { |
|
$r->print('<p class="LC_error">'. |
|
$lockerror. |
|
'</p>'); |
'</p>'); |
} |
} |
if ($save_error ne '') { |
} |
return $save_error; |
if ($lockerror) { |
|
$r->print('<p class="LC_error">'. |
|
$lockerror. |
|
'</p>'); |
|
} |
|
if ($save_error ne '') { |
|
return $save_error; |
|
} |
|
if ($paste_res) { |
|
my %errortext = &Apache::lonlocal::texthash ( |
|
fail => 'Storage of folder contents failed', |
|
failread => 'Reading folder contents failed', |
|
failstore => 'Storage of folder contents failed', |
|
); |
|
if ($errortext{$paste_res}) { |
|
$r->print('<p class="LC_error">'.$errortext{$paste_res}.'</p>'); |
} |
} |
if ($paste_res ne 'ok') { |
|
$r->print('<p class="LC_error">'.$paste_res.'</p>'); |
|
} |
} |
if (keys(%paste_errors) > 0) { |
if (keys(%paste_errors) > 0) { |
$r->print('<p class="LC_warning">'."\n". |
$r->print('<p class="LC_warning">'."\n". |
Line 2566 sub editor {
|
Line 2597 sub editor {
|
|
|
my ($to_show,$output,@allidx,@allmapidx,%filters,%lists,%curr_groups); |
my ($to_show,$output,@allidx,@allmapidx,%filters,%lists,%curr_groups); |
%filters = ( |
%filters = ( |
canremove => [], |
canremove => [], |
cancut => [], |
cancut => [], |
cancopy => [], |
cancopy => [], |
|
hiddenresource => [], |
|
encrypturl => [], |
|
randomorder => [], |
|
randompick => [], |
); |
); |
%curr_groups = &Apache::longroup::coursegroups(); |
%curr_groups = &Apache::longroup::coursegroups(); |
&Apache::loncommon::start_data_table_count(); #setup a row counter |
&Apache::loncommon::start_data_table_count(); #setup a row counter |
Line 2593 sub editor {
|
Line 2628 sub editor {
|
|
|
my $need_save; |
my $need_save; |
if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) { |
if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) { |
my $toolslink = '<table><tr><td>' |
my $toolslink; |
|
if ($allowed || &Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
|
$toolslink = '<table><tr><td>' |
.&Apache::loncommon::help_open_menu('Navigation Screen', |
.&Apache::loncommon::help_open_menu('Navigation Screen', |
'Navigation_Screen',undef,'RAT') |
'Navigation_Screen',undef,'RAT') |
.'</td><td class="LC_middle">'.&mt('Tools:').'</td>' |
.'</td><td class="LC_middle">'.&mt('Tools:').'</td>' |
Line 2603 sub editor {
|
Line 2640 sub editor {
|
.'class="LC_toolbarItem" ' |
.'class="LC_toolbarItem" ' |
.'title="'.&mt('Supplemental Content Editor').'">' |
.'title="'.&mt('Supplemental Content Editor').'">' |
.'</a></li></ul></td></tr></table><br />'; |
.'</a></li></ul></td></tr></table><br />'; |
|
} |
if ($shown) { |
if ($shown) { |
if ($allowed) { |
if ($allowed) { |
$to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll') |
$to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll') |
Line 2618 sub editor {
|
Line 2656 sub editor {
|
if ($folder !~ /^supplemental/) { |
if ($folder !~ /^supplemental/) { |
$lists{'canhide'} = join(',',@allidx); |
$lists{'canhide'} = join(',',@allidx); |
$lists{'canrandomlyorder'} = join(',',@allmapidx); |
$lists{'canrandomlyorder'} = join(',',@allmapidx); |
foreach my $item ('canremove','cancut','cancopy') { |
my @possfilters = ('canremove','cancut','cancopy','hiddenresource','encrypturl', |
|
'randomorder','randompick'); |
|
foreach my $item (@possfilters) { |
if (ref($filters{$item}) eq 'ARRAY') { |
if (ref($filters{$item}) eq 'ARRAY') { |
$lists{$item} = join(',',@{$filters{$item}}); |
if (@{$filters{$item}} > 0) { |
|
$lists{$item} = join(',',@{$filters{$item}}); |
|
} |
} |
} |
} |
} |
if (@allidx > 0) { |
if (@allidx > 0) { |
Line 2662 sub editor {
|
Line 2704 sub editor {
|
} |
} |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
.'<div class="LC_info" id="contentlist">' |
.'<div class="LC_info" id="contentlist">' |
.&mt('Currently no documents.') |
.&mt('Currently empty') |
.'</div>' |
.'</div>' |
.&Apache::loncommon::end_scrollbox(); |
.&Apache::loncommon::end_scrollbox(); |
} |
} |
Line 2675 sub editor {
|
Line 2717 sub editor {
|
.'</div>'; |
.'</div>'; |
} else { |
} else { |
$to_show = '<div class="LC_info" id="contentlist">' |
$to_show = '<div class="LC_info" id="contentlist">' |
.&mt('Currently no documents.') |
.&mt('Currently empty') |
.'</div>' |
.'</div>' |
} |
} |
} |
} |
Line 2742 sub multiple_check_form {
|
Line 2784 sub multiple_check_form {
|
'<input type="hidden" name="allidx" value="'.$listsref->{'canhide'}.'" />'; |
'<input type="hidden" name="allidx" value="'.$listsref->{'canhide'}.'" />'; |
if ($caller eq 'settings') { |
if ($caller eq 'settings') { |
$output .= |
$output .= |
'<input type="hidden" name="allmapidx" value="'.$listsref->{'canrandomlyorder'}.'" />'; |
'<input type="hidden" name="allmapidx" value="'.$listsref->{'canrandomlyorder'}.'" />'."\n". |
|
'<input type="hidden" name="currhiddenresource" value="'.$listsref->{'hiddenresource'}.'" />'."\n". |
|
'<input type="hidden" name="currencrypturl" value="'.$listsref->{'encrypturl'}.'" />'."\n". |
|
'<input type="hidden" name="currrandomorder" value="'.$listsref->{'randomorder'}.'" />'."\n". |
|
'<input type="hidden" name="currrandompick" value="'.$listsref->{'randompick'}.'" />'."\n"; |
} elsif ($caller eq 'actions') { |
} elsif ($caller eq 'actions') { |
$output .= |
$output .= |
'<input type="hidden" name="allremoveidx" id="allremoveidx" value="'.$listsref->{'canremove'}.'" />'. |
'<input type="hidden" name="allremoveidx" id="allremoveidx" value="'.$listsref->{'canremove'}.'" />'. |
Line 3025 END
|
Line 3071 END
|
} |
} |
|
|
if ($denied{'copy'}) { |
if ($denied{'copy'}) { |
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY) |
<span style="visibility: hidden;">$lt{'cp'}</span> |
<span style="visibility: hidden;">$lt{'cp'}</span> |
ENDCOPY |
ENDCOPY |
} else { |
} else { |
Line 3034 ENDCOPY
|
Line 3080 ENDCOPY
|
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden"><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
$form_end |
$form_end |
ENDCOPY |
ENDCOPY |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
Line 3051 ENDCUT
|
Line 3097 ENDCUT
|
$cutlink=(<<ENDCUT); |
$cutlink=(<<ENDCUT); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden"><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
<input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" /> |
|
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
$form_end |
$form_end |
ENDCUT |
ENDCUT |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
Line 3068 ENDREM
|
Line 3115 ENDREM
|
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden"><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
|
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
$form_end |
$form_end |
ENDREM |
ENDREM |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
push(@{$filtersref->{'canremove'}},$orderidx); |
push(@{$filtersref->{'canremove'}},$orderidx); |
} |
} |
} |
} |
unless ($isexternal) { |
$renamelink=(<<ENDREN); |
$renamelink=(<<ENDREN); |
|
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
ENDREN |
ENDREN |
} |
|
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
Line 3100 ENDREN
|
Line 3146 ENDREN
|
$selectbox |
$selectbox |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_commands"><span class="LC_nobreak"> |
<td class="LC_docs_entry_commands LC_nobreak"> |
$removelink |
$removelink |
$cutlink |
$cutlink |
$copylink |
$copylink |
</span> |
|
</td> |
</td> |
END |
END |
} |
} |
Line 3191 END
|
Line 3236 END
|
my $rpckchk; |
my $rpckchk; |
if ($rpicknum) { |
if ($rpicknum) { |
$rpckchk = ' checked="checked"'; |
$rpckchk = ' checked="checked"'; |
|
if (($ishash) && (ref($filtersref->{'randompick'}) eq 'ARRAY')) { |
|
push(@{$filtersref->{'randompick'}},$orderidx.':'.$rpicknum); |
|
} |
} |
} |
my $formname = 'edit_randompick_'.$orderidx; |
my $formname = 'edit_randompick_'.$orderidx; |
$rand_pick_text = |
$rand_pick_text = |
Line 3203 $form_common."\n".
|
Line 3251 $form_common."\n".
|
} |
} |
$rand_pick_text .= '</span></span>'. |
$rand_pick_text .= '</span></span>'. |
$form_end; |
$form_end; |
my $ro_set= |
my $ro_set; |
((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':''); |
if ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i) { |
|
$ro_set = 'checked="checked"'; |
|
if (($ishash) && (ref($filtersref->{'randomorder'}) eq 'ARRAY')) { |
|
push(@{$filtersref->{'randomorder'}},$orderidx); |
|
} |
|
} |
my $formname = 'edit_rorder_'.$orderidx; |
my $formname = 'edit_rorder_'.$orderidx; |
$rand_order_text = |
$rand_order_text = |
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
Line 3281 $form_end;
|
Line 3334 $form_end;
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'hd' => 'Hidden', |
'hd' => 'Hidden', |
'ec' => 'URL hidden'); |
'ec' => 'URL hidden'); |
my $enctext= |
my ($enctext,$hidtext); |
((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="checked"':''); |
if ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) { |
my $hidtext= |
$enctext = ' checked="checked"'; |
((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="checked"':''); |
if (($ishash) && (ref($filtersref->{'encrypturl'}) eq 'ARRAY')) { |
|
push(@{$filtersref->{'encrypturl'}},$orderidx); |
|
} |
|
} |
|
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
|
$hidtext = ' checked="checked"'; |
|
if (($ishash) && (ref($filtersref->{'randomorder'}) eq 'ARRAY')) { |
|
push(@{$filtersref->{'hiddenresource'}},$orderidx); |
|
} |
|
} |
my $formhidden = 'edit_hiddenresource_'.$orderidx; |
my $formhidden = 'edit_hiddenresource_'.$orderidx; |
my $formurlhidden = 'edit_encrypturl_'.$orderidx; |
my $formurlhidden = 'edit_encrypturl_'.$orderidx; |
$line.=(<<ENDPARMS); |
$line.=(<<ENDPARMS); |
Line 3587 sub list_symbs {
|
Line 3649 sub list_symbs {
|
sub verifycontent { |
sub verifycontent { |
my ($r) = @_; |
my ($r) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
$r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents')); |
$r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Content')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Content')); |
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
$r->print('<h4 class="LC_info">'.&mt($crstype.' content verification').'</h4>'); |
$r->print('<h4 class="LC_info">'.&mt($crstype.' content verification').'</h4>'); |
$hashtied=0; |
$hashtied=0; |
Line 3690 sub checkversions {
|
Line 3752 sub checkversions {
|
&changewarning($r,''); |
&changewarning($r,''); |
if ($env{'form.timerange'} eq 'all') { |
if ($env{'form.timerange'} eq 'all') { |
# show all documents |
# show all documents |
$header=&mt('All Documents in '.$crstype); |
$header=&mt('All content in '.$crstype); |
$allsel=' selected="selected"'; |
$allsel=' selected="selected"'; |
foreach my $key (keys(%hash)) { |
foreach my $key (keys(%hash)) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
Line 3968 sub startContentScreen {
|
Line 4030 sub startContentScreen {
|
$output .= '<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </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('Main Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Content Editor').'</b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Content Editor').'</b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'tools')?' class="active"':'').'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'tools')?' class="active"':'').'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'."\n"; |
'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'; |
'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'; |
Line 3989 sub endContentScreen {
|
Line 4051 sub endContentScreen {
|
} |
} |
|
|
sub supplemental_base { |
sub supplemental_base { |
return 'supplemental&'.&escape(&mt('Supplemental '.&Apache::loncommon::course_type().' Content')); |
return 'supplemental&'.&escape(&mt('Supplemental Content')); |
} |
} |
|
|
sub handler { |
sub handler { |
Line 4122 sub handler {
|
Line 4184 sub handler {
|
} |
} |
} elsif ($env{'form.command'} eq 'editdocs') { |
} elsif ($env{'form.command'} eq 'editdocs') { |
$env{'form.folderpath'} = 'default&'. |
$env{'form.folderpath'} = 'default&'. |
&escape(&mt('Main '.$crstype.' Content').':::::'); |
&escape(&mt('Main Content').':::::'); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}}); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}}); |
} elsif ($env{'form.command'} eq 'editsupp') { |
} elsif ($env{'form.command'} eq 'editsupp') { |
$env{'form.folderpath'} = 'supplemental&'. |
$env{'form.folderpath'} = 'supplemental&'. |
Line 4167 sub handler {
|
Line 4229 sub handler {
|
if ($supplementalflag) { |
if ($supplementalflag) { |
$env{'form.folderpath'}=&supplemental_base(); |
$env{'form.folderpath'}=&supplemental_base(); |
} else { |
} else { |
$env{'form.folderpath'}='default'.&escape(&mt('Main '.$crstype.' Content'). |
$env{'form.folderpath'}='default&'.&escape(&mt('Main Content'). |
':::::'); |
':::::'); |
} |
} |
} |
} |
Line 4193 sub handler {
|
Line 4255 sub handler {
|
if ($env{'form.folder'} eq '' || |
if ($env{'form.folder'} eq '' || |
$env{'form.folder'} eq 'supplemental') { |
$env{'form.folder'} eq 'supplemental') { |
$folderpath='default&'. |
$folderpath='default&'. |
&escape(&mt('Main '.$crstype.' Content').':::::'); |
&escape(&mt('Main Content').':::::'); |
} |
} |
} |
} |
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
Line 4518 HIDDENFORM
|
Line 4580 HIDDENFORM
|
if ($folder eq '' || $supplementalflag) { |
if ($folder eq '' || $supplementalflag) { |
$folder='default'; |
$folder='default'; |
$savefolderpath = $env{'form.folderpath'}; |
$savefolderpath = $env{'form.folderpath'}; |
$env{'form.folderpath'}='default&'.&escape(&mt('Content')); |
$env{'form.folderpath'}='default&'.&escape(&mt('Main Content')); |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
} |
} |
Line 5171 sub generate_edit_table {
|
Line 5233 sub generate_edit_table {
|
$form = '<div class="LC_Box" style="margin:0;">'. |
$form = '<div class="LC_Box" style="margin:0;">'. |
'<ul id="navigation'.$tid.'" class="LC_TabContent">'."\n". |
'<ul id="navigation'.$tid.'" class="LC_TabContent">'."\n". |
'<li class="goback">'. |
'<li class="goback">'. |
'<a href="javascript:toContents('.$jumpto.');">'. |
'<a href="javascript:toContents('."'$jumpto'".');">'. |
'<img src="'.$backicon.'" class="LC_icon" style="border: none; vertical-align: top;"'. |
'<img src="'.$backicon.'" class="LC_icon" style="border: none; vertical-align: top;"'. |
' alt="'.$backtext.'" />'.$backtext.'</a></li>'."\n". |
' alt="'.$backtext.'" />'.$backtext.'</a></li>'."\n". |
'<li>'. |
'<li>'. |
Line 5275 sub editing_js {
|
Line 5337 sub editing_js {
|
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr2a => 'Remove[_99]', |
p_rmr2a => 'Remove[_99]', |
p_rmr2b => '?[_99]', |
p_rmr2b => '?[_99]', |
|
p_rmr3a => 'Remove those [_2]', |
|
p_rmr3b => 'items?[_2]', |
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr2a => 'Cut[_98]', |
p_ctr2a => 'Cut[_98]', |
p_ctr2b => '?[_98]', |
p_ctr2b => '?[_98]', |
|
p_ctr3a => 'Cut those[_2]', |
|
p_ctr3b => 'items?[_2]', |
rpck => 'Enter number to pick (e.g., 3)', |
rpck => 'Enter number to pick (e.g., 3)', |
imsfile => 'You must choose an IMS package for import', |
imsfile => 'You must choose an IMS package for import', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
Line 5286 sub editing_js {
|
Line 5352 sub editing_js {
|
titbl => 'Title is blank', |
titbl => 'Title is blank', |
more => '(More ...)', |
more => '(More ...)', |
less => '(Less ...)', |
less => '(Less ...)', |
|
noor => 'No actions selected or changes to settings specified.', |
|
noch => 'No changes to settings specified.', |
|
noac => 'No actions selected.', |
); |
); |
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
Line 5295 sub editing_js {
|
Line 5364 sub editing_js {
|
$main_container_page = 1; |
$main_container_page = 1; |
} |
} |
my $toplevelmain = |
my $toplevelmain = |
&escape(&mt('Main '.$crstype.' Content').':::::'); |
&escape(&mt('Main Content').':::::'); |
my $toplevelsupp = &supplemental_base(); |
my $toplevelsupp = &supplemental_base(); |
|
|
my $backtourl; |
my $backtourl; |
Line 5309 sub editing_js {
|
Line 5378 sub editing_js {
|
if (&Apache::lonnet::is_on_map($res)) { |
if (&Apache::lonnet::is_on_map($res)) { |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='. |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='. |
&HTML::Entities::encode($caller,'<>&"'); |
&HTML::Entities::encode($caller,'<>&"'); |
|
} else { |
|
$backtourl = '/adm/navmaps'; |
} |
} |
} |
} |
} elsif ($env{'docs.exit.'.$env{'request.course.id'}} eq '/adm/menu') { |
} elsif ($env{'docs.exit.'.$env{'request.course.id'}} eq '/adm/menu') { |
Line 5643 function propagateState(form,param) {
|
Line 5714 function propagateState(form,param) {
|
} |
} |
|
|
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) { |
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) { |
|
var dosettings; |
|
var doaction; |
var control = document.togglemultsettings; |
var control = document.togglemultsettings; |
if (context == 'actions') { |
if (context == 'actions') { |
control = document.togglemultactions; |
control = document.togglemultactions; |
|
doaction = 1; |
|
} else { |
|
dosettings = 1; |
} |
} |
if (control.showmultpick.length) { |
if (control) { |
for (var i=0; i<control.showmultpick.length; i++) { |
if (control.showmultpick.length) { |
if (control.showmultpick[i].checked) { |
for (var i=0; i<control.showmultpick.length; i++) { |
if (control.showmultpick[i].value == 0) { |
if (control.showmultpick[i].checked) { |
if (context == 'settings') { |
if (control.showmultpick[i].value == 1) { |
targetform.changeparms.value=param; |
if (context == 'settings') { |
targetform.submit(); |
dosettings = 0; |
} else { |
} else { |
targetform.cmd.value=param+'_'+index; |
doaction = 0; |
targetform.folderpath.value=folderpath; |
|
targetform.markcopy.value=idx+':'+param; |
|
targetform.copyfolder.value=folder+'.'+container; |
|
if (param == 'remove') { |
|
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
|
targetform.markcopy.value=''; |
|
targetform.copyfolder.value=''; |
|
targetform.submit(); |
|
} |
|
} |
|
if (param == 'cut') { |
|
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
|
targetform.submit(); |
|
} |
|
} |
|
if (param == 'copy') { |
|
targetform.submit(); |
|
} |
|
targetform.markcopy.value=''; |
|
targetform.copyfolder.value=''; |
|
targetform.cmd.value=''; |
|
targetform.folderpath.value=''; |
|
} |
|
} else { |
|
if (context == 'actions') { |
|
if (document.getElementById(param+'_'+idx)) { |
|
item = document.getElementById(param+'_'+idx); |
|
if (item.type == 'checkbox') { |
|
if (item.checked) { |
|
item.checked = false; |
|
} else { |
|
item.checked = true; |
|
} |
|
} |
|
} |
} |
} |
} |
} |
} |
} else { |
|
if (document.getElementById(param+'_'+idx)) { |
|
checkbox = document.getElementById(param+'_'+idx); |
|
singleCheck(checkbox,idx,param); |
|
} |
|
} |
} |
} |
} |
} else { |
} |
if (context == 'settings') { |
if (context == 'settings') { |
|
if (dosettings == 1) { |
targetform.changeparms.value=param; |
targetform.changeparms.value=param; |
targetform.submit(); |
targetform.submit(); |
} |
} |
} |
} |
|
if (context == 'actions') { |
|
if (doaction == 1) { |
|
targetform.cmd.value=param+'_'+index; |
|
targetform.folderpath.value=folderpath; |
|
targetform.markcopy.value=idx+':'+param; |
|
targetform.copyfolder.value=folder+'.'+container; |
|
if (param == 'remove') { |
|
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
|
targetform.markcopy.value=''; |
|
targetform.copyfolder.value=''; |
|
targetform.submit(); |
|
} |
|
} |
|
if (param == 'cut') { |
|
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
|
targetform.submit(); |
|
return; |
|
} |
|
} |
|
if (param == 'copy') { |
|
targetform.submit(); |
|
return; |
|
} |
|
targetform.markcopy.value=''; |
|
targetform.copyfolder.value=''; |
|
targetform.cmd.value=''; |
|
targetform.folderpath.value=''; |
|
return; |
|
} else { |
|
if (document.getElementById(param+'_'+idx)) { |
|
item = document.getElementById(param+'_'+idx); |
|
if (item.type == 'checkbox') { |
|
if (item.checked) { |
|
item.checked = false; |
|
} else { |
|
item.checked = true; |
|
singleCheck(item,idx,param); |
|
} |
|
} |
|
} |
|
} |
|
} |
return; |
return; |
} |
} |
|
|
Line 5910 function checkSubmits() {
|
Line 5990 function checkSubmits() {
|
var numchanges = 0; |
var numchanges = 0; |
var form = document.saveactions; |
var form = document.saveactions; |
var doactions = multiActions(); |
var doactions = multiActions(); |
|
var cutwarnings = 0; |
|
var remwarnings = 0; |
if (doactions == 1) { |
if (doactions == 1) { |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
if ((remidxlist != '') && (remidxlist != null)) { |
if ((remidxlist != '') && (remidxlist != null)) { |
Line 5919 function checkSubmits() {
|
Line 6001 function checkSubmits() {
|
if (document.getElementById('remove_'+remidxs[i]).checked) { |
if (document.getElementById('remove_'+remidxs[i]).checked) { |
form.multiremove.value += remidxs[i]+','; |
form.multiremove.value += remidxs[i]+','; |
numchanges ++; |
numchanges ++; |
|
if (document.getElementById('skip_remove_'+remidxs[i])) { |
|
if (document.getElementById('skip_remove_'+remidxs[i]).value == 0) { |
|
remwarnings ++; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 5931 function checkSubmits() {
|
Line 6018 function checkSubmits() {
|
if (document.getElementById('cut_'+cutidxs[i]).checked == true) { |
if (document.getElementById('cut_'+cutidxs[i]).checked == true) { |
form.multicut.value += cutidxs[i]+','; |
form.multicut.value += cutidxs[i]+','; |
numchanges ++; |
numchanges ++; |
|
if (document.getElementById('skip_cut_'+cutidxs[i])) { |
|
if (document.getElementById('skip_cut_'+cutidxs[i]).value == 0) { |
|
cutwarnings ++; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 5952 function checkSubmits() {
|
Line 6044 function checkSubmits() {
|
} |
} |
} |
} |
var dosettings = multiSettings(); |
var dosettings = multiSettings(); |
|
var haschanges = 0; |
if (dosettings == 1) { |
if (dosettings == 1) { |
form.allencrypturl.value = ''; |
form.allencrypturl.value = ''; |
form.allhiddenresource.value = ''; |
form.allhiddenresource.value = ''; |
form.changeparams.value = 'all'; |
form.changeparms.value = 'all'; |
|
var patt=new RegExp(",\$"); |
var allidxlist = document.cumulativesettings.allidx.value; |
var allidxlist = document.cumulativesettings.allidx.value; |
if ((allidxlist != '') && (allidxlist != null)) { |
if ((allidxlist != '') && (allidxlist != null)) { |
var allidxs = allidxlist.split(','); |
var allidxs = allidxlist.split(','); |
Line 5972 function checkSubmits() {
|
Line 6066 function checkSubmits() {
|
} |
} |
} |
} |
} |
} |
|
form.allhiddenresource.value = form.allhiddenresource.value.replace(patt,""); |
|
form.allencrypturl.value = form.allencrypturl.value.replace(patt,""); |
} |
} |
} |
} |
form.allrandompick.value = ''; |
form.allrandompick.value = ''; |
Line 5990 function checkSubmits() {
|
Line 6086 function checkSubmits() {
|
form.allrandomorder.value += allmapidxs[i]+','; |
form.allrandomorder.value += allmapidxs[i]+','; |
} |
} |
} |
} |
|
form.allrandompick.value = form.allrandompick.value.replace(patt,""); |
|
form.allrandomorder.value = form.allrandomorder.value.replace(patt,""); |
|
} |
|
if (document.cumulativesettings.currhiddenresource.value != form.allhiddenresource.value) { |
|
haschanges = 1; |
|
} |
|
if (document.cumulativesettings.currencrypturl.value != form.allencrypturl.value) { |
|
haschanges = 1; |
|
} |
|
if (document.cumulativesettings.currrandomorder.value != form.allrandomorder.value) { |
|
haschanges = 1; |
|
} |
|
if (document.cumulativesettings.currrandompick.value != form.allrandompick.value) { |
|
haschanges = 1; |
|
} |
|
} |
|
if (doactions == 1) { |
|
if (numchanges > 0) { |
|
if ((cutwarnings > 0) || (remwarnings > 0)) { |
|
if (remwarnings > 0) { |
|
if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) { |
|
return false; |
|
} |
|
} |
|
if (cutwarnings > 0) { |
|
if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) { |
|
return false; |
|
} |
|
} |
|
} |
|
form.submit(); |
|
return true; |
|
} |
|
} |
|
if (dosettings == 1) { |
|
if (haschanges == 1) { |
|
form.submit(); |
|
return true; |
|
} |
|
} |
|
if ((dosettings == 1) && (doactions == 1)) { |
|
alert("$lt{'noor'}"); |
|
} else { |
|
if (dosettings == 1) { |
|
alert("$lt{'noch'}"); |
|
} else { |
|
alert("$lt{'noac'}"); |
} |
} |
} |
} |
if ((numchanges > 0) || (dosettings == 1)) { |
|
form.submit(); |
|
return true; |
|
} |
|
return false; |
return false; |
} |
} |
|
|