--- loncom/interface/domainprefs.pm 2012/09/01 09:13:53 1.160.6.5
+++ loncom/interface/domainprefs.pm 2012/08/25 04:34:44 1.165
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.160.6.5 2012/09/01 09:13:53 raeburn Exp $
+# $Id: domainprefs.pm,v 1.165 2012/08/25 04:34:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -86,7 +86,7 @@ $dom,$settings,$rowtotal,$action.
$dom is the domain, $settings is a reference to a hash of current settings for
the current context, $rowtotal is a reference to the scalar used to record the
-number of rows displayed on the page, and $action is the context (quotas,
+number of rows displayed on the page, and $action is the context (quotas,
requestcourses or requestauthor).
The print_quotas routine was orginally created to display/store information
@@ -210,13 +210,15 @@ sub handler {
'quotas','autoenroll','autoupdate','autocreate',
'directorysrch','usercreation','usermodification',
'contacts','defaults','scantron','coursecategories',
- 'serverstatuses','requestcourses','usersessions',
- 'loadbalancing','requestauthor'],$dom);
+ 'serverstatuses','requestcourses','helpsettings',
+ 'coursedefaults','usersessions','loadbalancing',
+ 'requestauthor'],$dom);
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll',
'autoupdate','autocreate','directorysrch','contacts',
'usercreation','usermodification','scantron',
'requestcourses','requestauthor','coursecategories',
- 'serverstatuses','usersessions');
+ 'serverstatuses','helpsettings',
+ 'coursedefaults','usersessions');
if (keys(%servers) > 1) {
push(@prefs_order,'loadbalancing');
}
@@ -236,11 +238,10 @@ sub handler {
'login' =>
{ text => 'Log-in page options',
help => 'Domain_Configuration_Login_Page',
- header => [{col1 => 'Log-in Page Items',
- col2 => '',},
- {col1 => 'Log-in Help',
- col2 => 'Value'}],
+ header => [{col1 => 'Item',
+ col2 => '',}],
},
+
'defaults' =>
{ text => 'Default authentication/language/timezone/portal',
help => 'Domain_Configuration_LangTZAuth',
@@ -349,6 +350,28 @@ sub handler {
col3 => 'Specific IPs',
}],
},
+ 'helpsettings' =>
+ {text => 'Help page settings',
+ help => 'Domain_Configuration_Help_Settings',
+ header => [{col1 => 'Authenticated Help Settings',
+ col2 => ''},
+ {col1 => 'Unauthenticated Help Settings',
+ col2 => ''}],
+ },
+ 'coursedefaults' =>
+ {text => 'Course/Community defaults',
+ help => 'Domain_Configuration_Course_Defaults',
+ header => [{col1 => 'Defaults which can be overridden in each course by a CC',
+ col2 => 'Value',},
+ {col1 => 'Defaults which can be overridden for each course by a DC',
+ col2 => 'Value',},],
+ },
+ 'privacy' =>
+ {text => 'User Privacy',
+ help => 'Domain_Configuration_User_Privacy',
+ header => [{col1 => 'Setting',
+ col2 => 'Value',}],
+ },
'usersessions' =>
{text => 'User session hosting/offloading',
help => 'Domain_Configuration_User_Sessions',
@@ -375,9 +398,7 @@ sub handler {
header => [{col1 => 'Log-in Service',
col2 => 'Server Setting',},
{col1 => 'Log-in Page Items',
- col2 => ''},
- {col1 => 'Log-in Help',
- col2 => 'Value'}],
+ col2 => ''}],
};
}
my @roles = ('student','coordinator','author','admin');
@@ -478,6 +499,10 @@ sub process_changes {
$output = &modify_quotas($dom,$action,%domconfig);
} elsif ($action eq 'requestauthor') {
$output = &modify_quotas($dom,$action,%domconfig);
+ } elsif ($action eq 'helpsettings') {
+ $output = &modify_helpsettings($r,$dom,$confname,%domconfig);
+ } elsif ($action eq 'coursedefaults') {
+ $output = &modify_coursedefaults($dom,%domconfig);
} elsif ($action eq 'usersessions') {
$output = &modify_usersessions($dom,%domconfig);
} elsif ($action eq 'loadbalancing') {
@@ -508,8 +533,7 @@ sub print_config_box {
if ($numheaders > 1) {
my $colspan = '';
my $rightcolspan = '';
- if (($action eq 'rolecolors') || ($action eq 'coursecategories') ||
- (($action eq 'login') && ($numheaders < 3))) {
+ if (($action eq 'rolecolors') || ($action eq 'coursecategories') || ($action eq 'helpsettings')) {
$colspan = ' colspan="2"';
}
if ($action eq 'usersessions') {
@@ -533,20 +557,20 @@ sub print_config_box {
} elsif ($action eq 'coursecategories') {
$output .= &print_coursecategories('top',$dom,$item,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 3) {
- $colspan = ' colspan="2"';
- $output .= &print_login('service',$dom,$confname,$phase,$settings,\$rowtotal);
- } else {
- $output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal);
- }
+ $output .= &print_login('top',$dom,$confname,$phase,$settings,\$rowtotal);
+ $colspan = ' colspan="2"';
} elsif ($action eq 'requestcourses') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif ($action eq 'requestauthor') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
+ } elsif ($action eq 'helpsettings') {
+ $output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'usersessions') {
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal);
} elsif ($action eq 'rolecolors') {
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal);
+ } elsif ($action eq 'coursedefaults') {
+ $output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal);
}
$output .= '
@@ -603,26 +627,13 @@ sub print_config_box {
} elsif ($action eq 'coursecategories') {
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
} elsif ($action eq 'login') {
- if ($numheaders == 3) {
- $output .= &print_login('page',$dom,$confname,$phase,$settings,\$rowtotal).'
-
-
-
-
-
-
-
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
- '.&mt($item->{'header'}->[2]->{'col2'}).' | '.
- &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
- $rowtotal ++;
- } else {
- $output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
- }
+ $output .= &print_login('bottom',$dom,$confname,$phase,$settings,\$rowtotal);
} elsif ($action eq 'requestcourses') {
$output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
} elsif ($action eq 'requestauthor') {
$output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
+ } elsif ($action eq 'helpsettings') {
+ $output .= &print_helpsettings('bottom',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'usersessions') {
$output .= &print_usersessions('middle',$dom,$settings,\$rowtotal).'
@@ -714,7 +725,10 @@ sub print_config_box {
}
$output .= ' |
';
$rowtotal ++;
- if ($action eq 'quotas') {
+ if ($action eq 'login') {
+ $output .= &print_login('bottom',$dom,$confname,$phase,$settings,
+ \$rowtotal);
+ } elsif ($action eq 'quotas') {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif ($action eq 'autoenroll') {
$output .= &print_autoenroll($dom,$settings,\$rowtotal);
@@ -731,7 +745,7 @@ sub print_config_box {
} elsif ($action eq 'serverstatuses') {
$output .= &print_serverstatuses($dom,$settings,\$rowtotal);
} elsif ($action eq 'helpsettings') {
- $output .= &print_helpsettings($dom,$confname,$settings,\$rowtotal);
+ $output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal);
} elsif ($action eq 'loadbalancing') {
$output .= &print_loadbalancing($dom,$settings,\$rowtotal);
}
@@ -745,11 +759,11 @@ sub print_config_box {
}
sub print_login {
- my ($caller,$dom,$confname,$phase,$settings,$rowtotal) = @_;
+ my ($position,$dom,$confname,$phase,$settings,$rowtotal) = @_;
my ($css_class,$datatable);
my %choices = &login_choices();
- if ($caller eq 'service') {
+ if ($position eq 'top') {
my %servers = &Apache::lonnet::internet_dom_servers($dom);
my $choice = $choices{'disallowlogin'};
$css_class = ' class="LC_odd_row"';
@@ -816,220 +830,131 @@ sub print_login {
}
$datatable .= '';
return $datatable;
- } elsif ($caller eq 'page') {
- my %defaultchecked = (
- 'coursecatalog' => 'on',
- 'adminmail' => 'off',
- 'newuser' => 'off',
- );
- my @toggles = ('coursecatalog','adminmail','newuser');
- my (%checkedon,%checkedoff);
+ }
+
+ my %defaultchecked = (
+ 'coursecatalog' => 'on',
+ 'adminmail' => 'off',
+ 'newuser' => 'off',
+ );
+ my @toggles = ('coursecatalog','adminmail','newuser');
+ my (%checkedon,%checkedoff);
+ foreach my $item (@toggles) {
+ if ($defaultchecked{$item} eq 'on') {
+ $checkedon{$item} = ' checked="checked" ';
+ $checkedoff{$item} = ' ';
+ } elsif ($defaultchecked{$item} eq 'off') {
+ $checkedoff{$item} = ' checked="checked" ';
+ $checkedon{$item} = ' ';
+ }
+ }
+ my @images = ('img','logo','domlogo','login');
+ my @logintext = ('textcol','bgcol');
+ my @bgs = ('pgbg','mainbg','sidebg');
+ my @links = ('link','alink','vlink');
+ my %designhash = &Apache::loncommon::get_domainconf($dom);
+ my %defaultdesign = %Apache::loncommon::defaultdesign;
+ my (%is_custom,%designs);
+ my %defaults = (
+ font => $defaultdesign{'login.font'},
+ );
+ foreach my $item (@images) {
+ $defaults{$item} = $defaultdesign{'login.'.$item};
+ $defaults{'showlogo'}{$item} = 1;
+ }
+ foreach my $item (@bgs) {
+ $defaults{'bgs'}{$item} = $defaultdesign{'login.'.$item};
+ }
+ foreach my $item (@logintext) {
+ $defaults{'logintext'}{$item} = $defaultdesign{'login.'.$item};
+ }
+ foreach my $item (@links) {
+ $defaults{'links'}{$item} = $defaultdesign{'login.'.$item};
+ }
+ if (ref($settings) eq 'HASH') {
foreach my $item (@toggles) {
- if ($defaultchecked{$item} eq 'on') {
- $checkedon{$item} = ' checked="checked" ';
+ if ($settings->{$item} eq '1') {
+ $checkedon{$item} = ' checked="checked" ';
$checkedoff{$item} = ' ';
- } elsif ($defaultchecked{$item} eq 'off') {
- $checkedoff{$item} = ' checked="checked" ';
+ } elsif ($settings->{$item} eq '0') {
+ $checkedoff{$item} = ' checked="checked" ';
$checkedon{$item} = ' ';
}
}
- my @images = ('img','logo','domlogo','login');
- my @logintext = ('textcol','bgcol');
- my @bgs = ('pgbg','mainbg','sidebg');
- my @links = ('link','alink','vlink');
- my %designhash = &Apache::loncommon::get_domainconf($dom);
- my %defaultdesign = %Apache::loncommon::defaultdesign;
- my (%is_custom,%designs);
- my %defaults = (
- font => $defaultdesign{'login.font'},
- );
foreach my $item (@images) {
- $defaults{$item} = $defaultdesign{'login.'.$item};
- $defaults{'showlogo'}{$item} = 1;
- }
- foreach my $item (@bgs) {
- $defaults{'bgs'}{$item} = $defaultdesign{'login.'.$item};
+ if (defined($settings->{$item})) {
+ $designs{$item} = $settings->{$item};
+ $is_custom{$item} = 1;
+ }
+ if (defined($settings->{'showlogo'}{$item})) {
+ $designs{'showlogo'}{$item} = $settings->{'showlogo'}{$item};
+ }
}
foreach my $item (@logintext) {
- $defaults{'logintext'}{$item} = $defaultdesign{'login.'.$item};
+ if ($settings->{$item} ne '') {
+ $designs{'logintext'}{$item} = $settings->{$item};
+ $is_custom{$item} = 1;
+ }
}
- foreach my $item (@links) {
- $defaults{'links'}{$item} = $defaultdesign{'login.'.$item};
+ if ($settings->{'font'} ne '') {
+ $designs{'font'} = $settings->{'font'};
+ $is_custom{'font'} = 1;
}
- if (ref($settings) eq 'HASH') {
- foreach my $item (@toggles) {
- if ($settings->{$item} eq '1') {
- $checkedon{$item} = ' checked="checked" ';
- $checkedoff{$item} = ' ';
- } elsif ($settings->{$item} eq '0') {
- $checkedoff{$item} = ' checked="checked" ';
- $checkedon{$item} = ' ';
- }
- }
- foreach my $item (@images) {
- if (defined($settings->{$item})) {
- $designs{$item} = $settings->{$item};
- $is_custom{$item} = 1;
- }
- if (defined($settings->{'showlogo'}{$item})) {
- $designs{'showlogo'}{$item} = $settings->{'showlogo'}{$item};
- }
- }
- foreach my $item (@logintext) {
- if ($settings->{$item} ne '') {
- $designs{'logintext'}{$item} = $settings->{$item};
- $is_custom{$item} = 1;
- }
- }
- if ($settings->{'font'} ne '') {
- $designs{'font'} = $settings->{'font'};
- $is_custom{'font'} = 1;
- }
- foreach my $item (@bgs) {
- if ($settings->{$item} ne '') {
- $designs{'bgs'}{$item} = $settings->{$item};
- $is_custom{$item} = 1;
- }
- }
- foreach my $item (@links) {
- if ($settings->{$item} ne '') {
- $designs{'links'}{$item} = $settings->{$item};
- $is_custom{$item} = 1;
- }
- }
- } else {
- if ($designhash{$dom.'.login.font'} ne '') {
- $designs{'font'} = $designhash{$dom.'.login.font'};
- $is_custom{'font'} = 1;
- }
- foreach my $item (@images) {
- if ($designhash{$dom.'.login.'.$item} ne '') {
- $designs{$item} = $designhash{$dom.'.login.'.$item};
- $is_custom{$item} = 1;
- }
- }
- foreach my $item (@bgs) {
- if ($designhash{$dom.'.login.'.$item} ne '') {
- $designs{'bgs'}{$item} = $designhash{$dom.'.login.'.$item};
- $is_custom{$item} = 1;
- }
+ foreach my $item (@bgs) {
+ if ($settings->{$item} ne '') {
+ $designs{'bgs'}{$item} = $settings->{$item};
+ $is_custom{$item} = 1;
}
- foreach my $item (@links) {
- if ($designhash{$dom.'.login.'.$item} ne '') {
- $designs{'links'}{$item} = $designhash{$dom.'.login.'.$item};
- $is_custom{$item} = 1;
- }
+ }
+ foreach my $item (@links) {
+ if ($settings->{$item} ne '') {
+ $designs{'links'}{$item} = $settings->{$item};
+ $is_custom{$item} = 1;
}
}
- my %alt_text = &Apache::lonlocal::texthash ( img => 'Log-in banner',
- logo => 'Institution Logo',
- domlogo => 'Domain Logo',
- login => 'Login box');
- my $itemcount = 1;
- foreach my $item (@toggles) {
- $css_class = $itemcount%2?' class="LC_odd_row"':'';
- $datatable .=
- ''.$choices{$item}.
- ' | '.
- ' | '.
- '
';
- $itemcount ++;
+ } else {
+ if ($designhash{$dom.'.login.font'} ne '') {
+ $designs{'font'} = $designhash{$dom.'.login.font'};
+ $is_custom{'font'} = 1;
}
- $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext);
- $datatable .= '';
- } elsif ($caller eq 'help') {
- my ($defaulturl,$defaulttype,%url,%type,%lt,%langchoices);
- my $switchserver = &check_switchserver($dom,$confname);
- my $itemcount = 1;
- $defaulturl = '/adm/loginproblems.html';
- $defaulttype = 'default';
- %lt = &Apache::lonlocal::texthash (
- del => 'Delete?',
- rep => 'Replace:',
- upl => 'Upload:',
- default => 'Default',
- custom => 'Custom',
- );
- %langchoices = &Apache::lonlocal::texthash(&get_languages_hash());
- my @currlangs;
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{'helpurl'}) eq 'HASH') {
- foreach my $key (sort(keys(%{$settings->{'helpurl'}}))) {
- next if ($settings->{'helpurl'}{$key} eq '');
- $url{$key} = $settings->{'helpurl'}{$key}.'?inhibitmenu=yes';
- $type{$key} = 'custom';
- unless ($key eq 'nolang') {
- push(@currlangs,$key);
- }
- }
- } elsif ($settings->{'helpurl'} ne '') {
- $type{'nolang'} = 'custom';
- $url{'nolang'} = $settings->{'helpurl'}.'?inhibitmenu=yes';
+ foreach my $item (@images) {
+ if ($designhash{$dom.'.login.'.$item} ne '') {
+ $designs{$item} = $designhash{$dom.'.login.'.$item};
+ $is_custom{$item} = 1;
}
}
- foreach my $lang ('nolang',sort(@currlangs)) {
- $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- $datatable .= '';
- if ($url{$lang} eq '') {
- $url{$lang} = $defaulturl;
- }
- if ($type{$lang} eq '') {
- $type{$lang} = $defaulttype;
- }
- $datatable .= '';
- if ($lang eq 'nolang') {
- $datatable .= &mt('Log-in help page if no specific language file: [_1]',
- &Apache::loncommon::modal_link($url{$lang},$lt{$type{$lang}},600,500));
- } else {
- $datatable .= &mt('Log-in help page for language: [_1] is [_2]',
- $langchoices{$lang},
- &Apache::loncommon::modal_link($url{$lang},$lt{$type{$lang}},600,500));
- }
- $datatable .= ' | '."\n".
- '';
- if ($type{$lang} eq 'custom') {
- $datatable .= ' '.$lt{'rep'}.'';
- } else {
- $datatable .= $lt{'upl'};
- }
- $datatable .=' ';
- if ($switchserver) {
- $datatable .= &mt('Upload to library server: [_1]',$switchserver);
- } else {
- $datatable .= '';
+ foreach my $item (@bgs) {
+ if ($designhash{$dom.'.login.'.$item} ne '') {
+ $designs{'bgs'}{$item} = $designhash{$dom.'.login.'.$item};
+ $is_custom{$item} = 1;
}
- $datatable .= ' |
';
- $itemcount ++;
}
- my @addlangs;
- foreach my $lang (sort(keys(%langchoices))) {
- next if ((grep(/^\Q$lang\E$/,@currlangs)) || ($lang eq 'x_chef'));
- push(@addlangs,$lang);
- }
- if (@addlangs > 0) {
- my %toadd;
- map { $toadd{$_} = $langchoices{$_} ; } @addlangs;
- $toadd{''} = &mt('Select');
- $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
- $datatable .= ''.
- &mt('Add log-in help page for a specific language:').' '.
- &Apache::loncommon::select_form('','loginhelpurl_add_lang',\%toadd).
- ' | '.$lt{'upl'}.' ';
- if ($switchserver) {
- $datatable .= &mt('Upload to library server: [_1]',$switchserver);
- } else {
- $datatable .= '';
+ foreach my $item (@links) {
+ if ($designhash{$dom.'.login.'.$item} ne '') {
+ $designs{'links'}{$item} = $designhash{$dom.'.login.'.$item};
+ $is_custom{$item} = 1;
}
- $datatable .= ' |
';
- $itemcount ++;
}
- $datatable .= &captcha_choice('login',$settings,$itemcount);
}
+ my %alt_text = &Apache::lonlocal::texthash ( img => 'Log-in banner',
+ logo => 'Institution Logo',
+ domlogo => 'Domain Logo',
+ login => 'Login box');
+ my $itemcount = 1;
+ foreach my $item (@toggles) {
+ $css_class = $itemcount%2?' class="LC_odd_row"':'';
+ $datatable .=
+ ''.$choices{$item}.
+ ' | '.
+ ' | '.
+ '
';
+ $itemcount ++;
+ }
+ $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext);
+ $datatable .= '';
return $datatable;
}
@@ -1470,7 +1395,7 @@ sub print_quotas {
} elsif ($context eq 'requestauthor') {
@usertools = ('author');
@options = ('norequest','approval','automatic');
- %titles = &authorrequest_titles();
+ %titles = &authorrequest_titles();
} else {
@usertools = ('aboutme','blog','webdav','portfolio');
%titles = &tool_titles();
@@ -2338,21 +2263,97 @@ sub print_contacts {
}
sub print_helpsettings {
- my ($dom,$confname,$settings,$rowtotal) = @_;
- my ($datatable,$itemcount);
- $itemcount = 1;
- my (%choices,%defaultchecked,@toggles);
- $choices{'submitbugs'} = &mt('Display link to: [_1]?',
- &Apache::loncommon::modal_link('http://bugs.loncapa.org',
- &mt('LON-CAPA bug tracker'),600,500));
- %defaultchecked = ('submitbugs' => 'on');
- @toggles = ('submitbugs',);
- ($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
- \%choices,$itemcount);
- return $datatable;
+ my ($position,$dom,$confname,$settings,$rowtotal) = @_;
+ my ($css_class,$datatable);
+
+ my $switchserver = &check_switchserver($dom,$confname);
+
+ my $itemcount = 1;
+
+ if ($position eq 'top') {
+
+ my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles);
+
+ %choices =
+ &Apache::lonlocal::texthash (
+ submitbugs => 'Display "Submit a bug" link?',
+ );
+
+ %defaultchecked = ('submitbugs' => 'on');
+
+ @toggles = ('submitbugs',);
+
+ foreach my $item (@toggles) {
+ if ($defaultchecked{$item} eq 'on') {
+ $checkedon{$item} = ' checked="checked" ';
+ $checkedoff{$item} = ' ';
+ } elsif ($defaultchecked{$item} eq 'off') {
+ $checkedoff{$item} = ' checked="checked" ';
+ $checkedon{$item} = ' ';
+ }
+ }
+
+ if (ref($settings) eq 'HASH') {
+ foreach my $item (@toggles) {
+ if ($settings->{$item} eq '1') {
+ $checkedon{$item} = ' checked="checked" ';
+ $checkedoff{$item} = ' ';
+ } elsif ($settings->{$item} eq '0') {
+ $checkedoff{$item} = ' checked="checked" ';
+ $checkedon{$item} = ' ';
+ }
+ }
+ }
+
+ foreach my $item (@toggles) {
+ $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
+ $datatable .=
+ '
+ '.$choices{$item}.' |
+ |
+
+
+ '.
+ ' | '.
+ '
';
+ $itemcount ++;
+ }
+
+ } else {
+
+ $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
+
+ $datatable .= '';
+
+ if (ref($settings) eq 'HASH') {
+ if ($settings->{'loginhelpurl'} ne '') {
+ my($directory, $filename) = $settings->{'loginhelpurl'} =~ m/(.*\/)(.*)$/;
+ $datatable .= ' | ';
+ $datatable .= ' | '
+ } else {
+ $datatable .= ' | ';
+ $datatable .= ' | ';
+ }
+ } else {
+ $datatable .= ' | ';
+ $datatable .= ' | ';
+ }
+
+ $datatable .= '';
+ if ($switchserver) {
+ $datatable .= &mt('Upload to library server: [_1]',$switchserver);
+ } else {
+ $datatable .= &mt('Upload Custom Login Page Help File:');
+ $datatable .='';
+ }
+ $datatable .= ' |
';
+
+ }
+ return $datatable;
}
+
sub radiobutton_prefs {
my ($settings,$toggles,$defaultchecked,$choices,$itemcount) = @_;
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
@@ -3132,7 +3133,7 @@ sub authorrequest_titles {
automatic => 'Automatic approval',
);
return %titles;
-}
+}
sub courserequest_conditions {
my %conditions = &Apache::lonlocal::texthash (
@@ -3273,10 +3274,9 @@ sub print_usercreation {
$dom,$numinrow,$othertitle,
'statustocreate');
$$rowtotal ++;
- $rownum ++;
}
}
- $datatable .= &captcha_choice('cancreate',$createsettings,$rownum);
+ $datatable .= &captcha_choice('cancreate',$createsettings);
} else {
my @contexts = ('author','course','domain');
my @authtypes = ('int','krb4','krb5','loc');
@@ -3329,14 +3329,14 @@ sub print_usercreation {
}
sub captcha_choice {
- my ($context,$settings,$itemcount) = @_;
+ my ($context,$settings) = @_;
my ($keyentry,$currpub,$currpriv,%checked,$rowname,$pubtext,$privtext);
my %lt = &captcha_phrases();
$keyentry = 'hidden';
if ($context eq 'cancreate') {
$rowname = &mt('CAPTCHA validation (e-mail as username)');
- } elsif ($context eq 'login') {
- $rowname = &mt('"Contact helpdesk" CAPTCHA validation');
+ } elsif ($context eq 'help') {
+ $rowname = &mt('CAPTCHA validation');
}
if (ref($settings) eq 'HASH') {
if ($settings->{'captcha'}) {
@@ -3356,9 +3356,8 @@ sub captcha_choice {
} else {
$checked{'original'} = ' checked="checked"';
}
- my $css_class = $itemcount%2?' class="LC_odd_row"':'';
- my $output = ''.
- ''.$rowname.' | '."\n".
+ my $output = ' |
'.
+ ''.$rowname.' | '."\n".
''."\n";
foreach my $option ('original','recaptcha','notused') {
$output .= ' |
|