[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
bisitz
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 10 Oct 2008 15:29:18 -0000
bisitz Fri Oct 10 11:29:18 2008 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- Optimized blank elimination which came with lonparmset 1.411 (Thanks to Gerd)
- Same wording everywhere ("ID")
- Added fieldset to Groups/Sections selection
- Added missing &mt() call ("or")
- Added fieldset to user selection
- Optimized &mt() usage for user selection texts
- Optimized alignment for parts table (should be replaced with CSS lateron)
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.411 loncom/interface/lonparmset.pm:1.412
--- loncom/interface/lonparmset.pm:1.411 Fri Oct 10 06:54:03 2008
+++ loncom/interface/lonparmset.pm Fri Oct 10 11:29:17 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.411 2008/10/10 10:54:03 bisitz Exp $
+# $Id: lonparmset.pm,v 1.412 2008/10/10 15:29:17 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -973,7 +973,7 @@
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
my $display= &Apache::lonnet::metadata($srcf,$key.'.display');
my $parmdis = $display;
- $parmdis =~ s/ \[Part.*$//g;
+ $parmdis =~ s/\s*\[Part.*$//g;
$$allparms{$name}=$parmdis;
if (ref($defkeytype)) {
$$defkeytype{$name}=
@@ -1185,21 +1185,18 @@
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
&Apache::loncommon::selectstudent_link('parmform','uname','udom');
my $selscript=&Apache::loncommon::studentbrowser_javascript();
- my %lt=&Apache::lonlocal::texthash(
- 'se' => "Section",
- 'gr' => "Group",
- 'fu' => "For User",
- 'oi' => "or ID",
- 'ad' => "at Domain"
- );
+
my $sections='';
my %sectionhash = &Apache::loncommon::get_sections();
my $groups;
my %grouphash = &Apache::longroup::coursegroups();
+ my $g_s_header='';
+ my $g_s_footer='';
+
if (%sectionhash) {
- $sections=$lt{'se'}.': <select name="csec"';
+ $sections=&mt('Section:').' <select name="csec"';
if (%grouphash && $parmlev ne 'full') {
$sections .= qq| onchange="group_or_section('csec')" |;
}
@@ -1211,8 +1208,9 @@
}
$sections.='</select>';
}
+
if (%sectionhash && %grouphash && $parmlev ne 'full') {
- $sections .= ' or ';
+ $sections .= ' '.&mt('or').' ';
$sections .= qq|
<script type="text/javascript">
function group_or_section(caller) {
@@ -1239,7 +1237,7 @@
}
if (%grouphash) {
- $groups=$lt{'gr'}.': <select name="cgroup"';
+ $groups=&mt('Group:').' <select name="cgroup"';
if (%sectionhash && $env{'form.action'} eq 'settable') {
$groups .= qq| onchange="group_or_section('cgroup')" |;
}
@@ -1261,19 +1259,25 @@
}
$groups.='</select>';
}
- $r->print(<<ENDMENU);
-<b>
-$sections
-$groups
-<br />
-$lt{'fu'}
-<input type="text" value="$uname" size="12" name="uname" />
-$lt{'oi'}
-<input type="text" value="$id" size="12" name="id" />
-$lt{'ad'}
-$chooseopt
-</b>
-ENDMENU
+
+ if (%sectionhash || %grouphash) {
+ $g_s_header='<fieldset><legend>'.&mt('Group/Section').'</legend><div>';
+ $g_s_footer='</div></fieldset>';
+ }
+
+ $r->print('<b>'
+ .$g_s_header
+ .$sections
+ .$groups
+ .$g_s_footer
+ .'<fieldset><legend>'.&mt('User').'</legend><div>'
+ .&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]'
+ ,'<input type="text" value="'.$uname.'" size="12" name="uname" />'
+ ,'<input type="text" value="'.$id.'" size="12" name="id" /> '
+ ,$chooseopt)
+ .'</div></fieldset>'
+ .'</b>'
+ );
}
sub displaymenu {
@@ -1281,7 +1285,7 @@
$r->print('<table border="1"><tr><th>'.&mt('Select Parameters to View').'</th><th>'.
&mt('Select Parts to View').'</th></tr><tr><td>');
&parmmenu($r,$allparms,$pscat,$keyorder);
- $r->print('</td><td>');
+ $r->print('</td><td valign="top" align="center">');
&partmenu($r,$allparts,$psprt);
$r->print('</td></tr></table>');
}