+$sections
+
+$lt{'fu'}
+
+$lt{'oi'}
+
+$lt{'ad'}
+$chooseopt
+
+ENDMENU
+}
+
+sub displaymenu {
+ my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_;
+ $r->print(''.&mt('Select Parameters to View').' | '.
+ &mt('Select Parts to View').' |
---|
');
+ &parmmenu($r,$allparms,$pscat,$keyorder);
+ $r->print(' | ');
+ &partmenu($r,$allparts,$psprt);
+ $r->print(' |
');
+}
+
+sub mapmenu {
+ my ($r,$allmaps,$pschp,$maptitles)=@_;
+ $r->print(''.&mt('Select Enclosing Map or Folder').' ');
+ $r->print('");
+}
+
+sub levelmenu {
+ my ($r,$alllevs,$parmlev)=@_;
+ $r->print(''.&mt('Select Parameter Level').
+ &Apache::loncommon::help_open_topic('Course_Parameter_Levels').' ');
+ $r->print('");
+}
+
+
+sub sectionmenu {
+ my ($r,$selectedsections)=@_;
+ my %sectionhash=();
+
+ if (&Apache::loncommon::get_sections(
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ $env{'course.'.$env{'request.course.id'}.'.num'},
+ \%sectionhash)) {
+ $r->print('\n");
+ }
+}
+
+sub keysplit {
+ my $keyp=shift;
+ return (split(/\,/,$keyp));
+}
+
+sub keysinorder {
+ my ($name,$keyorder)=@_;
+ return sort {
+ $$keyorder{$a} <=> $$keyorder{$b};
+ } (keys %{$name});
+}
+
+sub keysinorder_bytype {
+ my ($name,$keyorder)=@_;
+ return sort {
+ my $ta=(split('_',$a))[-1];
+ my $tb=(split('_',$b))[-1];
+ if ($$keyorder{'parameter_0_'.$ta} == $$keyorder{'parameter_0_'.$tb}) {
+ return ($a cmp $b);
+ }
+ $$keyorder{'parameter_0_'.$ta} <=> $$keyorder{'parameter_0_'.$tb};
+ } (keys %{$name});
+}
+
+sub keysindisplayorder {
+ my ($name,$keyorder)=@_;
+ return sort {
+ $$keyorder{'parameter_0_'.$a} <=> $$keyorder{'parameter_0_'.$b};
+ } (keys %{$name});
+}
+
+sub sortmenu {
+ my ($r,$sortorder)=@_;
+ $r->print('
');
+}
+
+sub standardkeyorder {
+ return ('parameter_0_opendate' => 1,
+ 'parameter_0_duedate' => 2,
+ 'parameter_0_answerdate' => 3,
+ 'parameter_0_interval' => 4,
+ 'parameter_0_weight' => 5,
+ 'parameter_0_maxtries' => 6,
+ 'parameter_0_hinttries' => 7,
+ 'parameter_0_contentopen' => 8,
+ 'parameter_0_contentclose' => 9,
+ 'parameter_0_type' => 10,
+ 'parameter_0_problemstatus' => 11,
+ 'parameter_0_hiddenresource' => 12,
+ 'parameter_0_hiddenparts' => 13,
+ 'parameter_0_display' => 14,
+ 'parameter_0_ordered' => 15,
+ 'parameter_0_tol' => 16,
+ 'parameter_0_sig' => 17,
+ 'parameter_0_turnoffunit' => 18,
+ 'parameter_0_discussend' => 19,
+ 'parameter_0_discusshide' => 20);
}
##################################################
@@ -566,23 +1157,37 @@ Variables used (guessed by Jeremy):
sub assessparms {
my $r=shift;
+
+ my @ids=();
+ my %symbp=();
+ my %mapp=();
+ my %typep=();
+ my %keyp=();
+ my %uris=();
+ my %maptitles=();
+
# -------------------------------------------------------- Variable declaration
- my %allkeys;
- my %allmaps;
- my %alllevs;
+
+ my %allmaps=();
+ my %alllevs=();
+
+ my $uname;
+ my $udom;
+ my $uhome;
+ my $csec;
+
+ my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'};
$alllevs{'Resource Level'}='full';
-# $alllevs{'Resource Level [BRIEF]'}='brief';
- $alllevs{'Map Level'}='map';
+ $alllevs{'Map/Folder Level'}='map';
$alllevs{'Course Level'}='general';
my %allparms;
my %allparts;
-
- my %defp;
- %courseopt=();
- %useropt=();
- my %bighash=();
+#
+# Order in which these parameters will be displayed
+#
+ my %keyorder=&standardkeyorder();
@ids=();
%symbp=();
@@ -590,59 +1195,60 @@ sub assessparms {
my $message='';
- $csec=$ENV{'form.csec'};
- $udom=$ENV{'form.udom'};
- unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }
-
- my @pscat=&get_env_multiple('form.pscat');
- my $pschp=$ENV{'form.pschp'};
- my @psprt=&get_env_multiple('form.psprt');
- my $showoptions=$ENV{'form.showoptions'};
+ $csec=$env{'form.csec'};
+
+ if ($udom=$env{'form.udom'}) {
+ } elsif ($udom=$env{'request.role.domain'}) {
+ } elsif ($udom=$env{'user.domain'}) {
+ } else {
+ $udom=$r->dir_config('lonDefDomain');
+ }
+
+ my @pscat=&Apache::loncommon::get_env_multiple('form.pscat');
+ my $pschp=$env{'form.pschp'};
+ my @psprt=&Apache::loncommon::get_env_multiple('form.psprt');
+ if (!@psprt) { $psprt[0]='0'; }
my $pssymb='';
my $parmlev='';
- my $prevvisit=$ENV{'form.prevvisit'};
-
-# unless ($parmlev==$ENV{'form.parmlev'}) {
-# $parmlev = 'full';
-# }
- unless ($ENV{'form.parmlev'}) {
+ unless ($env{'form.parmlev'}) {
$parmlev = 'map';
} else {
- $parmlev = $ENV{'form.parmlev'};
+ $parmlev = $env{'form.parmlev'};
}
# ----------------------------------------------- Was this started from grades?
- if (($ENV{'form.command'} eq 'set') && ($ENV{'form.url'})
- && (!$ENV{'form.dis'})) {
- my $url=$ENV{'form.url'};
+ if (($env{'form.command'} eq 'set') && ($env{'form.url'})
+ && (!$env{'form.dis'})) {
+ my $url=$env{'form.url'};
$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
$pssymb=&Apache::lonnet::symbread($url);
- @pscat='all';
+ if (!@pscat) { @pscat=('all'); }
$pschp='';
$parmlev = 'full';
- } elsif ($ENV{'form.symb'}) {
- $pssymb=$ENV{'form.symb'};
- @pscat='all';
+ } elsif ($env{'form.symb'}) {
+ $pssymb=$env{'form.symb'};
+ if (!@pscat) { @pscat=('all'); }
$pschp='';
$parmlev = 'full';
} else {
- $ENV{'form.url'}='';
+ $env{'form.url'}='';
}
- my $id=$ENV{'form.id'};
+ my $id=$env{'form.id'};
if (($id) && ($udom)) {
$uname=(&Apache::lonnet::idget($udom,$id))[1];
if ($uname) {
$id='';
} else {
$message=
- "Unknown ID '$id' at domain '$udom'";
+ "".&mt("Unknown ID")." '$id' ".
+ &mt('at domain')." '$udom'";
}
} else {
- $uname=$ENV{'form.uname'};
+ $uname=$env{'form.uname'};
}
unless ($udom) { $uname=''; }
$uhome='';
@@ -650,297 +1256,89 @@ sub assessparms {
$uhome=&Apache::lonnet::homeserver($uname,$udom);
if ($uhome eq 'no_host') {
$message=
- "Unknown user '$uname' at domain '$udom'";
+ "".&mt("Unknown user")." '$uname' ".
+ &mt("at domain")." '$udom'";
$uname='';
} else {
- $csec=&Apache::lonnet::usection($udom,$uname,
- $ENV{'request.course.id'});
+ $csec=&Apache::lonnet::getsection($udom,$uname,
+ $env{'request.course.id'});
if ($csec eq '-1') {
$message="".
- "User '$uname' at domain '$udom' not ".
- "in this course";
+ &mt("User")." '$uname' ".&mt("at domain")." '$udom' ".
+ &mt("not in this course")."";
$uname='';
- $csec=$ENV{'form.csec'};
+ $csec=$env{'form.csec'};
} else {
my %name=&Apache::lonnet::userenvironment($udom,$uname,
('firstname','middlename','lastname','generation','id'));
- $message="\n\nFull Name: ".
+ $message="\n
\n".&mt("Full Name").": ".
$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'}.
- "
\nID: ".$name{'id'}.'
';
+ "
\n".&mt('ID').": ".$name{'id'}.'
';
}
}
}
unless ($csec) { $csec=''; }
- my $fcat=$ENV{'form.fcat'};
- unless ($fcat) { $fcat=''; }
-
-# ------------------------------------------------------------------- Tie hashs
- if (!(tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
- &GDBM_READER(),0640))) {
- $r->print("Unable to access course data. (File $ENV{'request.course.fn'}.db not tieable)");
- return ;
- }
- if (!(tie(%parmhash,'GDBM_File',
- $ENV{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640))) {
- $r->print("Unable to access parameter data. (File $ENV{'request.course.fn'}_parms.db not tieable)");
- return ;
- }
-
# --------------------------------------------------------- Get all assessments
- extractResourceInformation(\%bighash, \@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp);
+ &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps,
+ \%mapp, \%symbp,\%maptitles,\%uris,
+ \%keyorder);
$mapp{'0.0'} = '';
$symbp{'0.0'} = '';
-# ---------------------------------------------------------- Anything to store?
- if ($ENV{'form.pres_marker'}) {
- my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'});
- $spnam=~s/\_([^\_]+)$/\.$1/;
-# ---------------------------------------------------------- Construct prefixes
- my $symbparm=$symbp{$sresid}.'.'.$spnam;
- my $mapparm=$mapp{$sresid}.'___(all).'.$spnam;
-
- my $seclevel=$ENV{'request.course.id'}.'.['.$csec.'].'.$spnam;
- my $seclevelr=$ENV{'request.course.id'}.'.['.$csec.'].'.$symbparm;
- my $seclevelm=$ENV{'request.course.id'}.'.['.$csec.'].'.$mapparm;
-
- my $courselevel=$ENV{'request.course.id'}.'.'.$spnam;
- my $courselevelr=$ENV{'request.course.id'}.'.'.$symbparm;
- my $courselevelm=$ENV{'request.course.id'}.'.'.$mapparm;
-
- my $storeunder='';
- if (($snum==9) || ($snum==3)) { $storeunder=$courselevel; }
- if (($snum==8) || ($snum==2)) { $storeunder=$courselevelm; }
- if (($snum==7) || ($snum==1)) { $storeunder=$courselevelr; }
- if ($snum==6) { $storeunder=$seclevel; }
- if ($snum==5) { $storeunder=$seclevelm; }
- if ($snum==4) { $storeunder=$seclevelr; }
-
- my %storecontent = ($storeunder => $ENV{'form.pres_value'},
- $storeunder.'type' => $ENV{'form.pres_type'});
- my $reply='';
- if ($snum>3) {
-# ---------------------------------------------------------------- Store Course
-#
-# Expire sheets
- &Apache::lonnet::expirespread('','','studentcalc');
- if (($snum==7) || ($snum==4)) {
- &Apache::lonnet::expirespread('','','assesscalc',$symbp{$sresid});
- } elsif (($snum==8) || ($snum==5)) {
- &Apache::lonnet::expirespread('','','assesscalc',$mapp{$sresid});
- } else {
- &Apache::lonnet::expirespread('','','assesscalc');
- }
-# Store parameter
- $reply=&Apache::lonnet::cput
- ('resourcedata',\%storecontent,
- $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
- } else {
-# ------------------------------------------------------------------ Store User
-#
-# Expire sheets
- &Apache::lonnet::expirespread($uname,$udom,'studentcalc');
- if ($snum==1) {
- &Apache::lonnet::expirespread
- ($uname,$udom,'assesscalc',$symbp{$sresid});
- } elsif ($snum==2) {
- &Apache::lonnet::expirespread
- ($uname,$udom,'assesscalc',$mapp{$sresid});
- } else {
- &Apache::lonnet::expirespread($uname,$udom,'assesscalc');
- }
-# Store parameter
- $reply=&Apache::lonnet::cput
- ('resourcedata',\%storecontent,$udom,$uname);
- }
-
- if ($reply=~/^error\:(.*)/) {
- $message.="Write Error: $1";
+# ---------------------------------------------------------- Anything to store?
+ if ($env{'form.pres_marker'}) {
+ my @markers=split(/\&\&\&/,$env{'form.pres_marker'});
+ my @values=split(/\&\&\&/,$env{'form.pres_value'});
+ my @types=split(/\&\&\&/,$env{'form.pres_type'});
+ for (my $i=0;$i<=$#markers;$i++) {
+ $message.=&storeparm(split(/\&/,$markers[$i]),
+ $values[$i],
+ $types[$i],
+ $uname,$udom,$csec);
}
# ---------------------------------------------------------------- Done storing
+ $message.='
'.&mt('Changes can take up to 10 minutes before being active for all students.').&Apache::loncommon::help_open_topic('Caching').'
';
}
-# -------------------------------------------------------------- Get coursedata
- %courseopt = &Apache::lonnet::dump
- ('resourcedata',
- $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
-# --------------------------------------------------- Get userdata (if present)
- if ($uname) {
- %useropt=&Apache::lonnet::dump('resourcedata',$udom,$uname);
- }
-
-# ------------------------------------------------------------------- Sort this
-
- @ids=sort {
- if ($fcat eq '') {
- $a<=>$b;
- } else {
- my ($result,@outpar)=&parmval($fcat,$a,$defp{$a});
- my $aparm=$outpar[$result];
- ($result,@outpar)=&parmval($fcat,$b,$defp{$b});
- my $bparm=$outpar[$result];
- 1*$aparm<=>1*$bparm;
- }
- } @ids;
#----------------------------------------------- if all selected, fill in array
- if ($pscat[0] eq "all" || !@pscat) {@pscat = (keys %allparms);}
+ if ($pscat[0] eq "all") {@pscat = (keys %allparms);}
+ if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') };
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);}
# ------------------------------------------------------------------ Start page
- &startpage($r,$id,$udom,$csec,$uname);
-# if ($ENV{'form.url'}) {
-# $r->print('');
-# }
- $r->print('');
+ &startpage($r);
foreach ('tolerance','date_default','date_start','date_end',
'date_interval','int','float','string') {
$r->print('');
+ $env{'form.recent_'.$_}.'" name="recent_'.$_.'">');
}
-
- $r->print(''.$message.'
');
- $r->print('
|
');
-
- my $submitmessage;
- if (($prevvisit) || ($pschp) || ($pssymb)) {
- $submitmessage = "Update Display";
- } else {
- $submitmessage = "Display";
- }
if (!$pssymb) {
- $r->print('Select Parameter Level | ');
- $r->print(' | \n");
-
- $r->print(' | ');
-
- $r->print('
| ');
-
- $r->print('
Select Enclosing Map | ');
- $r->print(' |
\n");
+ $r->print('');
+ &levelmenu($r,\%alllevs,$parmlev);
+ if ($parmlev ne 'general') {
+ $r->print(' | ');
+ &mapmenu($r,\%allmaps,$pschp,\%maptitles);
+ $r->print(' | ');
+ }
+ $r->print('
');
+ &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
} else {
- my ($map,$id,$resource)=split(/___/,$pssymb);
- $r->print("Specific Resource | $resource | ");
- $r->print(' | ');
- $r->print('
');
- $r->print('');
- }
-
- $r->print(' print(" checked ");}
- $r->print(' name="showoptions" value="show" onclick="form.submit();">Show More Options
|
');
-# $r->print("Show: $showoptions |
");
-# $r->print("pscat: @pscat |
");
-# $r->print("psprt: @psprt |
");
-# $r->print("fcat: $fcat |
");
-
- if ($showoptions eq 'show') {
- my $tempkey;
-
- $r->print('Select Parameters to View |
');
-
- $r->print('');
-
-# $r->print(' |
Select Parts | ');
- $r->print(' | |
|
');
-
- $r->print('Sort list by | ');
- $r->print(' | ');
-
- $r->print('
|
');
-
- } else { # hide options - include any necessary extras here
-
- $r->print(''."\n");
-
- unless (@pscat) {
- foreach (keys %allparms ) {
- $r->print(''."\n");
- }
- } else {
- foreach (@pscat) {
- $r->print(''."\n");
- }
- }
-
- unless (@psprt) {
- foreach (keys %allparts ) {
- $r->print(''."\n");
- }
- } else {
- foreach (@psprt) {
- $r->print(''."\n");
- }
- }
-
+ my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
+ $r->print(&mt('Specific Resource').": ".$resource.
+ ''.
+ '
');
}
- $r->print('
');
+ &usermenu($r,$uname,$id,$udom,$csec);
- my @temp_psprt;
- foreach my $t (@psprt) {
- push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts));
- }
+ $r->print(''.$message.'
');
- @psprt = @temp_psprt;
+ $r->print('
');
my @temp_pscat;
map {
@@ -950,45 +1348,62 @@ sub assessparms {
@pscat = @temp_pscat;
- if (($prevvisit) || ($pschp) || ($pssymb)) {
+ if (($env{'form.prevvisit'}) || ($pschp) || ($pssymb)) {
# ----------------------------------------------------------------- Start Table
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat;
- my $csuname=$ENV{'user.name'};
- my $csudom=$ENV{'user.domain'};
-
-
- if ($parmlev eq 'full' || $parmlev eq 'brief') {
+ my $csuname=$env{'user.name'};
+ my $csudom=$env{'user.domain'};
+ if ($parmlev eq 'full') {
my $coursespan=$csec?8:5;
$r->print('');
$r->print(' | ');
- $r->print('Any User | ');
+ $r->print(''.&mt('Any User').' | ');
if ($uname) {
$r->print("");
- $r->print("User $uname at Domain $udom | ");
+ $r->print(&mt("User")." $uname ".&mt('at Domain')." $udom");
}
+ my %lt=&Apache::lonlocal::texthash(
+ 'pie' => "Parameter in Effect",
+ 'csv' => "Current Session Value",
+ 'at' => 'at',
+ 'rl' => "Resource Level",
+ 'ic' => 'in Course',
+ 'aut' => "Assessment URL and Title",
+ 'type' => 'Type',
+ 'emof' => "Enclosing Map or Folder",
+ 'part' => 'Part',
+ 'pn' => 'Parameter Name',
+ 'def' => 'default',
+ 'femof' => 'from Enclosing Map or Folder',
+ 'gen' => 'general',
+ 'foremf' => 'for Enclosing Map or Folder',
+ 'fr' => 'for Resource'
+ );
$r->print(<Parameter in Effect
-Current Session Value ($csuname at $csudom) |
-
---|
| Resource Level |
-in Course |
+$lt{'pie'} |
+$lt{'csv'} ($csuname $lt{'at'} $csudom) |
+
---|
| $lt{'ic'} | $lt{'rl'} |
+$lt{'ic'} |
+
ENDTABLETWO
if ($csec) {
- $r->print("in Section/Group $csec | ");
+ $r->print("".
+ &mt("in Section/Group")." $csec | ");
}
$r->print(<Assessment URL and Title | Type |
-Enclosing Map | Part No. | Parameter Name |
-default | from Enclosing Map |
-general | for Enclosing Map | for Resource |
+
---|
$lt{'aut'} | $lt{'type'} |
+$lt{'emof'} | $lt{'part'} | $lt{'pn'} |
+$lt{'gen'} | $lt{'foremf'} |
+$lt{'def'} | $lt{'femof'} | $lt{'fr'} |
ENDTABLEHEADFOUR
if ($csec) {
- $r->print('general | for Enclosing Map | for Resource | ');
+ $r->print(''.&mt('general').' | '.&mt('for Enclosing Map or Folder').' | '.&mt('for Resource').' | ');
}
if ($uname) {
- $r->print('general | for Enclosing Map | for Resource | ');
+ $r->print(''.&mt('general').' | '.&mt('for Enclosing Map or Folder').' | '.&mt('for Resource').' | ');
}
$r->print('
');
@@ -1001,18 +1416,20 @@ ENDTABLEHEADFOUR
my $rid=$_;
my ($inmapid)=($rid=~/\.(\d+)$/);
- if (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}) ||
- ($pssymb eq $symbp{$rid})) {
+ if ((!$pssymb &&
+ (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
+ ||
+ ($pssymb && $pssymb eq $symbp{$rid})) {
# ------------------------------------------------------ Entry for one resource
- if ($defbgone eq '"E0E099"') {
- $defbgone='"E0E0DD"';
+ if ($defbgone eq '"#E0E099"') {
+ $defbgone='"#E0E0DD"';
} else {
- $defbgone='"E0E099"';
+ $defbgone='"#E0E099"';
}
- if ($defbgtwo eq '"FFFF99"') {
- $defbgtwo='"FFFFDD"';
+ if ($defbgtwo eq '"#FFFF99"') {
+ $defbgtwo='"#FFFFDD"';
} else {
- $defbgtwo='"FFFF99"';
+ $defbgtwo='"#FFFF99"';
}
my $thistitle='';
my %name= ();
@@ -1021,9 +1438,9 @@ ENDTABLEHEADFOUR
my %display=();
my %type= ();
my %default=();
- my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid});
+ my $uri=&Apache::lonnet::declutter($uris{$rid});
- foreach (split(/\,/,$keyp{$rid})) {
+ foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
if (grep $_ eq $tempkeyp, @catmarker) {
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
@@ -1039,15 +1456,16 @@ ENDTABLEHEADFOUR
my $totalparms=scalar keys %name;
if ($totalparms>0) {
my $firstrow=1;
-
+ my $title=&Apache::lonnet::gettitle($uri);
$r->print(''.
join(' / ',split(/\//,$uri)).
' '.
- "$bighash{'title_'.$rid}");
+ " TARGET=_self>$title");
if ($thistitle) {
$r->print(' ('.$thistitle.')');
@@ -1059,30 +1477,25 @@ ENDTABLEHEADFOUR
$r->print(' | ');
-
- $r->print(' / res / ');
- $r->print(join(' / ', split(/\//,$mapp{$rid})));
-
- $r->print(' | ');
+ '>'.$maptitles{$mapp{$rid}}.'');
- foreach (sort keys %name) {
+ foreach (&keysinorder_bytype(\%name,\%keyorder)) {
unless ($firstrow) {
$r->print('
');
} else {
undef $firstrow;
}
- &print_row($r,$_,\%part,\%name,$rid,\%default,
+ &print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
- $parmlev);
+ $parmlev,$uname,$udom,$csec);
}
}
}
} # end foreach ids
# -------------------------------------------------- End entry for one resource
$r->print('
---|
');
- } # end of brief/full
+ } # end of full
#--------------------------------------------------- Entry for parm level map
if ($parmlev eq 'map') {
my $defbgone = '"E0E099"';
@@ -1119,7 +1532,7 @@ ENDTABLEHEADFOUR
# $r->print("$mapid:$map: $rid
\n");
if ($map eq $mapid) {
- my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid});
+ my $uri=&Apache::lonnet::declutter($uris{$rid});
# $r->print("Keys: $keyp{$rid}
\n");
#--------------------------------------------------------------------
@@ -1129,10 +1542,10 @@ ENDTABLEHEADFOUR
# When storing information, store as part 0
# When requesting information, request from full part
#-------------------------------------------------------------------
- foreach (split(/\,/,$keyp{$rid})) {
+ foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
my $fullkeyp = $tempkeyp;
- $tempkeyp =~ s/_[\d_]+_/_0_/;
+ $tempkeyp =~ s/_\w+_/_0_/;
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
$part{$tempkeyp}="0";
@@ -1140,7 +1553,7 @@ ENDTABLEHEADFOUR
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
- $display{$tempkeyp} =~ s/_[\d_]+_/_0_/;
+ $display{$tempkeyp} =~ s/_\w+_/_0_/;
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
}
@@ -1149,10 +1562,12 @@ ENDTABLEHEADFOUR
} # end loop through ids
#---------------------------------------------------- print header information
+ my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map');
+ my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
$r->print(<
-Set Defaults for All Resources in map
-$maptitle
+Set Defaults for All Resources in $foldermap
+$showtitle
Specifically for
ENDMAPONE
if ($uname) {
@@ -1160,26 +1575,28 @@ ENDMAPONE
('firstname','middlename','lastname','generation', 'id'));
my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'};
- $r->print("User $uname \($person\) in \n");
+ $r->print(&mt("User")." $uname \($person\) ".
+ &mt('in')." \n");
} else {
- $r->print("all users in \n");
+ $r->print("".&mt('all').' '.&mt('users in')." \n");
}
- if ($csec) {$r->print("Section $csec of \n")};
+ if ($csec) {$r->print(&mt("Section")." $csec ".
+ &mt('of')." \n")};
- $r->print("$coursename
");
- $r->print("
\n");
+ $r->print("$coursename
");
+ $r->print("\n");
#---------------------------------------------------------------- print table
$r->print('');
- $r->print('Parameter Name | ');
- $r->print('Default Value | ');
- $r->print('Parameter in Effect |
');
-
- foreach (sort keys %name) {
- &print_row($r,$_,\%part,\%name,$mapid,\%default,
+ $r->print(''.&mt('Parameter Name').' | ');
+ $r->print(''.&mt('Default Value').' | ');
+ $r->print(''.&mt('Parameter in Effect').' |
');
+
+ foreach (&keysinorder(\%name,\%keyorder)) {
+ $r->print('');
+ &print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
- $parmlev);
-# $r->print("
resource.$part{$_}.$name{$_},$symbp{$mapid} |
\n");
+ $parmlev,$uname,$udom,$csec);
}
$r->print("
");
} # end each map
@@ -1202,7 +1619,7 @@ ENDMAPONE
foreach (@ids) {
my $rid = $_;
- my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid});
+ my $uri=&Apache::lonnet::declutter($uris{$rid});
#--------------------------------------------------------------------
# @catmarker contains list of all possible parameters including part #s
@@ -1211,17 +1628,17 @@ ENDMAPONE
# When storing information, store as part 0
# When requesting information, request from full part
#-------------------------------------------------------------------
- foreach (split(/\,/,$keyp{$rid})) {
+ foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
my $fullkeyp = $tempkeyp;
- $tempkeyp =~ s/_[\d_]+_/_0_/;
+ $tempkeyp =~ s/_\w+_/_0_/;
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
$part{$tempkeyp}="0";
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
- $display{$tempkeyp} =~ s/_[\d_]+_/_0_/;
+ $display{$tempkeyp} =~ s/_\w+_/_0_/;
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');
}
@@ -1229,40 +1646,38 @@ ENDMAPONE
} # end loop through ids
#---------------------------------------------------- print header information
+ my $setdef=&mt("Set Defaults for All Resources in Course");
$r->print(<
-Set Defaults for All Resources in Course
-$coursename
+$setdef
+$coursename
ENDMAPONE
if ($uname) {
my %name=&Apache::lonnet::userenvironment($udom,$uname,
('firstname','middlename','lastname','generation', 'id'));
my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'};
- $r->print(" User $uname \($person\) \n");
+ $r->print(" ".&mt("User")." $uname \($person\) \n");
} else {
- $r->print("ALL USERS \n");
+ $r->print(" ".&mt("ALL")." ".&mt("USERS")." \n");
}
- if ($csec) {$r->print("Section $csec\n")};
- $r->print("
\n");
+ if ($csec) {$r->print(&mt("Section")." $csec\n")};
+ $r->print("
\n");
#---------------------------------------------------------------- print table
$r->print('');
- $r->print('Parameter Name | ');
- $r->print('Default Value | ');
- $r->print('Parameter in Effect |
');
-
- foreach (sort keys %name) {
- &print_row($r,$_,\%part,\%name,$mapid,\%default,
- \%type,\%display,$defbgone,$defbgtwo,$parmlev);
-# $r->print("resource.$part{$_}.$name{$_},$symbp{$mapid} |
\n");
+ $r->print(''.&mt('Parameter Name').' | ');
+ $r->print(''.&mt('Default Value').' | ');
+ $r->print(''.&mt('Parameter in Effect').' |
');
+
+ foreach (&keysinorder(\%name,\%keyorder)) {
+ $r->print('');
+ &print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
+ \%type,\%display,$defbgone,$defbgtwo,$parmlev,$uname,$udom,$csec);
}
$r->print("
");
} # end of $parmlev eq general
}
$r->print('