version 1.34, 2017/07/26 19:45:45
|
version 1.41, 2018/01/01 01:29:38
|
Line 40 use Apache::courseclassifier();
|
Line 40 use Apache::courseclassifier();
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub print_header { |
sub print_header { |
my ($r,$phase,$context,$jscript,$container,$instcode,$dom) = @_; |
my ($r,$phase,$context,$jscript,$container,$instcode,$dom,$values) = @_; |
my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check, |
my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check, |
$crstype,@actions,@code_order); |
$crstype,@actions,@code_order); |
if ($phase eq 'display') { |
if ($phase eq 'display') { |
Line 185 $jscript
|
Line 185 $jscript
|
} |
} |
if (grep(/^selfcreation$/,@actions)) { |
if (grep(/^selfcreation$/,@actions)) { |
my $prefix = 'cancreate_emailverified'; |
my $prefix = 'cancreate_emailverified'; |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my $customclass = 'LC_selfcreate_email'; |
if (ref($domdefaults{'inststatusguest'}) eq 'ARRAY') { |
my $classprefix = 'LC_canmodify_emailusername_'; |
my $order = $domdefaults{'inststatusguest'}; |
my $optionsprefix = 'LC_options_emailusername_'; |
if (ref($order) eq 'ARRAY') { |
$onload .= "toggleRows(document.display,'cancreate_email','selfassign','$customclass','$classprefix','$optionsprefix');"; |
foreach my $type (@{$order}) { |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
if (($type ne '') && ($type ne 'default')) { |
my $hascustom; |
my $name = $prefix.'_'.$type; |
my ($emailrules,$emailruleorder) = &Apache::lonnet::inst_userrules($dom,'email'); |
$onload .= "toggleDisplay(document.display,'$name');"; |
if (ref($emailrules) eq 'HASH') { |
} |
if (keys(%{$emailrules}) > 0) { |
|
$hascustom = 'cancreate_emailrule'; |
|
} |
|
} |
|
my @posstypes; |
|
if (ref($types) eq 'ARRAY') { |
|
@posstypes = @{$types}; |
|
push(@posstypes,'default'); |
|
foreach my $type (@posstypes) { |
|
$onload .= "toggleEmailOptions(document.display,'cancreate_emailoptions','$hascustom',". |
|
"'cancreate_emaildomain','$type');"; |
|
} |
|
} else { |
|
$onload .= "toggleEmailOptions(document.display,'cancreate_emailoptions','$hascustom',". |
|
"'cancreate_emaildomain','default');"; |
|
} |
|
} |
|
if (grep(/^contacts$/,@actions)) { |
|
my $customclass = 'LC_helpdesk_override'; |
|
my $optionsprefix = 'LC_options_helpdesk_'; |
|
$onload .= "toggleHelpdeskRow(document.display,'overrides','$customclass','$optionsprefix');"; |
|
} |
|
if (grep(/^lti$/,@actions)) { |
|
$onload .= "toggleLTI(document.display,'user','add');". |
|
"toggleLTI(document.display,'crs','add');". |
|
"toggleLTI(document.display,'sec','add');"; |
|
if (ref($values) eq 'HASH') { |
|
if (ref($values->{'lti'}) eq 'HASH') { |
|
my $numlti = scalar(keys(%{$values->{'lti'}})); |
|
for (my $i=0; $i<$numlti; $i++) { |
|
$onload .= "toggleLTI(document.display,'user','$i');". |
|
"toggleLTI(document.display,'crs','$i');". |
|
"toggleLTI(document.display,'sec','$i');"; |
|
} |
|
} |
|
} |
|
} |
|
if (grep(/^ltitools$/,@actions)) { |
|
$onload .= "toggleLTITools(document.display,'passback','add');". |
|
"toggleLTITools(document.display,'roster','add');". |
|
"toggleLTITools(document.display,'user','add');"; |
|
if (ref($values) eq 'HASH') { |
|
if (ref($values->{'ltitools'}) eq 'HASH') { |
|
my $numltitools = scalar(keys(%{$values->{'ltitools'}})); |
|
for (my $i=0; $i<$numltitools; $i++) { |
|
$onload .= "toggleLTITools(document.display,'passback','$i');". |
|
"toggleLTITools(document.display,'roster','$i');". |
|
"toggleLTITools(document.display,'user','$i');"; |
} |
} |
} |
} |
} |
} |
$onload .= "toggleDisplay(document.display,'$prefix');". |
|
"toggleDisplay(document.display,'emailoptions');". |
|
} |
} |
if ($onload) { |
if ($onload) { |
my %loaditems = ( |
my %loaditems = ( |
'onload' => $onload; |
'onload' => $onload, |
); |
); |
$additem = {'add_entries' => \%loaditems,}; |
$additem = {'add_entries' => \%loaditems,}; |
} |
} |
Line 363 sub display_settings {
|
Line 408 sub display_settings {
|
if (ref($values) eq 'HASH') { |
if (ref($values) eq 'HASH') { |
$instcode = $values->{'internal.coursecode'}; |
$instcode = $values->{'internal.coursecode'}; |
} |
} |
&print_header($r,$phase,$context,$jscript,$container,$instcode,$dom); |
&print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$values); |
my $divwidth = 900; |
my $divwidth = 900; |
if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { |
if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { |
if (@actions > 0) { |
if (@actions > 0) { |