version 1.14, 2012/12/31 14:29:08
|
version 1.15, 2013/07/15 17:00:19
|
Line 246 sub html_classlist {
|
Line 246 sub html_classlist {
|
if ($env{'form.action'} eq 'setenv') { |
if ($env{'form.action'} eq 'setenv') { |
$Str .= &process_student_prefs(); |
$Str .= &process_student_prefs(); |
} |
} |
$Str .= '<h3>'.&mt('Student-viewable course roster').'</h3>'; |
$Str .= '<h2>'.&mt('Student-viewable course roster').'</h2>'; |
|
|
$cid = $env{'request.course.id'}; |
$cid = $env{'request.course.id'}; |
$cdom = $env{'course.'.$cid.'.domain'}; |
$cdom = $env{'course.'.$cid.'.domain'}; |
Line 254 sub html_classlist {
|
Line 254 sub html_classlist {
|
|
|
if ($viewsettings->{'limit_to_section'}) { |
if ($viewsettings->{'limit_to_section'}) { |
if ($env{'request.course.sec'} eq '') { |
if ($env{'request.course.sec'} eq '') { |
$title = '<h4>'.&mt('Students with no section').'</h4>'; |
$title = '<h3>'.&mt('Students with no section').'</h3>'; |
$listtype = 'without a section'; |
$listtype = 'without a section'; |
} else { |
} else { |
$title ='<h4>'.&mt('Students in section "[_1]"', |
$title ='<h3>'.&mt('Students in section "[_1]"', |
$env{'request.course.sec'}).'</h4>'; |
$env{'request.course.sec'}).'</h3>'; |
$listtype = 'in the section'; |
$listtype = 'in the section'; |
$secdisplay = " ($env{'request.course.sec'}) "; |
$secdisplay = " ($env{'request.course.sec'}) "; |
} |
} |
} else { |
} else { |
$title .= '<h4>'.&mt('Students in any section').'</h4>'; |
$title .= '<h3>'.&mt('Students in any section').'</h3>'; |
$listtype = 'in the course'; |
$listtype = 'in the course'; |
} |
} |
|
|
Line 410 sub print_roster_form {
|
Line 410 sub print_roster_form {
|
$showoff = ' checked="checked" '; |
$showoff = ' checked="checked" '; |
$showon = ' '; |
$showon = ' '; |
} |
} |
my $output = '<hr /><h4>'.&mt('Your roster setting').'</h4>'; |
my $output = |
|
'<div class="LC_left_float">' |
|
.'<fieldset><legend>'.&mt('Your roster setting').'</legend>'; |
if ($showinroster) { |
if ($showinroster) { |
$output .= &mt('You are currently listed in the student-viewable roster.'); |
$output .= &mt('You are currently listed in the student-viewable roster.'); |
} else { |
} else { |
$output .= &mt('You are currently <b>not</b> listed in the student-viewable roster.'); |
$output .= &mt('You are currently [_1]not[_2] listed in the student-viewable roster.','<b>','</b>'); |
} |
} |
$output .= '<br />'.&mt('Include yourself in the roster?').' '. |
$output .= '<br />'.&mt('Include yourself in the roster?').' '. |
'<form name="studentparm" method="post">'. |
'<form name="studentparm" method="post" action="">'. |
'<span class="LC_nobreak"><label><input type="radio" name="showinroster" value="1"'.$showon.'/>'.&mt('Yes').'</label> <label>'. |
'<span class="LC_nobreak"><label><input type="radio" name="showinroster" value="1"'.$showon.'/>'.&mt('Yes').'</label> <label>'. |
'<input type="radio" name="showinroster" value="0"'.$showoff.'/>'.&mt('No'). |
'<input type="radio" name="showinroster" value="0"'.$showoff.'/>'.&mt('No'). |
'</label></span><br /><br />'. |
'</label></span><br /><br />'. |
'<input type="hidden" name="action" value="setenv" />'. |
'<input type="hidden" name="action" value="setenv" />'. |
'<input type="submit" name="studentsubmit" value="'.&mt('Save').'" /></form><hr />'; |
'<input type="submit" name="studentsubmit" value="'.&mt('Save').'" />'. |
|
'</form></fieldset></div><br clear="all" />'; |
return $output; |
return $output; |
} |
} |
|
|
Line 454 sub process_student_prefs {
|
Line 457 sub process_student_prefs {
|
&Apache::lonnet::appenv(\%changeHash); |
&Apache::lonnet::appenv(\%changeHash); |
my $result = &Apache::lonnet::put('publicroster',{$student => $showinroster,},$cdom,$cnum); |
my $result = &Apache::lonnet::put('publicroster',{$student => $showinroster,},$cdom,$cnum); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$output .= &mt('Display of your name in the student-viewable roster set to <b>[_1]</b>.',$visibility); |
$output .= |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Display of your name in the student-viewable roster set to [_1].','<b>'.$visibility.'</b>')); |
} else { |
} else { |
$output .= '<span class="LC_error">'.&mt('Error occurred saving display setting.').'</span>'; |
$output .= |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Error occurred saving display setting.'),1); |
} |
} |
} else { |
} else { |
$output .= '<span class="LC_error">'.&mt('Error occurred saving display setting.').'</span>'; |
$output .= |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Error occurred saving display setting.'),1); |
} |
} |
} else { |
} else { |
$output .= &mt('Display of your name in the student-viewable roster unchanged (set to <b>[_1]</b>).',$visibility); |
$output .= |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Display of your name in the student-viewable roster unchanged (set to [_1]).','<b>'.$visibility.'</b>')); |
} |
} |
|
$output = &Apache::loncommon::confirmwrapper($output); |
return $output; |
return $output; |
} |
} |
|
|