[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface courseprefs.pm
raeburn
raeburn@source.lon-capa.org
Sun, 26 Dec 2010 05:22:21 -0000
This is a MIME encoded message
--raeburn1293340941
Content-Type: text/plain
raeburn Sun Dec 26 05:22:21 2010 EDT
Modified files: (Branch: version_2_10_X)
/loncom/interface courseprefs.pm
Log:
- Backport 1.39.
--raeburn1293340941
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20101226052221.txt"
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.28.2.7 loncom/interface/courseprefs.pm:1.28.2.8
--- loncom/interface/courseprefs.pm:1.28.2.7 Fri Dec 24 17:51:16 2010
+++ loncom/interface/courseprefs.pm Sun Dec 26 05:22:21 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.28.2.7 2010/12/24 17:51:16 raeburn Exp $
+# $Id: courseprefs.pm,v 1.28.2.8 2010/12/26 05:22:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2094,6 +2094,11 @@
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);
@@ -2103,7 +2108,7 @@
}
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})) {
@@ -2127,12 +2132,12 @@
$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);
@@ -2153,7 +2158,7 @@
} 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);
@@ -2173,7 +2178,7 @@
} 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);
@@ -2212,7 +2217,7 @@
if ($newrow) {
$output .= &Apache::loncommon::continue_data_table_row();
}
- $output .= '<td>'.$scope.'</td>';
+ $output .= '<td>'.$lt{$scope}.'</td>';
foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) {
$output .= '<td>'.$which.'</td><td>'.
join('<br />',@{$fromparam{$rev}{$scope}{$which}}).'</td>';
@@ -2223,7 +2228,7 @@
if ($newrow) {
$output .= &Apache::loncommon::continue_data_table_row();
}
- $output .= '<td>'.$scope.'</td><td> </td><td>'.
+ $output .= '<td>'.$lt{$scope}.'</td><td> </td><td>'.
join('<br />',@{$fromparam{$rev}{$scope}}).'</td>'.
&Apache::loncommon::end_data_table_row();
$newrow = 1;
@@ -2329,7 +2334,7 @@
$r->print($output);
if (defined($navmap)) {
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
- \%byresponsetype,\@scopeorder);
+ \%byresponsetype,\@scopeorder,\%lt);
}
$r->print('<br /><br />');
} else {
@@ -2342,7 +2347,8 @@
}
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");
@@ -2356,7 +2362,7 @@
&Apache::loncommon::end_data_table_header_row().
&Apache::loncommon::start_data_table_row().
'<td> '.$icon.' '.&mt('Main Course Documents').'</td>');
- &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;
@@ -2424,7 +2430,7 @@
$r->print('<table border="0">');
foreach my $scope (@{$scopeorder}) {
if (ref($byresource->{$symb}{$rev}{$scope}) eq 'HASH') {
- $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$scope).'</td>');
+ $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>');
foreach my $which (sort(keys(%{$byresource->{$symb}{$rev}{$scope}}))) {
$r->print('<td>'.$which.'</td><td>'.
join('<br />',@{$byresource->{$symb}{$rev}{$scope}{$which}}).
@@ -2432,7 +2438,7 @@
}
$r->print('</tr>');
} elsif (ref($byresource->{$symb}{$rev}{$scope}) eq 'ARRAY') {
- $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$scope).'</td>'.
+ $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>'.
'<td> </td><td>'.
join('<br />',@{$byresource->{$symb}{$rev}{$scope}}).'</td></tr>');
}
@@ -2481,7 +2487,7 @@
}
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}}))) {
@@ -2490,7 +2496,7 @@
$r->print('<table border="0">');
foreach my $scope (@{$scopeorder}) {
if (ref($bymap->{$url}{$rev}{$scope}) eq 'HASH') {
- $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$scope).'</td>');
+ $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>');
foreach my $which (sort(keys(%{$bymap->{$url}{$rev}{$scope}}))) {
$r->print('<td>'.$which.'</td><td>'.
join('<br />',@{$bymap->{$url}{$rev}{$scope}{$which}}).
@@ -2498,7 +2504,7 @@
}
$r->print('</tr>');
} elsif (ref($bymap->{$url}{$rev}{$scope}) eq 'ARRAY') {
- $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$scope).
+ $r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).
'</td><td> </td><td>'.
join('<br />',@{$bymap->{$url}{$rev}{$scope}}).'</td></tr>');
}
--raeburn1293340941--