--- loncom/interface/lonparmset.pm 2022/05/03 23:46:33 1.612 +++ loncom/interface/lonparmset.pm 2022/05/24 16:23:03 1.613 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.612 2022/05/03 23:46:33 raeburn Exp $ +# $Id: lonparmset.pm,v 1.613 2022/05/24 16:23:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1252,6 +1252,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) { @@ -1406,6 +1407,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; + } } } } @@ -5156,7 +5168,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', @@ -5164,6 +5176,7 @@ sub string_deeplink_selector { scope => 'Access scope for link', protect => 'Link protection', menus => 'Menu Items Displayed', + target => 'Embedded?', ); %options = ( state => ['only','off','both'], @@ -5172,6 +5185,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', @@ -5193,6 +5207,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', @@ -5208,6 +5224,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', @@ -5215,6 +5232,7 @@ sub string_deeplink_selector { $defaults{'scope'} = 'res'; $defaults{'protect'} = 'none'; $defaults{'menus'} = '0'; + $defaults{'target'} = '_top'; } my $disabled; if ($readonly) { @@ -5396,7 +5414,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']], ); @@ -5407,7 +5425,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 = (