version 1.610, 2022/04/30 19:29:43
|
version 1.615, 2022/07/03 04:31:07
|
Line 1252 function validateParms() {
|
Line 1252 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 patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; |
var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; |
if ((document.parmform.elements.length != 'undefined') && (document.parmform.elements.length) != 'null') { |
if ((document.parmform.elements.length != 'undefined') && (document.parmform.elements.length) != 'null') { |
if (document.parmform.elements.length) { |
if (document.parmform.elements.length) { |
Line 1406 function validateParms() {
|
Line 1407 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 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; |
|
} |
} |
} |
} |
} |
} |
} |
Line 1461 END
|
Line 1473 END
|
|
|
# Javascript function toggleSecret, for overview mode. |
# Javascript function toggleSecret, for overview mode. |
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 1477 function toggleSecret(form,radio,key) {
|
Line 1491 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 4879 sub listdata {
|
Line 4902 sub listdata {
|
} |
} |
if ($is_map) { |
if ($is_map) { |
my $leveltitle = &mt('Folder/Map'); |
my $leveltitle = &mt('Folder/Map'); |
my $title = &Apache::lonnet::gettitle($1); |
my $title = &Apache::lonnet::gettitle($mapurl); |
if (ref($hash_for_realm) eq 'HASH') { |
if (ref($hash_for_realm) eq 'HASH') { |
if ($hash_for_realm->{$mapurl} eq '1') { |
if ($hash_for_realm->{$mapurl} eq '1') { |
$title = &mt('Main Content'); |
$title = &mt('Main Content'); |
Line 5026 sub listdata {
|
Line 5049 sub listdata {
|
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$/) && |
if (($key =~ /\.interval$/) && |
Line 5051 sub get_date_interval_from_form {
|
Line 5078 sub get_date_interval_from_form {
|
$seconds .= '_'.$env{'form.done_'.$key.'_proctorkey'}; |
$seconds .= '_'.$env{'form.done_'.$key.'_proctorkey'}; |
} |
} |
} |
} |
|
return if (!$numnotnull); |
return $seconds; |
return $seconds; |
} |
} |
|
|
Line 5140 sub string_deeplink_selector {
|
Line 5168 sub string_deeplink_selector {
|
my ($thiskey, $showval, $readonly) = @_; |
my ($thiskey, $showval, $readonly) = @_; |
my (@components,%values,@current,%titles,%options,%optiontext,%defaults, |
my (@components,%values,@current,%titles,%options,%optiontext,%defaults, |
%selectnull,%domlti,%crslti,@possmenus); |
%selectnull,%domlti,%crslti,@possmenus); |
@components = ('state','others','listing','scope','protect','menus'); |
@components = ('state','others','listing','scope','protect','menus','target'); |
%titles = &Apache::lonlocal::texthash ( |
%titles = &Apache::lonlocal::texthash ( |
state => 'Access status', |
state => 'Access status', |
others => 'Hide other resources', |
others => 'Hide other resources', |
Line 5148 sub string_deeplink_selector {
|
Line 5176 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?', |
); |
); |
%options = ( |
%options = ( |
state => ['only','off','both'], |
state => ['only','off','both'], |
Line 5156 sub string_deeplink_selector {
|
Line 5185 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'], |
); |
); |
%optiontext = &Apache::lonlocal::texthash ( |
%optiontext = &Apache::lonlocal::texthash ( |
only => 'deep only', |
only => 'deep only', |
Line 5177 sub string_deeplink_selector {
|
Line 5207 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', |
); |
); |
%selectnull = &Apache::lonlocal::texthash ( |
%selectnull = &Apache::lonlocal::texthash ( |
ltic => 'Select Launcher', |
ltic => 'Select Launcher', |
Line 5192 sub string_deeplink_selector {
|
Line 5224 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)$/); |
} else { |
} else { |
$defaults{'state'} = 'off', |
$defaults{'state'} = 'off', |
$defaults{'others'} = 'unhide', |
$defaults{'others'} = 'unhide', |
Line 5199 sub string_deeplink_selector {
|
Line 5232 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'; |
} |
} |
my $disabled; |
my $disabled; |
if ($readonly) { |
if ($readonly) { |
Line 5380 my %strings =
|
Line 5414 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, and embedding']], |
); |
); |
|
|
|
|
Line 5391 my %stringmatches = (
|
Line 5425 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)$']], |
); |
); |
|
|
my %stringtypes = ( |
my %stringtypes = ( |
Line 5711 sub date_interval_selector {
|
Line 5745 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 5718 sub date_interval_selector {
|
Line 5757 sub date_interval_selector {
|
if ($name eq 'interval') { |
if ($name 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'; |
my $currdonetext = &mt('Done'); |
my $currdonetext = &mt('Done'); |
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 5757 sub date_interval_selector {
|
Line 5796 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" id="done_'.$thiskey.'_buttontext" value="'. |
|
&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
} |
} |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
Line 6049 ENDOVER
|
Line 6089 ENDOVER
|
$r->print('<div>'); |
$r->print('<div>'); |
my $sortorder=$env{'form.sortorder'}; |
my $sortorder=$env{'form.sortorder'}; |
unless ($sortorder) { $sortorder='realmstudent'; } |
unless ($sortorder) { $sortorder='realmstudent'; } |
&sortmenu($r,$sortorder,'newoverview')); |
&sortmenu($r,$sortorder,'newoverview'); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
|
|
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>'); |
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>'); |