[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
bisitz
bisitz at source.lon-capa.org
Mon Feb 10 13:39:30 EST 2014
bisitz Mon Feb 10 18:39:30 2014 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- Corrected unbalanced tags
- XHTML
- Internationalization: proper concatenation of translation phrases
- Fixed typo
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.388 loncom/interface/loncreateuser.pm:1.389
--- loncom/interface/loncreateuser.pm:1.388 Wed Feb 5 18:02:16 2014
+++ loncom/interface/loncreateuser.pm Mon Feb 10 18:39:29 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.388 2014/02/05 18:02:16 bisitz Exp $
+# $Id: loncreateuser.pm,v 1.389 2014/02/10 18:39:29 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1230,6 +1230,7 @@
}
}
}
+ my $title = '';
if ($newuser) {
my ($portfolioform,$domroleform);
if ((&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) ||
@@ -1243,10 +1244,6 @@
}
&initialize_authen_forms($ccdomain,$formname);
my %lt=&Apache::lonlocal::texthash(
- 'cnu' => 'Create New User',
- 'ast' => 'as a student',
- 'ame' => 'as a member',
- 'ind' => 'in domain',
'lg' => 'Login Data',
'hs' => "Home Server",
);
@@ -1260,16 +1257,21 @@
// ]]>
</script>
<input type='hidden' name='makeuser' value='1' />
-<h2>$lt{'cnu'} "$ccuname" $lt{'ind'} $ccdomain
ENDTITLE
if ($env{'form.action'} eq 'singlestudent') {
if ($crstype eq 'Community') {
- $r->print(' ('.$lt{'ame'}.')');
+ $title = &mt('Create New User [_1] in domain [_2] as a member',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
} else {
- $r->print(' ('.$lt{'ast'}.')');
+ $title = &mt('Create New User [_1] in domain [_2] as a student',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
+ } else {
+ $title = &mt('Create New User [_1] in domain [_2]',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
- $r->print('</h2>'."\n".'<div class="LC_left_float">');
+ $r->print('<h2>'.$title.'</h2>'."\n");
+ $r->print('<div class="LC_left_float">');
my $personal_table =
&personal_data_display($ccuname,$ccdomain,$newuser,$context,
$inst_results{$ccuname.':'.$ccdomain});
@@ -1360,28 +1362,21 @@
}
$r->print('</div><div class="LC_clear_float_footer"></div>');
} else { # user already exists
- my %lt=&Apache::lonlocal::texthash(
- 'cup' => "Modify existing user: ",
- 'ens' => "Enroll one student: ",
- 'enm' => "Enroll one member: ",
- 'id' => "in domain",
- );
- $r->print(<<ENDCHANGEUSER);
-$start_page
-$forminfo
-<h2>
-ENDCHANGEUSER
+ $r->print($start_page.$forminfo);
if ($env{'form.action'} eq 'singlestudent') {
if ($crstype eq 'Community') {
- $r->print($lt{'enm'});
+ $title = &mt('Enroll one member: [_1] in domain [_2]',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
} else {
- $r->print($lt{'ens'});
+ $title = &mt('Enroll one student: [_1] in domain [_2]',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
} else {
- $r->print($lt{'cup'});
+ $title = &mt('Modify existing user: [_1] in domain [_2]',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
- $r->print(' "'.$ccuname.'" '.$lt{'id'}.' "'.$ccdomain.'"</h2>'.
- "\n".'<div class="LC_left_float">');
+ $r->print('<h2>'.$title.'</h2>'."\n");
+ $r->print('<div class="LC_left_float">');
my $personal_table =
&personal_data_display($ccuname,$ccdomain,$newuser,$context,
$inst_results{$ccuname.':'.$ccdomain});
@@ -2292,7 +2287,7 @@
}
}
if (!$hiderow) {
- my $row = &Apache::lonhtmlcommon::row_title(&mt('Affliations'),undef,'LC_oddrow_value')."\n".
+ my $row = &Apache::lonhtmlcommon::row_title(&mt('Affiliations'),undef,'LC_oddrow_value')."\n".
$shown.&Apache::lonhtmlcommon::row_closure(1);
if ($context eq 'selfcreate') {
$rowcount ++;
@@ -2472,9 +2467,12 @@
if (! exists($env{'form.makeuser'})) {
# Modifying an existing user, so check the validity of the name
if ($uhome eq 'no_host') {
- $r->print($error.&mt('Unable to determine home server for ').
- $env{'form.ccuname'}.&mt(' in domain ').
- $env{'form.ccdomain'}.'.');
+ $r->print(
+ $error
+ .'<p class="LC_error">'
+ .&mt('Unable to determine home server for [_1] in domain [_2].',
+ '"'.$env{'form.ccuname'}.'"','"'.$env{'form.ccdomain'}.'"')
+ .'</p>');
return;
}
}
@@ -3064,9 +3062,12 @@
&Apache::lonnet::appenv(\%newenvhash);
}
} else { # error occurred
- $r->print('<span class="LC_error">'.&mt('Unable to successfully change environment for').' '.
- $env{'form.ccuname'}.' '.&mt('in domain').' '.
- $env{'form.ccdomain'}.'</span><br />');
+ $r->print(
+ '<p class="LC_error">'
+ .&mt('Unable to successfully change environment for [_1] in domain [_2].',
+ '"'.$env{'form.ccuname'}.'"',
+ '"'.$env{'form.ccdomain'}.'"')
+ .'</p>');
}
} else { # End of if ($env ... ) logic
# They did not want to change the users name, quota, tool availability,
@@ -6994,22 +6995,22 @@
my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
'<td><br /><span class="LC_nobreak"><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" />'.
$courseform.(' ' x4).'</span></td>'."\n".
- '<td valign><br /><select name="role">'."\n";
+ '<td valign="top"><br /><select name="role">'."\n";
foreach my $role (@roles) {
my $plrole=&Apache::lonnet::plaintext($role);
- $otheritems .= ' <option value="'.$role.'">'.$plrole;
+ $otheritems .= ' <option value="'.$role.'">'.$plrole.'</option>';
}
if ( keys %customroles > 0) {
foreach my $cust (sort keys %customroles) {
my $custrole='cr_cr_'.$env{'user.domain'}.
'_'.$env{'user.name'}.'_'.$cust;
- $otheritems .= ' <option value="'.$custrole.'">'.$cust;
+ $otheritems .= ' <option value="'.$custrole.'">'.$cust.'</option>';
}
}
$otheritems .= '</select></td><td>'.
'<table border="0" cellspacing="0" cellpadding="0">'.
'<tr><td valign="top"><b>'.$lt{'exs'}.'</b><br /><select name="currsec">'.
- ' <option value=""><--'.&mt('Pick course first').'</select></td>'.
+ ' <option value=""><--'.&mt('Pick course first').'</option></select></td>'.
'<td> </td>'.
'<td valign="top"> <b>'.$lt{'new'}.'</b><br />'.
'<input type="text" name="newsec" value="" />'.
More information about the LON-CAPA-cvs
mailing list