version 1.542, 2013/04/02 20:33:41
|
version 1.543, 2013/04/03 02:00:19
|
Line 2269 sub update_parameter {
|
Line 2269 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 2597 sub editor {
|
Line 2599 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 2649 sub editor {
|
Line 2655 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 2773 sub multiple_check_form {
|
Line 2783 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 3056 END
|
Line 3070 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 3223 END
|
Line 3237 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 3235 $form_common."\n".
|
Line 3252 $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 3313 $form_end;
|
Line 3335 $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 5322 sub editing_js {
|
Line 5353 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 6009 function checkSubmits() {
|
Line 6043 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.changeparms.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 6029 function checkSubmits() {
|
Line 6065 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 6047 function checkSubmits() {
|
Line 6085 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 ((numchanges > 0) || (dosettings == 1)) { |
if (doactions == 1) { |
if (numchanges > 0) { |
if (numchanges > 0) { |
if ((cutwarnings > 0) || (remwarnings > 0)) { |
if ((cutwarnings > 0) || (remwarnings > 0)) { |
if (remwarnings > 0) { |
if (remwarnings > 0) { |
Line 6065 function checkSubmits() {
|
Line 6117 function checkSubmits() {
|
} |
} |
form.submit(); |
form.submit(); |
return true; |
return true; |
} else { |
} |
|
} |
|
if (dosettings == 1) { |
|
if (haschanges == 1) { |
form.submit(); |
form.submit(); |
return true; |
return true; |
} |
} |
} |
} |
|
if ((dosettings == 1) && (doactions == 1)) { |
|
alert("$lt{'noor'}"); |
|
} else { |
|
if (dosettings == 1) { |
|
alert("$lt{'noch'}"); |
|
} else { |
|
alert("$lt{'noac'}"); |
|
} |
|
} |
return false; |
return false; |
} |
} |
|
|