--- loncom/interface/lonparmset.pm 2022/03/24 16:18:42 1.522.2.28.4.4 +++ loncom/interface/lonparmset.pm 2022/05/27 18:17:11 1.522.2.28.4.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.522.2.28.4.4 2022/03/24 16:18:42 raeburn Exp $ +# $Id: lonparmset.pm,v 1.522.2.28.4.5 2022/05/27 18:17:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -945,6 +945,7 @@ function validateParms() { var dlKeyRegExp = /^deeplink_key_/; var dlMenusRegExp = /^deeplink_menus_/; var dlCollsRegExp = /^deeplink_colls_/; + var dlTargetRegExp = /^deeplink_target_/; var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; if ((document.parmform.elements.length != 'undefined') && (document.parmform.elements.length) != 'null') { if (document.parmform.elements.length) { @@ -1075,6 +1076,17 @@ function validateParms() { } document.parmform.elements['set_'+identifier].value += posslinkmenu; } + } else if (dlTargetRegExp.text(name)) { + var identifier = name.replace(dlTargetExp,''); + var idx = document.parmform.elements[i].selectedIndex; + if (idx > 0) { + var possdeeplink = document.parmform.elements[i].options[idx].value + possdeeplink = possdeeplink.replace(/^\s+|\s+$/g,''); + if (document.parmform.elements['set_'+identifier].value) { + possdeeplink = ','+possdeeplink; + } + document.parmform.elements['set_'+identifier].value += possdeeplink; + } } } } @@ -3962,7 +3974,7 @@ sub string_deeplink_selector { my ($thiskey, $showval, $readonly) = @_; my (@components,%values,@current,%titles,%options,%optiontext,%defaults, %selectnull,%domlti,%crslti,@possmenus); - @components = ('state','others','listing','scope','protect','menus'); + @components = ('state','others','listing','scope','protect','menus','target'); %titles = &Apache::lonlocal::texthash ( state => 'Access status', others => 'Hide other resources', @@ -3970,6 +3982,7 @@ sub string_deeplink_selector { scope => 'Access scope for link', protect => 'Link protection', menus => 'Menu Items Displayed', + target => 'Embedded?', ); %options = ( state => ['only','off','both'], @@ -3978,6 +3991,7 @@ sub string_deeplink_selector { scope => ['res','map','rec'], protect => ['none','key','ltid','ltic'], menus => ['std','colls'], + target => ['_self','_top'], ); %optiontext = &Apache::lonlocal::texthash ( only => 'deep only', @@ -3999,6 +4013,8 @@ sub string_deeplink_selector { ltid => 'LTI access (domain)' , std => 'Standard (all menus)', colls => 'Numbered collection', + _self => 'Embedded', + _top => 'Not embedded', ); %selectnull = &Apache::lonlocal::texthash ( ltic => 'Select Launcher', @@ -4014,6 +4030,7 @@ sub string_deeplink_selector { ($values{'scope'}) = ($current[3] =~ /^(res|map|rec)$/); ($values{'protect'}) = ($current[4] =~ /^(key:[a-zA-Z\d_.!\@#\$%^&*()+=-]+|ltic:\d+|ltid:\d+)$/); ($values{'menus'}) = ($current[5] =~ /^(\d+)$/); + ($values{'target'}) = ($current[6] =~ /^(_self|_top)$/); } else { $defaults{'state'} = 'off', $defaults{'others'} = 'unhide', @@ -4021,6 +4038,7 @@ sub string_deeplink_selector { $defaults{'scope'} = 'res'; $defaults{'protect'} = 'none'; $defaults{'menus'} = '0'; + $defaults{'target'} = '_top'; } my $disabled; if ($readonly) { @@ -4200,7 +4218,7 @@ my %strings = => [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'], ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], '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, and embedding']], ); my %stringmatches = ( @@ -4208,7 +4226,7 @@ my %stringmatches = ( => [['_allowfrom_','[^\!]+'], ['_denyfrom_','\!']], '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)$']], ); my %stringtypes = (