version 1.522.2.28.4.3, 2022/03/23 17:29:29
|
version 1.522.2.28.4.10, 2023/07/06 19:24:31
|
Line 945 function validateParms() {
|
Line 945 function validateParms() {
|
var dlKeyRegExp = /^deeplink_key_/; |
var dlKeyRegExp = /^deeplink_key_/; |
var dlMenusRegExp = /^deeplink_menus_/; |
var dlMenusRegExp = /^deeplink_menus_/; |
var dlCollsRegExp = /^deeplink_colls_/; |
var dlCollsRegExp = /^deeplink_colls_/; |
|
var dlTargetRegExp = /^deeplink_target_/; |
|
var dlExitRegExp = /^deeplink_exit_/; |
|
var dlExitTextRegExp = /^deeplink_exittext_/; |
var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; |
var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; |
if ((document.parmform.elements.length != 'undefined') && (document.parmform.elements.length) != 'null') { |
var numelements = document.parmform.elements.length; |
if (document.parmform.elements.length) { |
if ((typeof(numelements) != 'undefined') && (numelements != null)) { |
for (i=0; i<document.parmform.elements.length; i++) { |
if (numelements) { |
|
for (i=0; i<numelements; i++) { |
var name=document.parmform.elements[i].name; |
var name=document.parmform.elements[i].name; |
if (ipRegExp.test(name)) { |
if (ipRegExp.test(name)) { |
if (ipallowRegExp.test(name)) { |
if (ipallowRegExp.test(name)) { |
Line 970 function validateParms() {
|
Line 974 function validateParms() {
|
if (document.parmform.elements['set_'+identifier].value) { |
if (document.parmform.elements['set_'+identifier].value) { |
possdeny = ','+possdeny; |
possdeny = ','+possdeny; |
} |
} |
|
document.parmform.elements['set_'+identifier].value += possdeny; |
} |
} |
} |
} |
} else if (deeplinkRegExp.test(name)) { |
} else if (deeplinkRegExp.test(name)) { |
Line 1075 function validateParms() {
|
Line 1080 function validateParms() {
|
} |
} |
document.parmform.elements['set_'+identifier].value += posslinkmenu; |
document.parmform.elements['set_'+identifier].value += posslinkmenu; |
} |
} |
|
} else if (dlTargetRegExp.test(name)) { |
|
var identifier = name.replace(dlTargetRegExp,''); |
|
var idx = document.parmform.elements[i].selectedIndex; |
|
if (idx > 0) { |
|
var linktarget = document.parmform.elements[i].options[idx].value |
|
linktarget = linktarget.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
linktarget = ','+linktarget; |
|
} |
|
document.parmform.elements['set_'+identifier].value += linktarget; |
|
} |
|
} else if (dlExitRegExp.test(name)) { |
|
if (document.parmform.elements[i].checked) { |
|
var identifier = name.replace(dlExitRegExp,''); |
|
var posslinkexit = document.parmform.elements[i].value; |
|
posslinkexit = posslinkexit.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posslinkexit = ','+posslinkexit; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posslinkexit; |
|
} |
|
} else if (dlExitTextRegExp.test(name)) { |
|
var identifier = name.replace(dlExitTextRegExp,''); |
|
if ((isRadioSet('deeplink_exit_'+identifier,'yes')) || |
|
(isRadioSet('deeplink_exit_'+identifier,'url'))) { |
|
var posstext = document.parmform.elements[i].value; |
|
posstext = posstext.replace(/^\s+|\s+$/g,''); |
|
var origlength = posstext.length; |
|
posstext = posstext.replace(/[:;'",]/g,''); |
|
var newlength = posstext.length; |
|
if (newlength > 0) { |
|
var change = origlength - newlength; |
|
if (change) { |
|
alert(change+' disallowed character(s) removed from Exit Button text'); |
|
} |
|
if (posstext !== 'Exit Tool') { |
|
posstext = ':'+posstext; |
|
document.parmform.elements['set_'+identifier].value += posstext; |
|
} |
|
} else { |
|
document.parmform.elements['set_'+identifier].value = ''; |
|
if (newlength < origlength) { |
|
alert("An exit link type of 'In use' was selected but the button text value was blank, after removing disallowed characters.\nDisallowed characters are ,\":;'"); |
|
} else { |
|
alert("An exit link type of 'In use' was selected but the button text value was blank.\nPlease enter the text to use."); |
|
} |
|
return false; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 1129 END
|
Line 1183 END
|
} |
} |
|
|
sub done_proctor_js { |
sub done_proctor_js { |
|
my $defaultdone = &mt('Done'); |
|
&js_escape(\$defaultdone); |
return <<"END"; |
return <<"END"; |
function toggleSecret(form,radio,key) { |
function toggleSecret(form,radio,key) { |
var radios = form[radio+key]; |
var radios = form[radio+key]; |
Line 1145 function toggleSecret(form,radio,key) {
|
Line 1201 function toggleSecret(form,radio,key) {
|
document.getElementById('done_'+key+'_proctorkey').value=''; |
document.getElementById('done_'+key+'_proctorkey').value=''; |
} |
} |
} |
} |
|
if (document.getElementById('done_'+key+'_buttontext')) { |
|
if (radios[i].value == '') { |
|
document.getElementById('done_'+key+'_buttontext').value = ''; |
|
} else { |
|
if (document.getElementById('done_'+key+'_buttontext').value == '') { |
|
document.getElementById('done_'+key+'_buttontext').value = '$defaultdone'; |
|
} |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 1207 function toggleDeepLink(form,item,key) {
|
Line 1272 function toggleDeepLink(form,item,key) {
|
keybox.type = 'hidden'; |
keybox.type = 'hidden'; |
} |
} |
} |
} |
|
} else if (item == 'exit') { |
|
if (document.getElementById('deeplinkdiv_'+item+'_'+key)) { |
|
if (radios[i].value == 'no') { |
|
document.getElementById('deeplinkdiv_'+item+'_'+key).style.display = 'none'; |
|
if (document.getElementById('deeplink_exittext_'+key)) { |
|
if (document.getElementById('deeplink_exittext_'+key).value != '') { |
|
document.getElementById('deeplink_exittext_'+key).value = ''; |
|
} |
|
} |
|
} else { |
|
document.getElementById('deeplinkdiv_'+item+'_'+key).style.display = 'inline-block'; |
|
if (document.getElementById('deeplink_exittext_'+key)) { |
|
if (document.getElementById('deeplink_exittext_'+key).value == '') { |
|
document.getElementById('deeplink_exittext_'+key).value = 'Exit Tool'; |
|
} |
|
} |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 1325 sub print_row {
|
Line 1408 sub print_row {
|
$extra = 'ltid_'.$domltistr; |
$extra = 'ltid_'.$domltistr; |
} |
} |
} |
} |
my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom); |
my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider'); |
if (keys(%courselti)) { |
if (keys(%courselti)) { |
foreach my $item (sort { $a <=> $b } keys(%courselti)) { |
foreach my $item (sort { $a <=> $b } keys(%courselti)) { |
if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) { |
if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) { |
Line 1557 sub extractResourceInformation {
|
Line 1640 sub extractResourceInformation {
|
my $srcf=$resource->src(); |
my $srcf=$resource->src(); |
$srcf=~/\.(\w+)$/; |
$srcf=~/\.(\w+)$/; |
$$typep{$id}=$1; |
$$typep{$id}=$1; |
|
my $toolsymb; |
|
if ($srcf =~ /ext\.tool$/) { |
|
$toolsymb = $resource->symb(); |
|
} |
$$keyp{$id}=''; |
$$keyp{$id}=''; |
$$uris{$id}=$srcf; |
$$uris{$id}=$srcf; |
|
|
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys',$toolsymb))) { |
next if ($key!~/^parameter_/); |
next if ($key!~/^parameter_/); |
|
|
# Hidden parameters |
# Hidden parameters |
next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm'); |
next if (&Apache::lonnet::metadata($srcf,$key.'.hidden',$toolsymb) eq 'parm'); |
# |
# |
# allparms is a hash of parameter names |
# allparms is a hash of parameter names |
# |
# |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name',$toolsymb); |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
my ($display,$parmdis); |
my ($display,$parmdis); |
$display = &standard_parameter_names($name); |
$display = &standard_parameter_names($name); |
if ($display eq '') { |
if ($display eq '') { |
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
$display= &Apache::lonnet::metadata($srcf,$key.'.display',$toolsymb); |
$parmdis = $display; |
$parmdis = $display; |
$parmdis =~ s/\s*\[Part.*$//g; |
$parmdis =~ s/\s*\[Part.*$//g; |
} else { |
} else { |
Line 1582 sub extractResourceInformation {
|
Line 1669 sub extractResourceInformation {
|
$$allparms{$name}=$parmdis; |
$$allparms{$name}=$parmdis; |
if (ref($defkeytype)) { |
if (ref($defkeytype)) { |
$$defkeytype{$name}= |
$$defkeytype{$name}= |
&Apache::lonnet::metadata($srcf,$key.'.type'); |
&Apache::lonnet::metadata($srcf,$key.'.type',$toolsymb); |
} |
} |
} |
} |
|
|
# |
# |
# allparts is a hash of all parts |
# allparts is a hash of all parts |
# |
# |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part',$toolsymb); |
$$allparts{$part} = &mt('Part: [_1]',$part); |
$$allparts{$part} = &mt('Part: [_1]',$part); |
# |
# |
# Remember all keys going with this resource |
# Remember all keys going with this resource |
Line 2110 sub displaymenu {
|
Line 2197 sub displaymenu {
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp,$parmlev)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $tree=[]; |
my $tree=[]; |
Line 2158 sub mapmenu {
|
Line 2245 sub mapmenu {
|
} |
} |
} |
} |
# Show it ... |
# Show it ... |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
my $rowattr = ' id="mapmenu"'; |
|
if ($parmlev eq 'general') { |
|
$rowattr .= ' style="display:none"'; |
|
} |
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',$rowattr)); |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $whitespace = |
my $whitespace = |
Line 2807 sub assessparms {
|
Line 2898 sub assessparms {
|
|
|
# ----- Start Parameter Selection |
# ----- Start Parameter Selection |
|
|
# Hide parm selection? |
# Hide parm selection and possibly table? |
|
my ($tablejs,$tabledivsty); |
|
if (((($env{'form.uname'} ne '') || ($env{'form.id'} ne '')) && ($uname eq '')) && |
|
($env{'form.dis'}) && ($pssymb eq '')) { |
|
$tablejs = 'document.getElementById('."'parmtable'".').style.display = "";'; |
|
$tabledivsty = ' style="display:none"'; |
|
} |
$r->print(<<ENDPARMSELSCRIPT); |
$r->print(<<ENDPARMSELSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function parmsel_show() { |
function parmsel_show() { |
document.getElementById('parmsel').style.display = ""; |
document.getElementById('parmsel').style.display = ""; |
document.getElementById('parmsellink').style.display = "none"; |
document.getElementById('parmsellink').style.display = "none"; |
|
$tablejs |
} |
} |
// ]]> |
// ]]> |
</script> |
</script> |
Line 2839 ENDPARMSELSCRIPT
|
Line 2937 ENDPARMSELSCRIPT
|
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
Line 2925 ENDPARMSELSCRIPT
|
Line 3023 ENDPARMSELSCRIPT
|
if ($parm_permission->{'edit'}) { |
if ($parm_permission->{'edit'}) { |
undef($readonly); |
undef($readonly); |
} |
} |
|
$r->print('<div id="parmtable"'.$tabledivsty.'>'); |
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
# |
# |
Line 3044 ENDTABLEHEADFOUR
|
Line 3143 ENDTABLEHEADFOUR
|
my %type= (); |
my %type= (); |
my %default=(); |
my %default=(); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
|
|
my $filter=$env{'form.filter'}; |
my $filter=$env{'form.filter'}; |
foreach (&keysplit($keyp{$rid})) { |
foreach (&keysplit($keyp{$rid})) { |
my $tempkeyp = $_; |
my $tempkeyp = $_; |
if (grep $_ eq $tempkeyp, @catmarker) { |
if (grep $_ eq $tempkeyp, @catmarker) { |
my $parmname=&Apache::lonnet::metadata($uri,$_.'.name'); |
my $parmname=&Apache::lonnet::metadata($uri,$_.'.name',$toolsymb); |
# We may only want certain parameters listed |
# We may only want certain parameters listed |
if ($filter) { |
if ($filter) { |
unless ($filter=~/\Q$parmname\E/) { next; } |
unless ($filter=~/\Q$parmname\E/) { next; } |
} |
} |
$name{$_}=$parmname; |
$name{$_}=$parmname; |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part',$toolsymb); |
|
|
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display',$toolsymb); |
if ($allparms{$name{$_}} ne '') { |
if ($allparms{$name{$_}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3069 ENDTABLEHEADFOUR
|
Line 3172 ENDTABLEHEADFOUR
|
} |
} |
unless ($display{$_}) { $display{$_}=''; } |
unless ($display{$_}) { $display{$_}=''; } |
$display{$_}.=' ('.$name{$_}.')'; |
$display{$_}.=' ('.$name{$_}.')'; |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$default{$_}=&Apache::lonnet::metadata($uri,$_,$toolsymb); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type'); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type',$toolsymb); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title'); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title',$toolsymb); |
} |
} |
} |
} |
my $totalparms=scalar keys %name; |
my $totalparms=scalar keys %name; |
Line 3134 ENDTABLEHEADFOUR
|
Line 3237 ENDTABLEHEADFOUR
|
|
|
#-------------------------------------------- for each map, gather information |
#-------------------------------------------- for each map, gather information |
my $mapid; |
my $mapid; |
foreach $mapid (sort {$maplist{$a} cmp $maplist{$b}} keys %maplist) { |
foreach $mapid (sort { $a <=> $b } keys(%maplist)) { |
my $maptitle = $maplist{$mapid}; |
my $maptitle = $maplist{$mapid}; |
|
|
#----------------------- loop through ids and get all parameter types for map |
#----------------------- loop through ids and get all parameter types for map |
Line 3156 ENDTABLEHEADFOUR
|
Line 3259 ENDTABLEHEADFOUR
|
|
|
if ($map eq $mapid) { |
if ($map eq $mapid) { |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
# $r->print("Keys: $keyp{$rid} <br />\n"); |
# $r->print("Keys: $keyp{$rid} <br />\n"); |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
Line 3172 ENDTABLEHEADFOUR
|
Line 3279 ENDTABLEHEADFOUR
|
|
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb); |
if ($allparms{$name{$tempkeyp}} ne '') { |
if ($allparms{$name{$tempkeyp}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3186 ENDTABLEHEADFOUR
|
Line 3293 ENDTABLEHEADFOUR
|
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb); |
} |
} |
} # end loop through keys |
} # end loop through keys |
} |
} |
Line 3261 ENDTABLEHEADFOUR
|
Line 3368 ENDTABLEHEADFOUR
|
my $rid = $_; |
my $rid = $_; |
|
|
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
# @catmarker contains list of all possible parameters including part #s |
# @catmarker contains list of all possible parameters including part #s |
Line 3275 ENDTABLEHEADFOUR
|
Line 3386 ENDTABLEHEADFOUR
|
$tempkeyp =~ s/_\w+_/_0_/; |
$tempkeyp =~ s/_\w+_/_0_/; |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb); |
if ($allparms{$name{$tempkeyp}} ne '') { |
if ($allparms{$name{$tempkeyp}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3289 ENDTABLEHEADFOUR
|
Line 3400 ENDTABLEHEADFOUR
|
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb); |
} |
} |
} # end loop through keys |
} # end loop through keys |
} # end loop through ids |
} # end loop through ids |
Line 3333 ENDMAPONE
|
Line 3444 ENDMAPONE
|
.'</center>' |
.'</center>' |
); |
); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
|
$r->print('</div>'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
Line 3591 sub parse_listdata_key {
|
Line 3703 sub parse_listdata_key {
|
} |
} |
|
|
sub listdata { |
sub listdata { |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_; |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly,$parmlev)=@_; |
# Start list output |
# Start list output |
|
|
my $oldsection=''; |
my $oldsection=''; |
Line 3703 sub listdata {
|
Line 3815 sub listdata {
|
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
} elsif ($middle) { |
} elsif ($middle) { |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
|
next if (($url =~ /\.(page|sequence)$/) && ($parmlev eq 'full') && ($caller eq 'newoverview')); |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
} |
} |
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
Line 3808 sub date_interval_selector {
|
Line 3921 sub date_interval_selector {
|
$showval %= $factor; |
$showval %= $factor; |
my %select = ((map {$_ => $_} (0..$max)), |
my %select = ((map {$_ => $_} (0..$max)), |
'select_form_order' => [0..$max]); |
'select_form_order' => [0..$max]); |
|
if ($currval eq '') { |
|
unshift(@{$select{'select_form_order'}},''); |
|
$select{''} = ''; |
|
$amount = ''; |
|
} |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
\%select,'',$readonly); |
\%select,'',$readonly); |
$result .= ' '.&mt($name); |
$result .= ' '.&mt($name); |
Line 3815 sub date_interval_selector {
|
Line 3933 sub date_interval_selector {
|
if ($pname eq 'interval') { |
if ($pname eq 'interval') { |
unless ($skipval{'done'}) { |
unless ($skipval{'done'}) { |
my $checkedon = ''; |
my $checkedon = ''; |
|
my $checkedoff = ''; |
my $checkedproc = ''; |
my $checkedproc = ''; |
my $currproctorkey = ''; |
my $currproctorkey = ''; |
my $currprocdisplay = 'hidden'; |
my $currprocdisplay = 'hidden'; |
Line 3822 sub date_interval_selector {
|
Line 3941 sub date_interval_selector {
|
my $checkedoff = ' checked="checked"'; |
my $checkedoff = ' checked="checked"'; |
if ($currval =~ /^(?:\d+)_done$/) { |
if ($currval =~ /^(?:\d+)_done$/) { |
$checkedon = ' checked="checked"'; |
$checkedon = ' checked="checked"'; |
$checkedoff = ''; |
|
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:$/) { |
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:$/) { |
$currdonetext = $1; |
$currdonetext = $1; |
$checkedon = ' checked="checked"'; |
$checkedon = ' checked="checked"'; |
$checkedoff = ''; |
|
} elsif ($currval =~ /^(?:\d+)_done_proctor_(.+)$/) { |
} elsif ($currval =~ /^(?:\d+)_done_proctor_(.+)$/) { |
$currproctorkey = $1; |
$currproctorkey = $1; |
$checkedproc = ' checked="checked"'; |
$checkedproc = ' checked="checked"'; |
$checkedoff = ''; |
|
$currprocdisplay = 'text'; |
$currprocdisplay = 'text'; |
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:_proctor_(.+)$/) { |
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:_proctor_(.+)$/) { |
$currdonetext = $1; |
$currdonetext = $1; |
$currproctorkey = $2; |
$currproctorkey = $2; |
$checkedproc = ' checked="checked"'; |
$checkedproc = ' checked="checked"'; |
$checkedoff = ''; |
|
$currprocdisplay = 'text'; |
$currprocdisplay = 'text'; |
|
} elsif ($currval ne '') { |
|
$checkedoff = ' checked="checked"'; |
|
} else { |
|
$currdonetext = ''; |
} |
} |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
my $disabled; |
my $disabled; |
Line 3854 sub date_interval_selector {
|
Line 3973 sub date_interval_selector {
|
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'. |
|
&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
} |
} |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
Line 3867 sub date_interval_selector {
|
Line 3987 sub date_interval_selector {
|
sub get_date_interval_from_form { |
sub get_date_interval_from_form { |
my ($key) = @_; |
my ($key) = @_; |
my $seconds = 0; |
my $seconds = 0; |
|
my $numnotnull = 0; |
foreach my $which (['days', 86400], |
foreach my $which (['days', 86400], |
['hours', 3600], |
['hours', 3600], |
['minutes', 60], |
['minutes', 60], |
['seconds', 1]) { |
['seconds', 1]) { |
my ($name, $factor) = @{ $which }; |
my ($name, $factor) = @{ $which }; |
if (defined($env{'form.'.$name.'_'.$key})) { |
if (defined($env{'form.'.$name.'_'.$key})) { |
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
unless ($env{'form.'.$name.'_'.$key} eq '') { |
|
$numnotnull ++; |
|
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
|
} |
|
} |
} |
} |
|
if (($key =~ /\.interval$/) && |
|
(($env{'form.done_'.$key} eq '_done') || ($env{'form.done_'.$key} eq '_done_proctor'))) { |
|
if ($env{'form.done_'.$key.'_buttontext'}) { |
|
$env{'form.done_'.$key.'_buttontext'} =~ s/\://g; |
|
$seconds .= '_done:'.$env{'form.done_'.$key.'_buttontext'}.':'; |
|
if ($env{'form.done_'.$key} eq '_done_proctor') { |
|
$seconds .= '_proctor'; |
|
} |
|
} else { |
|
$seconds .= $env{'form.done_'.$key}; |
|
} |
|
if (($env{'form.done_'.$key} eq '_done_proctor') && |
|
($env{'form.done_'.$key.'_proctorkey'})) { |
|
$seconds .= '_'.$env{'form.done_'.$key.'_proctorkey'}; |
|
} |
} |
} |
|
return if (!$numnotnull); |
return $seconds; |
return $seconds; |
} |
} |
|
|
Line 3951 sub string_ip_selector {
|
Line 4092 sub string_ip_selector {
|
|
|
sub string_deeplink_selector { |
sub string_deeplink_selector { |
my ($thiskey, $showval, $readonly) = @_; |
my ($thiskey, $showval, $readonly) = @_; |
my (@components,%values,@current,%titles,%options,%optiontext,%defaults, |
my (@tables,%values,@current,%titles,%options,%optiontext,%defaults, |
%selectnull,%domlti,%crslti,@possmenus); |
%selectnull,%domlti,%crslti,@possmenus,%components); |
@components = ('state','others','listing','scope','protect','menus'); |
@tables = ('upper','lower'); |
|
%components = ( |
|
upper => ['state','others','listing','scope'], |
|
lower => ['protect','menus','target','exit'], |
|
); |
%titles = &Apache::lonlocal::texthash ( |
%titles = &Apache::lonlocal::texthash ( |
state => 'Access status', |
state => 'Access status', |
others => 'Hide other resources', |
others => 'Hide other resources', |
Line 3961 sub string_deeplink_selector {
|
Line 4106 sub string_deeplink_selector {
|
scope => 'Access scope for link', |
scope => 'Access scope for link', |
protect => 'Link protection', |
protect => 'Link protection', |
menus => 'Menu Items Displayed', |
menus => 'Menu Items Displayed', |
|
target => 'Embedded?', |
|
exit => 'Exit Tool Button?', |
); |
); |
%options = ( |
%options = ( |
state => ['only','off','both'], |
state => ['only','off','both'], |
Line 3969 sub string_deeplink_selector {
|
Line 4116 sub string_deeplink_selector {
|
scope => ['res','map','rec'], |
scope => ['res','map','rec'], |
protect => ['none','key','ltid','ltic'], |
protect => ['none','key','ltid','ltic'], |
menus => ['std','colls'], |
menus => ['std','colls'], |
|
target => ['_self','_top'], |
|
exit => ['no','yes','url'], |
); |
); |
%optiontext = &Apache::lonlocal::texthash ( |
%optiontext = &Apache::lonlocal::texthash ( |
only => 'deep only', |
only => 'deep only', |
Line 3990 sub string_deeplink_selector {
|
Line 4139 sub string_deeplink_selector {
|
ltid => 'LTI access (domain)' , |
ltid => 'LTI access (domain)' , |
std => 'Standard (all menus)', |
std => 'Standard (all menus)', |
colls => 'Numbered collection', |
colls => 'Numbered collection', |
|
_self => 'Embedded', |
|
_top => 'Not embedded', |
|
no => 'Not in use', |
|
yes => 'In use, no URL redirect', |
|
url => 'In use, redirect to URL', |
); |
); |
%selectnull = &Apache::lonlocal::texthash ( |
%selectnull = &Apache::lonlocal::texthash ( |
ltic => 'Select Launcher', |
ltic => 'Select Launcher', |
Line 4005 sub string_deeplink_selector {
|
Line 4159 sub string_deeplink_selector {
|
($values{'scope'}) = ($current[3] =~ /^(res|map|rec)$/); |
($values{'scope'}) = ($current[3] =~ /^(res|map|rec)$/); |
($values{'protect'}) = ($current[4] =~ /^(key:[a-zA-Z\d_.!\@#\$%^&*()+=-]+|ltic:\d+|ltid:\d+)$/); |
($values{'protect'}) = ($current[4] =~ /^(key:[a-zA-Z\d_.!\@#\$%^&*()+=-]+|ltic:\d+|ltid:\d+)$/); |
($values{'menus'}) = ($current[5] =~ /^(\d+)$/); |
($values{'menus'}) = ($current[5] =~ /^(\d+)$/); |
|
($values{'target'}) = ($current[6] =~ /^(_self|_top)$/); |
|
($values{'exit'}) = ($current[7] =~ /^((?:(?:yes|url)(?:|\:[^:;"',]+))|no)$/); |
} else { |
} else { |
$defaults{'state'} = 'off', |
$defaults{'state'} = 'off', |
$defaults{'others'} = 'unhide', |
$defaults{'others'} = 'unhide', |
Line 4012 sub string_deeplink_selector {
|
Line 4168 sub string_deeplink_selector {
|
$defaults{'scope'} = 'res'; |
$defaults{'scope'} = 'res'; |
$defaults{'protect'} = 'none'; |
$defaults{'protect'} = 'none'; |
$defaults{'menus'} = '0'; |
$defaults{'menus'} = '0'; |
|
$defaults{'target'} = '_top'; |
|
$defaults{'exit'} = 'yes'; |
} |
} |
my $disabled; |
my $disabled; |
if ($readonly) { |
if ($readonly) { |
Line 4019 sub string_deeplink_selector {
|
Line 4177 sub string_deeplink_selector {
|
} |
} |
my %courselti = |
my %courselti = |
&Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'}, |
&Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
'provider'); |
foreach my $item (keys(%courselti)) { |
foreach my $item (keys(%courselti)) { |
if (ref($courselti{$item}) eq 'HASH') { |
if (ref($courselti{$item}) eq 'HASH') { |
$crslti{$item} = $courselti{$item}{'name'}; |
$crslti{$item} = $courselti{$item}{'name'}; |
Line 4042 sub string_deeplink_selector {
|
Line 4201 sub string_deeplink_selector {
|
} |
} |
} |
} |
|
|
my $output = '<input type="hidden" name="set_'.$thiskey.'" /><table><tr>'; |
my $output = '<input type="hidden" name="set_'.$thiskey.'" />'; |
foreach my $item (@components) { |
foreach my $table ('upper','lower') { |
$output .= '<th>'.$titles{$item}.'</th>'; |
next unless (ref($components{$table}) eq 'ARRAY'); |
} |
$output .= '<table width="100%"><tr>'; |
$output .= '</tr><tr>'; |
foreach my $item (@{$components{$table}}) { |
foreach my $item (@components) { |
$output .= '<th>'.$titles{$item}.'</th>'; |
$output .= '<td>'; |
} |
if (($item eq 'protect') || ($item eq 'menus')) { |
$output .= '</tr><tr>'; |
my $selected = $values{$item}; |
foreach my $item (@{$components{$table}}) { |
foreach my $option (@{$options{$item}}) { |
$output .= '<td>'; |
if ($item eq 'protect') { |
if (($item eq 'protect') || ($item eq 'menus') || ($item eq 'exit')) { |
if ($option eq 'ltid') { |
my $selected = $values{$item}; |
next unless (keys(%domlti)); |
foreach my $option (@{$options{$item}}) { |
} elsif ($option eq 'ltic') { |
if ($item eq 'protect') { |
next unless (keys(%crslti)); |
if ($option eq 'ltid') { |
} |
next unless (keys(%domlti)); |
} elsif (($item eq 'menus') && ($option eq 'colls')) { |
} elsif ($option eq 'ltic') { |
next unless (@possmenus); |
next unless (keys(%crslti)); |
} |
} |
my $checked; |
} elsif (($item eq 'menus') && ($option eq 'colls')) { |
if ($item eq 'menus') { |
next unless (@possmenus); |
if (($selected =~ /^\d+$/) && (@possmenus) && |
} |
(grep(/^\Q$selected\E$/,@possmenus))) { |
my $checked; |
if ($option eq 'colls') { |
if ($item eq 'menus') { |
|
if (($selected =~ /^\d+$/) && (@possmenus) && |
|
(grep(/^\Q$selected\E$/,@possmenus))) { |
|
if ($option eq 'colls') { |
|
$checked = ' checked="checked"'; |
|
} |
|
} elsif (($option eq 'std') && ($selected == 0) && ($selected ne '')) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
} elsif (($option eq 'std') && ($selected == 0) && ($selected ne '')) { |
} elsif ($selected =~ /^\Q$option\E/) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
} elsif ($selected =~ /^\Q$option\E/) { |
my $onclick; |
$checked = ' checked="checked"'; |
unless ($readonly) { |
} |
my $esc_key = &js_escape($thiskey); |
my $onclick; |
$onclick = ' onclick="toggleDeepLink(this.form,'."'$item','$esc_key'".');"'; |
unless ($readonly) { |
} |
my $esc_key = &js_escape($thiskey); |
$output .= '<span class="LC_nobreak"><label>'. |
$onclick = ' onclick="toggleDeepLink(this.form,'."'$item','$esc_key'".');"'; |
'<input type="radio" name="deeplink_'.$item.'_'.$thiskey.'" value="'.$option.'"'.$onclick.$disabled.$checked.' />'."\n". |
} |
$optiontext{$option}.'</label>'; |
$output .= '<span class="LC_nobreak"><label>'. |
if (($item eq 'protect') && ($option eq 'key')) { |
'<input type="radio" name="deeplink_'.$item.'_'.$thiskey.'" value="'.$option.'"'.$onclick.$disabled.$checked.' />'."\n". |
my $visibility="hidden"; |
$optiontext{$option}.'</label>'; |
my $currkey; |
if (($item eq 'protect') && ($option eq 'key')) { |
if ($checked) { |
my $visibility="hidden"; |
$visibility = "text"; |
my $currkey; |
$currkey = (split(/\:/,$values{$item}))[1]; |
if ($checked) { |
|
$visibility = "text"; |
|
$currkey = (split(/\:/,$values{$item}))[1]; |
|
} |
|
$output .= ' '. |
|
'<input type="'.$visibility.'" name="deeplink_'.$option.'_'.$thiskey.'" id="deeplink_'.$option.'_'.$item.'_'.$thiskey.'" value="'.$currkey.'" size="10"'.$disabled.' />'; |
|
} elsif (($option eq 'ltic') || ($option eq 'ltid') || ($option eq 'colls')) { |
|
my $display="none"; |
|
my ($current,$blankcheck,@possibles); |
|
if ($checked) { |
|
$display = 'inline-block'; |
|
if (($option eq 'ltic') || ($option eq 'ltid')) { |
|
$current = (split(/\:/,$selected))[1]; |
|
} else { |
|
$current = $selected; |
|
} |
} |
} else { |
$output .= ' '. |
$blankcheck = ' selected="selected"'; |
'<input type="'.$visibility.'" name="deeplink_'.$option.'_'.$thiskey.'" id="deeplink_'.$option.'_'.$item.'_'.$thiskey.'" value="'.$currkey.'" size="10"'.$disabled.' />'; |
} |
} elsif (($option eq 'ltic') || ($option eq 'ltid') || ($option eq 'colls')) { |
if ($option eq 'ltid') { |
my $display="none"; |
@possibles = keys(%domlti); |
my ($current,$blankcheck,@possibles); |
} elsif ($option eq 'ltic') { |
if ($checked) { |
@possibles = keys(%crslti); |
$display = 'inline-block'; |
} else { |
if (($option eq 'ltic') || ($option eq 'ltid')) { |
@possibles = @possmenus; |
$current = (split(/\:/,$selected))[1]; |
} |
} else { |
$output .= '<div id="deeplinkdiv_'.$option.'_'.$item.'_'.$thiskey.'"'. |
$current = $selected; |
' style="display: '.$display.'"> <select name="'. |
} |
'deeplink_'.$option.'_'.$thiskey.'"'.$disabled.'>'; |
} else { |
if (@possibles > 1) { |
$blankcheck = ' selected="selected"'; |
$output .= '<option value=""'.$blankcheck.'>'.$selectnull{$option}. |
|
'</option>'."\n"; |
|
} |
|
foreach my $poss (sort { $a <=> $b } @possibles) { |
|
my $selected; |
|
if (($poss == $current) || (scalar(@possibles) ==1)) { |
|
$selected = ' selected="selected"'; |
|
} |
} |
my $shown = $poss; |
|
if ($option eq 'ltid') { |
if ($option eq 'ltid') { |
$shown = $domlti{$poss}; |
@possibles = keys(%domlti); |
} elsif ($option eq 'ltic') { |
} elsif ($option eq 'ltic') { |
$shown = $crslti{$poss}; |
@possibles = keys(%crslti); |
|
} else { |
|
@possibles = @possmenus; |
} |
} |
$output .= '<option value="'.$poss.'"'.$selected.'>'.$shown.'</option>'; |
$output .= '<div id="deeplinkdiv_'.$option.'_'.$item.'_'.$thiskey.'"'. |
|
' style="display: '.$display.'"> <select name="'. |
|
'deeplink_'.$option.'_'.$thiskey.'"'.$disabled.'>'; |
|
if (@possibles > 1) { |
|
$output .= '<option value=""'.$blankcheck.'>'.$selectnull{$option}. |
|
'</option>'."\n"; |
|
} |
|
foreach my $poss (sort { $a <=> $b } @possibles) { |
|
my $selected; |
|
if (($poss == $current) || (scalar(@possibles) ==1)) { |
|
$selected = ' selected="selected"'; |
|
} |
|
my $shown = $poss; |
|
if ($option eq 'ltid') { |
|
$shown = $domlti{$poss}; |
|
} elsif ($option eq 'ltic') { |
|
$shown = $crslti{$poss}; |
|
} |
|
$output .= '<option value="'.$poss.'"'.$selected.'>'.$shown.'</option>'; |
|
} |
|
$output .= '</select></div>'; |
} |
} |
$output .= '</select></div>'; |
$output .= '</span> '; |
} |
} |
$output .= '</span> '; |
if ($item eq 'exit') { |
} |
my $exitsty = 'none'; |
} else { |
my $displayval; |
my $selected = $values{$item}; |
if ($values{$item} =~ /^(yes|url)/) { |
my $defsel; |
$exitsty = 'inline-block'; |
if ($selected eq '') { |
my $currval = (split(/\:/,$values{$item}))[1]; |
$defsel = ' selected="selected"'; |
if ($currval eq '') { |
} |
$displayval = 'Exit Tool'; |
$output .= '<select name="deeplink_'.$item.'_'.$thiskey.'"'.$disabled.'>'."\n". |
} else { |
'<option value=""'.$defsel.'>'.&mt('Please select').'</option>'."\n"; |
$displayval = $currval; |
foreach my $option (@{$options{$item}}) { |
} |
$output .= '<option value="'.$option.'"'; |
} |
if ($option eq $selected) { |
$output .= '<div id="deeplinkdiv_'.$item.'_'.$thiskey.'"'. |
$output .= ' selected="selected"'; |
' style="display: '.$exitsty.'"><br />'.&mt('Button text').': '. |
|
'<input type="text" name="deeplink_exittext_'.$thiskey.'"'. |
|
' id="deeplink_exittext_'.$thiskey.'" value="'.$displayval.'"'. |
|
' size="10"'.$disabled.' /></div>'; |
} |
} |
$output .= '>'.$optiontext{$option}.'</option>'; |
} else { |
} |
my $selected = $values{$item}; |
$output .= '</select>'; |
my $defsel; |
|
if ($selected eq '') { |
|
$defsel = ' selected="selected"'; |
|
} |
|
$output .= '<select name="deeplink_'.$item.'_'.$thiskey.'"'.$disabled.'>'."\n". |
|
'<option value=""'.$defsel.'>'.&mt('Please select').'</option>'."\n"; |
|
foreach my $option (@{$options{$item}}) { |
|
$output .= '<option value="'.$option.'"'; |
|
if ($option eq $selected) { |
|
$output .= ' selected="selected"'; |
|
} |
|
$output .= '>'.$optiontext{$option}.'</option>'; |
|
} |
|
$output .= '</select>'; |
|
} |
|
$output .= '</td>'; |
|
} |
|
$output .= '</tr></table>'."\n"; |
|
if ($table eq 'upper') { |
|
$output .= '<br />'; |
} |
} |
$output .= '</td>'; |
|
} |
} |
$output .= '</tr></table>'."\n"; |
|
return $output; |
return $output; |
} |
} |
|
|
Line 4191 my %strings =
|
Line 4375 my %strings =
|
=> [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'], |
=> [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'], |
['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], |
['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], |
'string_deeplink' |
'string_deeplink' |
=> [['on','Set choices for link protection, resource listing, access scope, and shown menu items']], |
=> [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']], |
); |
); |
|
|
my %stringmatches = ( |
my %stringmatches = ( |
Line 4199 my %stringmatches = (
|
Line 4383 my %stringmatches = (
|
=> [['_allowfrom_','[^\!]+'], |
=> [['_allowfrom_','[^\!]+'], |
['_denyfrom_','\!']], |
['_denyfrom_','\!']], |
'string_deeplink' |
'string_deeplink' |
=> [['on','^(only|off|both)\,(hide|unhide)\,(full|absent|grades|details|datestatus)\,(res|map|rec)\,(none|key\:\w+|ltic\:\d+|ltid\:\d+)\,(\d+|)$']], |
=> [['on','^(only|off|both)\,(hide|unhide)\,(full|absent|grades|details|datestatus)\,(res|map|rec)\,(none|key\:\w+|ltic\:\d+|ltid\:\d+)\,(\d+|)\,_(self|top),(yes|url|no)(|:[^:;\'",]+)$']], |
); |
); |
|
|
my %stringtypes = ( |
my %stringtypes = ( |
Line 4440 sub newoverview {
|
Line 4624 sub newoverview {
|
'. |
'. |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&showhide_js()."\n". |
&showhide_js()."\n". |
|
&validateparms_js()."\n". |
|
&ipacc_boxes_js()."\n". |
&done_proctor_js()."\n". |
&done_proctor_js()."\n". |
&deeplink_js()."\n". |
&deeplink_js()."\n". |
'// ]]> |
'// ]]> |
Line 4450 sub newoverview {
|
Line 4636 sub newoverview {
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform" onsubmit="return validateParms();"> |
ENDOVER |
ENDOVER |
my @ids=(); |
my @ids=(); |
my %typep=(); |
my %typep=(); |
Line 4516 ENDOVER
|
Line 4702 ENDOVER
|
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp); |
|
} |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
Line 4582 ENDOVER
|
Line 4766 ENDOVER
|
|
|
# List data |
# List data |
|
|
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly); |
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly,$parmlev); |
} |
} |
$r->print(&tableend()); |
$r->print(&tableend()); |
unless ($readonly) { |
unless ($readonly) { |
Line 4635 sub overview {
|
Line 4819 sub overview {
|
my $js = '<script type="text/javascript">'."\n". |
my $js = '<script type="text/javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
&done_proctor_js()."\n". |
&done_proctor_js()."\n". |
|
&validateparms_js()."\n". |
|
&ipacc_boxes_js()."\n". |
&deeplink_js()."\n". |
&deeplink_js()."\n". |
'// ]]>'."\n". |
'// ]]>'."\n". |
'</script>'."\n"; |
'</script>'."\n"; |
Line 4647 sub overview {
|
Line 4833 sub overview {
|
my $start_page=&Apache::loncommon::start_page('Modify Parameters',$js); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters',$js); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform" onsubmit="return validateParms();">'); |
|
|
# Store modified |
# Store modified |
unless ($readonly) { |
unless ($readonly) { |
Line 5754 sub parm_change_log {
|
Line 5940 sub parm_change_log {
|
$parmitem = &mt($parmitem); |
$parmitem = &mt($parmitem); |
$output .= &mt('Type: [_1]',$parmitem); |
$output .= &mt('Type: [_1]',$parmitem); |
} else { |
} else { |
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what), |
my $toolsymb; |
|
if ($middle =~ /ext\.tool$/) { |
|
$toolsymb = $middle; |
|
} |
|
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what,$toolsymb), |
$uname,$udom,$issection,$issection,$courseopt); |
$uname,$udom,$issection,$issection,$courseopt); |
my $showvalue = $value; |
my $showvalue = $value; |
if ($istype{$parmname} eq '') { |
if ($istype{$parmname} eq '') { |