version 1.28.2.7, 2010/12/24 17:51:16
|
version 1.28.2.8, 2010/12/26 05:22:21
|
Line 2094 sub display_loncaparev_constraints {
|
Line 2094 sub display_loncaparev_constraints {
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $output; |
my $output; |
|
my %lt = &Apache::lonlocal::texthash ( |
|
'all' => 'all', |
|
'section/group' => 'section/group', |
|
'user' => 'user', |
|
); |
my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry); |
my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry); |
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes, |
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes, |
\%checkcrstypes,\%anonsurvey,\%randomizetry); |
\%checkcrstypes,\%anonsurvey,\%randomizetry); |
Line 2103 sub display_loncaparev_constraints {
|
Line 2108 sub display_loncaparev_constraints {
|
} |
} |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
%byresponsetype,%bysubmission); |
%byresponsetype,%bysubmission); |
@scopeorder = ('course','section/group','user'); |
@scopeorder = ('all','section/group','user'); |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
if (ref($resourcedata) eq 'HASH') { |
if (ref($resourcedata) eq 'HASH') { |
foreach my $key (keys(%{$resourcedata})) { |
foreach my $key (keys(%{$resourcedata})) { |
Line 2127 sub display_loncaparev_constraints {
|
Line 2132 sub display_loncaparev_constraints {
|
$which = $2; |
$which = $2; |
$scope = 'section/group'; |
$scope = 'section/group'; |
} else { |
} else { |
$scope = 'course'; |
$scope = 'all'; |
} |
} |
my $what="$stdname=$valname"; |
my $what="$stdname=$valname"; |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
$level = 'general'; |
$level = 'general'; |
if ($scope eq 'course') { |
if ($scope eq 'all') { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
push(@{$fromparam{$rev}{$scope}},$what); |
push(@{$fromparam{$rev}{$scope}},$what); |
Line 2153 sub display_loncaparev_constraints {
|
Line 2158 sub display_loncaparev_constraints {
|
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
$level = 'folder'; |
$level = 'folder'; |
$map = $1; |
$map = $1; |
if ($scope eq 'course') { |
if ($scope eq 'all') { |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
Line 2173 sub display_loncaparev_constraints {
|
Line 2178 sub display_loncaparev_constraints {
|
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
$level = 'resource'; |
$level = 'resource'; |
$resource = $1; |
$resource = $1; |
if ($scope eq 'course') { |
if ($scope eq 'all') { |
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
Line 2212 sub display_loncaparev_constraints {
|
Line 2217 sub display_loncaparev_constraints {
|
if ($newrow) { |
if ($newrow) { |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
} |
} |
$output .= '<td>'.$scope.'</td>'; |
$output .= '<td>'.$lt{$scope}.'</td>'; |
foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) { |
foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) { |
$output .= '<td>'.$which.'</td><td>'. |
$output .= '<td>'.$which.'</td><td>'. |
join('<br />',@{$fromparam{$rev}{$scope}{$which}}).'</td>'; |
join('<br />',@{$fromparam{$rev}{$scope}{$which}}).'</td>'; |
Line 2223 sub display_loncaparev_constraints {
|
Line 2228 sub display_loncaparev_constraints {
|
if ($newrow) { |
if ($newrow) { |
$output .= &Apache::loncommon::continue_data_table_row(); |
$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>'. |
join('<br />',@{$fromparam{$rev}{$scope}}).'</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$newrow = 1; |
$newrow = 1; |
Line 2329 sub display_loncaparev_constraints {
|
Line 2334 sub display_loncaparev_constraints {
|
$r->print($output); |
$r->print($output); |
if (defined($navmap)) { |
if (defined($navmap)) { |
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission, |
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission, |
\%byresponsetype,\@scopeorder); |
\%byresponsetype,\@scopeorder,\%lt); |
} |
} |
$r->print('<br /><br />'); |
$r->print('<br /><br />'); |
} else { |
} else { |
Line 2342 sub display_loncaparev_constraints {
|
Line 2347 sub display_loncaparev_constraints {
|
} |
} |
|
|
sub show_contents_view { |
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) || |
if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || |
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) { |
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) { |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons"); |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons"); |
Line 2356 sub show_contents_view {
|
Line 2362 sub show_contents_view {
|
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td> '.$icon.' '.&mt('Main Course Documents').'</td>'); |
'<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()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
my $curRes; |
my $curRes; |
Line 2424 sub show_contents_view {
|
Line 2430 sub show_contents_view {
|
$r->print('<table border="0">'); |
$r->print('<table border="0">'); |
foreach my $scope (@{$scopeorder}) { |
foreach my $scope (@{$scopeorder}) { |
if (ref($byresource->{$symb}{$rev}{$scope}) eq 'HASH') { |
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}}))) { |
foreach my $which (sort(keys(%{$byresource->{$symb}{$rev}{$scope}}))) { |
$r->print('<td>'.$which.'</td><td>'. |
$r->print('<td>'.$which.'</td><td>'. |
join('<br />',@{$byresource->{$symb}{$rev}{$scope}{$which}}). |
join('<br />',@{$byresource->{$symb}{$rev}{$scope}{$which}}). |
Line 2432 sub show_contents_view {
|
Line 2438 sub show_contents_view {
|
} |
} |
$r->print('</tr>'); |
$r->print('</tr>'); |
} elsif (ref($byresource->{$symb}{$rev}{$scope}) eq 'ARRAY') { |
} 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>'. |
'<td> </td><td>'. |
join('<br />',@{$byresource->{$symb}{$rev}{$scope}}).'</td></tr>'); |
join('<br />',@{$byresource->{$symb}{$rev}{$scope}}).'</td></tr>'); |
} |
} |
Line 2481 sub show_contents_view {
|
Line 2487 sub show_contents_view {
|
} |
} |
|
|
sub releases_by_map { |
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')); |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
if (ref($bymap->{$url}) eq 'HASH') { |
if (ref($bymap->{$url}) eq 'HASH') { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
Line 2490 sub releases_by_map {
|
Line 2496 sub releases_by_map {
|
$r->print('<table border="0">'); |
$r->print('<table border="0">'); |
foreach my $scope (@{$scopeorder}) { |
foreach my $scope (@{$scopeorder}) { |
if (ref($bymap->{$url}{$rev}{$scope}) eq 'HASH') { |
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}}))) { |
foreach my $which (sort(keys(%{$bymap->{$url}{$rev}{$scope}}))) { |
$r->print('<td>'.$which.'</td><td>'. |
$r->print('<td>'.$which.'</td><td>'. |
join('<br />',@{$bymap->{$url}{$rev}{$scope}{$which}}). |
join('<br />',@{$bymap->{$url}{$rev}{$scope}{$which}}). |
Line 2498 sub releases_by_map {
|
Line 2504 sub releases_by_map {
|
} |
} |
$r->print('</tr>'); |
$r->print('</tr>'); |
} elsif (ref($bymap->{$url}{$rev}{$scope}) eq 'ARRAY') { |
} 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>'. |
'</td><td> </td><td>'. |
join('<br />',@{$bymap->{$url}{$rev}{$scope}}).'</td></tr>'); |
join('<br />',@{$bymap->{$url}{$rev}{$scope}}).'</td></tr>'); |
} |
} |