--- loncom/interface/courseprefs.pm 2010/12/24 17:16:04 1.37
+++ loncom/interface/courseprefs.pm 2011/01/13 22:49:47 1.40
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.37 2010/12/24 17:16:04 raeburn Exp $
+# $Id: courseprefs.pm,v 1.40 2011/01/13 22:49:47 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -268,8 +268,8 @@ sub handler {
my %lt;
if ($crstype eq 'Community') {
%lt = (
- conf => 'Community Configuration',
- edit => 'Edit Community Configuration',
+ conf => 'Community Settings',
+ edit => 'Edit Community Settings',
gens => 'General community settings',
idnu => 'Community ID or number',
desc => 'Community Description',
@@ -295,8 +295,8 @@ sub handler {
);
} else {
%lt = (
- conf => 'Course Configuration',
- edit => 'Edit Course Configuration',
+ conf => 'Course Settings',
+ edit => 'Edit Course Settings',
gens => 'General course settings',
idnu => 'Course ID or number',
desc => 'Course Description',
@@ -2069,23 +2069,21 @@ sub display_loncaparev_constraints {
my $cdom = $env{'course.'.$cid.'.domain'};
my $cnum = $env{'course.'.$cid.'.num'};
my $output;
+ my %lt = &Apache::lonlocal::texthash (
+ 'all' => 'all',
+ 'section/group' => 'section/group',
+ 'user' => 'user',
+ );
my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry);
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes,
\%checkcrstypes,\%anonsurvey,\%randomizetry);
-
-# my %paramstrings =
-# ('string_questiontype' =>
-# [[ 'anonsurveycred', 'Anonymous Survey'],
-# [ 'anonsurvey', 'Anonymous Survey'],
-# [ 'randomizetry', 'New Randomization Each N Tries']]
-# );
if (defined($checkcrstypes{$crstype})) {
$output .= '
'.&mt('Course type: [_1] requires [_2] or newer',$crstype,
$checkcrstypes{$crstype}).'
';
}
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps,
%byresponsetype,%bysubmission);
- @scopeorder = ('course','section/group','user');
+ @scopeorder = ('all','section/group','user');
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom);
if (ref($resourcedata) eq 'HASH') {
foreach my $key (keys(%{$resourcedata})) {
@@ -2109,12 +2107,12 @@ sub display_loncaparev_constraints {
$which = $2;
$scope = 'section/group';
} else {
- $scope = 'course';
+ $scope = 'all';
}
my $what="$stdname=$valname";
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) {
$level = 'general';
- if ($scope eq 'course') {
+ if ($scope eq 'all') {
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') {
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) {
push(@{$fromparam{$rev}{$scope}},$what);
@@ -2135,7 +2133,7 @@ sub display_loncaparev_constraints {
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) {
$level = 'folder';
$map = $1;
- if ($scope eq 'course') {
+ if ($scope eq 'all') {
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') {
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) {
push(@{$bymap{$map}{$rev}{$scope}},$what);
@@ -2155,7 +2153,7 @@ sub display_loncaparev_constraints {
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) {
$level = 'resource';
$resource = $1;
- if ($scope eq 'course') {
+ if ($scope eq 'all') {
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') {
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) {
push(@{$byresource{$resource}{$rev}{$scope}},$what);
@@ -2194,7 +2192,7 @@ sub display_loncaparev_constraints {
if ($newrow) {
$output .= &Apache::loncommon::continue_data_table_row();
}
- $output .= ''.$scope.' | ';
+ $output .= ''.$lt{$scope}.' | ';
foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) {
$output .= ''.$which.' | '.
join(' ',@{$fromparam{$rev}{$scope}{$which}}).' | ';
@@ -2205,7 +2203,7 @@ sub display_loncaparev_constraints {
if ($newrow) {
$output .= &Apache::loncommon::continue_data_table_row();
}
- $output .= ''.$scope.' | | '.
+ $output .= ' | '.$lt{$scope}.' | | '.
join(' ',@{$fromparam{$rev}{$scope}}).' | '.
&Apache::loncommon::end_data_table_row();
$newrow = 1;
@@ -2311,7 +2309,7 @@ sub display_loncaparev_constraints {
$r->print($output);
if (defined($navmap)) {
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
- \%byresponsetype,\@scopeorder);
+ \%byresponsetype,\@scopeorder,\%lt);
}
$r->print('
');
} else {
@@ -2324,7 +2322,8 @@ sub display_loncaparev_constraints {
}
sub show_contents_view {
- my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,$scopeorder) = @_;
+ my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,
+ $scopeorder,$lt) = @_;
if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
@@ -2338,7 +2337,7 @@ sub show_contents_view {
&Apache::loncommon::end_data_table_header_row().
&Apache::loncommon::start_data_table_row().
' '.$icon.' '.&mt('Main Course Documents').' | ');
- &releases_by_map($r,$bymap,$topmap,$scopeorder);
+ &releases_by_map($r,$bymap,$topmap,$scopeorder,$lt);
$r->print(&Apache::loncommon::end_data_table_row());
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef);
my $curRes;
@@ -2406,7 +2405,7 @@ sub show_contents_view {
$r->print('');
foreach my $scope (@{$scopeorder}) {
if (ref($byresource->{$symb}{$rev}{$scope}) eq 'HASH') {
- $r->print(''.&mt('Setting - scope: [_1]',$scope).' | ');
+ $r->print('
'.&mt('Setting - scope: [_1]',$lt->{$scope}).' | ');
foreach my $which (sort(keys(%{$byresource->{$symb}{$rev}{$scope}}))) {
$r->print(''.$which.' | '.
join(' ',@{$byresource->{$symb}{$rev}{$scope}{$which}}).
@@ -2414,7 +2413,7 @@ sub show_contents_view {
}
$r->print(' |
');
} elsif (ref($byresource->{$symb}{$rev}{$scope}) eq 'ARRAY') {
- $r->print(''.&mt('Setting - scope: [_1]',$scope).' | '.
+ $r->print('
'.&mt('Setting - scope: [_1]',$lt->{$scope}).' | '.
' | '.
join(' ',@{$byresource->{$symb}{$rev}{$scope}}).' |
');
}
@@ -2463,7 +2462,7 @@ sub show_contents_view {
}
sub releases_by_map {
- my ($r,$bymap,$url,$scopeorder) = @_;
+ my ($r,$bymap,$url,$scopeorder,$lt) = @_;
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY'));
if (ref($bymap->{$url}) eq 'HASH') {
foreach my $rev (sort(keys(%{$bymap->{$url}}))) {
@@ -2472,7 +2471,7 @@ sub releases_by_map {
$r->print('');
foreach my $scope (@{$scopeorder}) {
if (ref($bymap->{$url}{$rev}{$scope}) eq 'HASH') {
- $r->print(''.&mt('Setting - scope: [_1]',$scope).' | ');
+ $r->print('
'.&mt('Setting - scope: [_1]',$lt->{$scope}).' | ');
foreach my $which (sort(keys(%{$bymap->{$url}{$rev}{$scope}}))) {
$r->print(''.$which.' | '.
join(' ',@{$bymap->{$url}{$rev}{$scope}{$which}}).
@@ -2480,7 +2479,7 @@ sub releases_by_map {
}
$r->print(' |
');
} elsif (ref($bymap->{$url}{$rev}{$scope}) eq 'ARRAY') {
- $r->print(''.&mt('Setting - scope: [_1]',$scope).
+ $r->print(' |
'.&mt('Setting - scope: [_1]',$lt->{$scope}).
' | | '.
join(' ',@{$bymap->{$url}{$rev}{$scope}}).' |
');
}