version 1.133, 2005/11/08 22:08:12
|
version 1.134, 2005/11/11 18:47:09
|
Line 89 sub handler {
|
Line 89 sub handler {
|
|
|
# ================================================================== Roles Init |
# ================================================================== Roles Init |
if ($env{'form.selectrole'}) { |
if ($env{'form.selectrole'}) { |
|
if ($env{'form.newrole'}) { |
|
$env{'form.'.$env{'form.newrole'}}=1; |
|
} |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
my %temp=('logout_'.$env{'request.course.id'} => time); |
my %temp=('logout_'.$env{'request.course.id'} => time); |
&Apache::lonnet::put('email_status',\%temp); |
&Apache::lonnet::put('email_status',\%temp); |
Line 312 ENDENTERKEY
|
Line 315 ENDENTERKEY
|
|
|
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $bodytag=&Apache::loncommon::bodytag('User Roles'); |
my $bodytag=&Apache::loncommon::bodytag('User Roles'); |
|
my $standby=&mt('Role selected. Please stand by.'); |
my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'</td></td></tr></table>'; |
my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'</td></td></tr></table>'; |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
<html> |
<html> |
Line 323 $helptag<br />
|
Line 327 $helptag<br />
|
<script> |
<script> |
$swinfo |
$swinfo |
window.focus(); |
window.focus(); |
|
|
|
active=true; |
|
|
|
function enterrole (thisform,rolecode,buttonname) { |
|
if (active) { |
|
active=false; |
|
document.title='$standby'; |
|
window.status='$standby'; |
|
thisform.newrole.value=rolecode; |
|
thisform.submit(); |
|
} else { |
|
alert('$standby'); |
|
} |
|
} |
</script> |
</script> |
ENDHEADER |
ENDHEADER |
|
|
Line 396 ENDHEADER
|
Line 414 ENDHEADER
|
$r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">'); |
$r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">'); |
$r->print('<input type="hidden" name="orgurl" value="'.$fn.'" />'); |
$r->print('<input type="hidden" name="orgurl" value="'.$fn.'" />'); |
$r->print('<input type="hidden" name="selectrole" value="1" />'); |
$r->print('<input type="hidden" name="selectrole" value="1" />'); |
|
$r->print('<input type="hidden" name="newrole" value="" />'); |
} |
} |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
$r->print( |
$r->print( |
Line 662 ENDHEADER
|
Line 681 ENDHEADER
|
} |
} |
unless ($nochoose) { |
unless ($nochoose) { |
if ($env{'request.role'} ne 'cm') { |
if ($env{'request.role'} ne 'cm') { |
$r->print('<td><input type=submit value="'. |
$r->print('<td><input type="submit" value="'. |
&mt('Select').'" name="cm"></td>'); |
&mt('Select').'" name="cm"></td>'); |
} else { |
} else { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
Line 773 sub build_roletext {
|
Line 792 sub build_roletext {
|
: ' rowspan="2" '; |
: ' rowspan="2" '; |
|
|
unless ($nochoose) { |
unless ($nochoose) { |
|
my $buttonname=$trolecode; |
|
$buttonname=~s/\W//g; |
if (!$button) { |
if (!$button) { |
if ($switchserver) { |
if ($switchserver) { |
$roletext.='<td'.$rowspan.'><a href="/adm/switchserver?'. |
$roletext.='<td'.$rowspan.'><a href="/adm/switchserver?'. |
Line 781 sub build_roletext {
|
Line 802 sub build_roletext {
|
$roletext.=('<td> </td>'); |
$roletext.=('<td> </td>'); |
} |
} |
} elsif ($tstatus eq 'is') { |
} elsif ($tstatus eq 'is') { |
$roletext.=('<td'.$rowspan.'><input type=submit value="'. |
$roletext.='<td'.$rowspan.'><input name="'.$buttonname.'" type="button" value="'. |
&mt('Select').'" name="'. |
&mt('Select').'" onClick="javascript:enterrole(this.form,\''. |
$trolecode.'"></td>'); |
$trolecode."','".$buttonname.'\');"></td>'; |
} elsif ($tryagain) { |
} elsif ($tryagain) { |
$roletext.= |
$roletext.= |
'<td'.$rowspan.'><input type=submit value="'. |
'<td'.$rowspan.'><input name="'.$buttonname.'" type="button" value="'. |
&mt('Try Selecting Again').'" name="'.$trolecode.'"></td>'; |
&mt('Try Selecting Again').'" onClick="javascript:enterrole(this.form,\''. |
|
$trolecode."','".$buttonname.'\');"></td>'; |
} elsif ($advanced) { |
} elsif ($advanced) { |
$roletext.= |
$roletext.= |
'<td'.$rowspan.'><input type=submit value="'. |
'<td'.$rowspan.'><input name="'.$buttonname.'" type="button" value="'. |
&mt('Re-Initialize').'" name="'.$trolecode.'"></td>'; |
&mt('Re-Initialize').'" onClick="javascript:enterrole(this.form,\''. |
|
$trolecode."','".$buttonname.'\');"></td>'; |
} else { |
} else { |
$roletext.='<td'.$rowspan.'> </td>'; |
$roletext.='<td'.$rowspan.'> </td>'; |
} |
} |