version 1.242, 2023/11/06 21:24:23
|
version 1.248, 2025/03/07 02:13:40
|
Line 103 sub languagechanger {
|
Line 103 sub languagechanger {
|
{ href => '/adm/preferences?action=changelanguages', |
{ href => '/adm/preferences?action=changelanguages', |
text => 'Change Language'}); |
text => 'Change Language'}); |
$r->print(Apache::loncommon::start_page('Content Display Settings')); |
$r->print(Apache::loncommon::start_page('Content Display Settings')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language'). |
|
'<div class="LC_landmark" role="main">'); |
my %userenv = &Apache::lonnet::get('environment',['languages']); |
my %userenv = &Apache::lonnet::get('environment',['languages']); |
my $language=$userenv{'languages'}; |
my $language=$userenv{'languages'}; |
|
|
$r->print( |
$r->print( |
'<form name="prefs" action="/adm/preferences" method="post">'."\n". |
'<form name="prefs" action="/adm/preferences" method="post">'."\n". |
'<input type="hidden" name="action" value="verify_and_change_languages" />'. |
'<input type="hidden" name="action" value="verify_and_change_languages" />'. |
'<br /><span class="LC_nobreak">'.&mt('Preferred language').': '. |
'<br /><span class="LC_nobreak"><label>'.&mt('Preferred language').': '. |
&Apache::loncommon::select_language('language',$language,1).'</span>'."\n". |
&Apache::loncommon::select_language('language',$language,1).'</label></span>'."\n". |
'<br /><input type="submit" value="'.&mt('Save').'" /></form>' |
'<br /><input type="submit" value="'.&mt('Save').'" /></form></div>' |
); |
); |
} |
} |
|
|
Line 192 sub texenginechanger {
|
Line 193 sub texenginechanger {
|
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<p> |
<p> |
$lt{'preftxt'}: $selectionbox |
<label>$lt{'preftxt'}: $selectionbox |
<br /> |
</label><br /> |
<input type="submit" value="$lt{'change'}" /> |
<input type="submit" value="$lt{'change'}" /> |
</p> |
</p> |
</form> |
</form> |
Line 275 sub rolesprefchanger {
|
Line 276 sub rolesprefchanger {
|
{ href => '/adm/preferences?action=changerolespref', |
{ href => '/adm/preferences?action=changerolespref', |
text => $brtext}); |
text => $brtext}); |
$r->print(Apache::loncommon::start_page('Content Display Settings')); |
$r->print(Apache::loncommon::start_page('Content Display Settings')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs($brtitle)); |
$r->print(Apache::lonhtmlcommon::breadcrumbs($brtitle). |
|
'<div class="LC_landmark" role="main">'); |
my $hotlist_flag=$userenv{'recentroles'}; |
my $hotlist_flag=$userenv{'recentroles'}; |
my $hotlist_n=$userenv{'recentrolesn'}; |
my $hotlist_n=$userenv{'recentrolesn'}; |
my ($checkedon,$checkedoff); |
my ($checkedon,$checkedoff); |
Line 294 sub rolesprefchanger {
|
Line 296 sub rolesprefchanger {
|
} |
} |
|
|
# Get list of recent roles and display with checkbox in front |
# Get list of recent roles and display with checkbox in front |
my $roles_check_list = ''; |
my $roles_check_list; |
my $role_key=''; |
|
if ($env{'environment.recentroles'}) { |
if ($env{'environment.recentroles'}) { |
my %recent_roles = |
my %recent_roles = |
&Apache::lonhtmlcommon::get_recent('roles',$env{'environment.recentrolesn'}); |
&Apache::lonhtmlcommon::get_recent('roles',$env{'environment.recentrolesn'}); |
my %frozen_roles = |
my %frozen_roles = |
&Apache::lonhtmlcommon::get_recent_frozen('roles',$env{'environment.recentrolesn'}); |
&Apache::lonhtmlcommon::get_recent_frozen('roles',$env{'environment.recentrolesn'}); |
|
|
my %role_text = &rolespref_get_role_text([keys(%recent_roles)]); |
my %role_text = &rolespref_get_role_text([keys(%recent_roles)]); |
my @sorted_roles = sort {$role_text{$a} cmp $role_text{$b}} keys(%role_text); |
my @sorted_roles = sort {$role_text{$a} cmp $role_text{$b}} keys(%role_text); |
|
|
$roles_check_list .= |
if (@sorted_roles) { |
&Apache::loncommon::start_data_table(). |
$roles_check_list = |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table(). |
"<th>".&mt('Freeze '.$role)."</th>". |
&Apache::loncommon::start_data_table_header_row(). |
"<th>".&mt($role)."</th>". |
"<th>".&mt('Freeze '.$role)."</th>". |
&Apache::loncommon::end_data_table_header_row(). |
"<th>".&mt($role)."</th>". |
"\n"; |
&Apache::loncommon::end_data_table_header_row()."\n"; |
my $count; |
my $count = 0; |
foreach $role_key (@sorted_roles) { |
foreach my $role_key (@sorted_roles) { |
my $checked = ""; |
my $checked = ""; |
my $value = $recent_roles{$role_key}; |
my $value = $recent_roles{$role_key}; |
if ($frozen_roles{$role_key}) { |
if ($frozen_roles{$role_key}) { |
$checked = ' checked="checked"'; |
$checked = ' checked="checked"'; |
} |
} |
$count++; |
$count++; |
$roles_check_list .= |
$roles_check_list .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td class="LC_table_cell_checkbox">'. |
'<td class="LC_table_cell_checkbox">'. |
"<input type=\"checkbox\"$checked name=\"freezeroles\"". |
"<input type=\"checkbox\"$checked name=\"freezeroles\"". |
" id=\"freezeroles$count\" value=\"$role_key\" /></td>". |
" id=\"freezeroles$count\" value=\"$role_key\" /></td>". |
"<td><label for=\"freezeroles$count\">". |
"<td><label for=\"freezeroles$count\">". |
"$role_text{$role_key}</label></td>". |
"$role_text{$role_key}</label></td>". |
&Apache::loncommon::end_data_table_row(). "\n"; |
&Apache::loncommon::end_data_table_row(). "\n"; |
|
} |
|
$roles_check_list .= &Apache::loncommon::end_data_table."\n"; |
} |
} |
$roles_check_list .= "</table>\n"; |
|
} |
} |
|
|
my $actionurl = '/adm/preferences'; |
my $actionurl = '/adm/preferences'; |
if ($env{'form.returnurl'} eq '/adm/roles') { |
if ($env{'form.returnurl'} eq '/adm/roles') { |
$actionurl = '/adm/roles'; |
$actionurl = '/adm/roles'; |
} |
} |
$r->print('<h3>'.&mt('Recent Roles Hotlist').'</h3>'); |
$r->print('<h2 class="LC_heading_2">'.&mt('Recent Roles Hotlist').'</h2>'); |
unless ($checkedon) { |
unless ($checkedon) { |
$r->print(&mt('LON-CAPA users with several '.$lc_role.'s may wish to enable the Hotlist.').'<br />'); |
$r->print(&mt('LON-CAPA users with several '.$lc_role.'s may wish to enable the Hotlist.').'<br />'); |
} |
} |
Line 344 sub rolesprefchanger {
|
Line 346 sub rolesprefchanger {
|
<form name="prefs" action="'.$actionurl.'" method="post"> |
<form name="prefs" action="'.$actionurl.'" method="post"> |
<input type="hidden" name="action" value="verify_and_change_rolespref" /> |
<input type="hidden" name="action" value="verify_and_change_rolespref" /> |
<input type="hidden" name="returnurl" value="'.$env{'form.returnurl'}.'" /> |
<input type="hidden" name="returnurl" value="'.$env{'form.returnurl'}.'" /> |
<div class="LC_left_float"><h4>'.&mt('Hotlist options').'</h4> |
<div class="LC_left_float"><h3 class="LC_heading_3">'.&mt('Hotlist options').'</h3> |
<p>'. |
<p>'. |
&mt('When enabled, the Hotlist keeps track of the last N '.$lc_role.'s visited.').'<br />'. |
&mt('When enabled, the Hotlist keeps track of the last N '.$lc_role.'s visited.').'<br />'. |
&mt('Those N '.$lc_role.'s are then shown in a table at the top of the '.$lc_role.'s page.').'</p>'. |
&mt('Those N '.$lc_role.'s are then shown in a table at the top of the '.$lc_role.'s page.').'</p>'. |
Line 365 $options.'
|
Line 367 $options.'
|
</div>'); |
</div>'); |
if ($roles_check_list) { |
if ($roles_check_list) { |
$r->print('<div class="LC_left_float"> |
$r->print('<div class="LC_left_float"> |
<h4>'.&mt('Freeze Roles').'</h4> |
<h3 class="LC_heading_3">'.&mt('Freeze Roles').'</h3> |
<p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'. |
<p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'. |
&mt('Those '.$lc_role.'s marked frozen will not be removed from the list, even if not recently used.').' |
&mt('Those '.$lc_role.'s marked frozen will not be removed from the list, even if not recently used.').' |
</p> |
</p> |
Line 378 $options.'
|
Line 380 $options.'
|
$r->print(' |
$r->print(' |
<br clear="all" /> |
<br clear="all" /> |
<input type="submit" value="'.&mt('Save').'" /> |
<input type="submit" value="'.&mt('Save').'" /> |
</form>'); |
</form></div>'); |
} |
} |
|
|
sub rolespref_get_role_text { |
sub rolespref_get_role_text { |
Line 491 sub screennamechanger {
|
Line 493 sub screennamechanger {
|
text => 'Change Screen Name'}); |
text => 'Change Screen Name'}); |
$r->print(Apache::loncommon::start_page('Personal Data')); |
$r->print(Apache::loncommon::start_page('Personal Data')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name')); |
$r->print('<p>' |
$r->print('<div class="LC_landmark" role="main">'); |
.&mt('Change the name that is displayed in your posts.') |
my $caption = &mt('Name displayed in posts you make').':'; |
.'</p>' |
|
); |
|
$r->print('<form name="prefs" action="/adm/preferences" method="post">' |
$r->print('<form name="prefs" action="/adm/preferences" method="post">' |
.'<input type="hidden" name="action" value="verify_and_change_screenname" />' |
.'<p><input type="hidden" name="action" value="verify_and_change_screenname" />' |
.&Apache::lonhtmlcommon::start_pick_box() |
.&Apache::lonhtmlcommon::start_pick_box(undef,undef,$caption,'LC_caption_prefs') |
.&Apache::lonhtmlcommon::row_title(&mt('Screenname').' '.&mt('(shown if you post anonymously)')) |
.&Apache::lonhtmlcommon::row_title('<label for="screenname">'.&mt('Screenname').'</label> '.&mt('(shown if you post anonymously)')) |
.'<input type="text" size="20" value="'.$screenname.'" name="screenname" />' |
.'<input type="text" size="20" value="'.$screenname.'" name="screenname" id="screenname" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title(&mt('Nickname').' '.&mt('(shown if you post non-anonymously)')) |
.&Apache::lonhtmlcommon::row_title('<label for="nickname">'.&mt('Nickname').'</label> '.&mt('(shown if you post non-anonymously)')) |
.'<input type="text" size="20" value="'.$nickname.'" name="nickname" />' |
.'<input type="text" size="20" value="'.$nickname.'" name="nickname" id="nickname" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title() |
.&Apache::lonhtmlcommon::row_title('<span class="LC_visually_hidden">'.&mt('Submit').':</span>','','','',1) |
.'<input type="submit" value="'.&mt('Save').'" />' |
.'<input type="submit" value="'.&mt('Save').'" />' |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::end_pick_box() |
.&Apache::lonhtmlcommon::end_pick_box() |
.'</form>' |
.'</p></form></div>' |
); |
); |
} |
} |
|
|
Line 556 sub iconchanger {
|
Line 556 sub iconchanger {
|
{ href => '/adm/preferences?action=changeicons', |
{ href => '/adm/preferences?action=changeicons', |
text => 'Change Menu Display'}); |
text => 'Change Menu Display'}); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Menu Display')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Menu Display'). |
|
'<div class="LC_landmark" role="main">'); |
|
|
my $user = $env{'user.name'}; |
my $user = $env{'user.name'}; |
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
Line 591 sub iconchanger {
|
Line 592 sub iconchanger {
|
'<ul>'. |
'<ul>'. |
$iconic_preview. |
$iconic_preview. |
'</ul></li></ul>'; |
'</ul></li></ul>'; |
|
my $title = &mt('Use of icons and text'); |
$r->print(<<ENDSCREEN); |
$r->print(<<ENDSCREEN); |
$classic |
$classic |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_icons" /> |
<input type="hidden" name="action" value="verify_and_change_icons" /> |
|
<fieldset style="display:inline;"><legend>$title</legend> |
<label><input type="radio" name="menumode" value="iconic" $iconic /> $lt{'iconic'}</label>$iconic_preview<br /> |
<label><input type="radio" name="menumode" value="iconic" $iconic /> $lt{'iconic'}</label>$iconic_preview<br /> |
<label><input type="radio" name="menumode" value="iconsonly" $onlyicon /> $lt{'iconsonly'}</label>$iconsonly_preview<br /> |
<label><input type="radio" name="menumode" value="iconsonly" $onlyicon /> $lt{'iconsonly'}</label>$iconsonly_preview<br /> |
|
</fieldset> |
|
<p> |
<input type="submit" value="$change" /> |
<input type="submit" value="$change" /> |
</form> |
</p> |
|
</form></div> |
ENDSCREEN |
ENDSCREEN |
} |
} |
|
|
Line 657 sub clickerchanger {
|
Line 663 sub clickerchanger {
|
{ href => '/adm/preferences?action=changeclicker', |
{ href => '/adm/preferences?action=changeclicker', |
text => 'Register Clicker'}); |
text => 'Register Clicker'}); |
$r->print(Apache::loncommon::start_page('Other')); |
$r->print(Apache::loncommon::start_page('Other')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker'). |
|
'<div class="LC_landmark" role="main">'); |
my $user = $env{'user.name'}; |
my $user = $env{'user.name'}; |
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
my %userenv = &Apache::lonnet::get |
my %userenv = &Apache::lonnet::get |
Line 668 sub clickerchanger {
|
Line 675 sub clickerchanger {
|
my $change=&mt('Save'); |
my $change=&mt('Save'); |
my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID')); |
my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID')); |
$r->print(<<ENDSCREEN); |
$r->print(<<ENDSCREEN); |
|
<br /> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_clicker" /> |
<input type="hidden" name="action" value="verify_and_change_clicker" /> |
<label>$helplink<br /><br />$text<br /> |
<label>$helplink<br /><br />$text<br /> |
<textarea name="clickers" rows="5" cols="20">$clickers</textarea> |
<textarea name="clickers" rows="5" cols="20">$clickers</textarea> |
</label> |
</label> |
<br /> |
<p> |
<input type="submit" value="$change" /> |
<input type="submit" value="$change" /> |
|
</p> |
</form> |
</form> |
|
</div> |
ENDSCREEN |
ENDSCREEN |
} |
} |
|
|
Line 848 sub msgforwardchanger {
|
Line 858 sub msgforwardchanger {
|
notv => 'is not a valid e-mail address', |
notv => 'is not a valid e-mail address', |
toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", |
toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", |
prme => 'Back', |
prme => 'Back', |
|
acti => 'Action', |
|
type => 'Types of message for which notification is sent', |
|
nota => 'Notification address', |
|
exce => 'Excerpt retains HTML tags in message', |
|
modi => 'Modify', |
|
dele => 'Delete', |
|
addn => 'Add new address', |
|
yes => 'Yes', |
|
no => 'No', |
); |
); |
$lt{'foad_exmpl'} = &mt('e.g. [_1]userA:domain1,userB:domain2,...[_2]','<tt>','</tt>'); |
$lt{'foad_exmpl'} = &mt('e.g. [_1]userA:domain1,userB:domain2,...[_2]','<tt>','</tt>'); |
$lt{'mnot_exmpl'} = &mt('e.g. [_1]joe@doe.com[_2]','<tt>','</tt>'); |
$lt{'mnot_exmpl'} = &mt('e.g. [_1]joe@doe.com[_2]','<tt>','</tt>'); |
Apache::lonhtmlcommon::add_breadcrumb( |
Apache::lonhtmlcommon::add_breadcrumb( |
{ href => '/adm/preferences?action=changemsgforward', |
{ href => '/adm/preferences?action=changemsgforward', |
text => 'Messages & Notifications'}); |
text => 'Messages & Notifications'}); |
$r->print(Apache::loncommon::start_page('Messages & Notifications')); |
$r->print(Apache::loncommon::start_page('Messages & Notifications')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Messages & Notifications')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Messages & Notifications'). |
|
'<div class="LC_landmark" role="main">'); |
my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding"); |
my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding"); |
my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification"); |
my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification"); |
my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message"); |
my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message"); |
Line 864 sub msgforwardchanger {
|
Line 884 sub msgforwardchanger {
|
my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email(); |
my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email(); |
my $jscript = qq| |
my $jscript = qq| |
<script type="text/javascript" language="JavaScript"> |
<script type="text/javascript" language="JavaScript"> |
|
// <![CDATA[ |
function validate() { |
function validate() { |
for (var i=0; i<document.prefs.numnotify.value; i++) { |
for (var i=0; i<document.prefs.numnotify.value; i++) { |
var checkaddress = 0; |
var checkaddress = 0; |
Line 916 function modify_address(adnum) {
|
Line 937 function modify_address(adnum) {
|
} |
} |
|
|
$validatescript |
$validatescript |
|
|
|
// ]]> |
</script> |
</script> |
|; |
|; |
$r->print(<<ENDMSG); |
$r->print(<<ENDMSG); |
$jscript |
$jscript |
$message |
$message |
<h3>$lt{'fwdm'} $forwardingHelp</h3> |
<h2 class="LC_heading_2">$lt{'fwdm'} $forwardingHelp</h2> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
<input type="hidden" name="action" value="verify_and_change_msgforward" /> |
$lt{'foad'} ($lt{'foad_exmpl'}): |
<label for="msgforward">$lt{'foad'}</label> ($lt{'foad_exmpl'}): |
<input type="text" size="40" value="$msgforward" name="msgforward" /> |
<input type="text" size="40" value="$msgforward" name="msgforward" id="msgforward" /> |
<br /><br /> |
<p /> |
<h3>$lt{'noti'} $notificationHelp</h3> |
<h2 class="LC_heading_2">$lt{'noti'} $notificationHelp</h2> |
$lt{'mnot'} ($lt{'mnot_exmpl'}):<br /> |
<span id="LC_email_notify">$lt{'mnot'}</span> ($lt{'mnot_exmpl'}):<br /> |
ENDMSG |
ENDMSG |
my @sortforwards = sort (keys(%allnot)); |
my @sortnotify = sort (keys(%allnot)); |
my $output = &Apache::loncommon::start_data_table(). |
my $output = &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th> </th>'. |
'<th>#</th>'. |
'<th>'.&mt('Action').'</th>'. |
'<th>'.$lt{'acti'}.'</th>'. |
'<th>'.&mt('Notification address').'</th><th>'. |
'<th>'.$lt{'nota'}.'</th><th>'. |
&mt('Types of message for which notification is sent'). |
$lt{'type'}. |
$criticalMessageHelp.'</th><th>'. |
$criticalMessageHelp.'</th><th>'. |
&mt('Excerpt retains HTML tags in message').'</th>'. |
$lt{'exce'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(); |
&Apache::loncommon::end_data_table_header_row(); |
my $num = 0; |
my $num = 0; |
my $counter = 1; |
my $counter = 1; |
foreach my $item (@sortforwards) { |
foreach my $item (@sortnotify) { |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row('LC_prefs_row'). |
'<td><b>'.$counter.'</b></td>'. |
'<td><b>'.$counter.'</b></td>'. |
'<td><span class="LC_nobreak"><label>'. |
'<td><span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="modify_notify_'. |
'<input type="checkbox" name="modify_notify_'. |
$num.'" onclick="javscript:modify_address('."'$num'".')" />'. |
$num.'" onclick="javscript:modify_address('."'$num'".')" />'. |
&mt('Modify').'</label></span> '. |
$lt{'modi'}.'</label></span> '.(' ' x2). |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="del_notify_'.$num. |
'<input type="checkbox" name="del_notify_'.$num. |
'" onclick="javscript:delete_address('."'$num'".')" />'. |
'" onclick="javscript:delete_address('."'$num'".')" />'. |
&mt('Delete').'</label></span></td>'. |
$lt{'dele'}.'</label></span></td>'. |
'<td><input type="text" value="'.$item.'" name="address_'. |
'<td><span style="padding: 10px;"><input type="text" value="'.$item.'" name="address_'. |
$num.'" onfocus="javascript:address_changes('."'$num'". |
$num.'" onfocus="javascript:address_changes('."'$num'". |
')" /></td><td>'; |
')" aria-labelledby="LC_email_notify" /></span></td><td>'; |
my %chk; |
my %chk; |
if (defined($allnot{$item}{'crit'})) { |
if (defined($allnot{$item}{'crit'})) { |
if (defined($allnot{$item}{'reg'})) { |
if (defined($allnot{$item}{'reg'})) { |
Line 966 ENDMSG
|
Line 989 ENDMSG
|
} else { |
} else { |
$chk{'reg'} = 'checked="checked" '; |
$chk{'reg'} = 'checked="checked" '; |
} |
} |
|
$output .= '<fieldset class="LC_landmark" style="display:inline"><legend class="LC_visually_hidden">'.$lt{'type'}.'</legend>'; |
foreach my $type ('all','crit','reg') { |
foreach my $type ('all','crit','reg') { |
$output .= '<span class="LC_nobreak"><label>'. |
$output .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="notify_type_'.$num. |
'<input type="radio" name="notify_type_'.$num. |
'" value="'.$type.'" '.$chk{$type}. |
'" value="'.$type.'" '.$chk{$type}. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
$lt{$type}.'</label></span>'.(' ' x4); |
$lt{$type}.'</label></span> '.(' ' x2); |
} |
} |
|
$output .= '</fieldset>'; |
my $htmlon = ''; |
my $htmlon = ''; |
my $htmloff = ''; |
my $htmloff = ''; |
if (grep/^\Q$item\E/,@allow_html) { |
if (grep/^\Q$item\E/,@allow_html) { |
Line 980 ENDMSG
|
Line 1005 ENDMSG
|
} else { |
} else { |
$htmloff = 'checked="checked" '; |
$htmloff = 'checked="checked" '; |
} |
} |
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
$output .= '</td><td>'. |
|
'<fieldset class="LC_landmark" style="display:inline"><legend class="LC_visually_hidden">'.$lt{'exce'}.'</legend>'. |
|
'<label><input type="radio" name="html_'.$num. |
'" value="1" '.$htmlon. |
'" value="1" '.$htmlon. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
' onchange="javascript:address_changes('."'$num'".')" />'. |
&mt('Yes').'</label>'.(' ' x3). |
$lt{'yes'}.'</label> '.(' ' x2). |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
$htmloff. ' onchange="javascript:address_changes('."'$num'". |
$htmloff. ' onchange="javascript:address_changes('."'$num'". |
')" />'. |
')" />'. |
&mt('No').'</label></td>'. |
$lt{'no'}.'</label></fieldset></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
$counter ++; |
$counter ++; |
Line 997 ENDMSG
|
Line 1024 ENDMSG
|
crit => '', |
crit => '', |
reg => '', |
reg => '', |
); |
); |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row('LC_prefs_row'). |
'<td><b>'.$counter.'</b></td>'. |
'<td><b>'.$counter.'</b></td>'. |
'<td><span class="LC_nobreak"><label>'. |
'<td><span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="add_notify_'.$num. |
'<input type="checkbox" name="add_notify_'.$num. |
'" value="1" />'.&mt('Add new address').'</label></span></td>'. |
'" value="1" />'.$lt{'addn'}.'</label></span></td>'. |
'<td><input type="text" value="" name="address_'.$num. |
'<td><span style="padding: 10px;"><input type="text" value="" name="address_'.$num. |
'" onfocus="javascript:new_address('."'$num'".')" /></td><td>'; |
'" onfocus="javascript:new_address('."'$num'".')" aria-labelledby="LC_email_notify" /></span></td><td>'; |
|
$output .= '<fieldset class="LC_landmark" style="display:inline"><legend class="LC_visually_hidden">'.$lt{'type'}.'</legend>'; |
foreach my $type ('all','crit','reg') { |
foreach my $type ('all','crit','reg') { |
$output .= '<span class="LC_nobreak"><label>'. |
$output .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="notify_type_'.$num. |
'<input type="radio" name="notify_type_'.$num. |
'" value="'.$type.'" '.$defchk{$type}.'/>'. |
'" value="'.$type.'" '.$defchk{$type}.'/>'. |
$lt{$type}.'</label></span>'.(' ' x4); |
$lt{$type}.'</label></span> '.(' ' x2); |
} |
} |
$output .= '</td><td><label><input type="radio" name="html_'.$num. |
$output .= '</fieldset></td><td>'. |
'" value="1" />'.&mt('Yes').'</label>'.(' ' x3). |
'<fieldset class="LC_landmark" style="display:inline"><legend class="LC_visually_hidden">'.$lt{'exce'}.'</legend>'. |
|
'<label><input type="radio" name="html_'.$num. |
|
'" value="1" />'.$lt{'yes'}.'</label> '.(' ' x2). |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
'<label><input type="radio" name="html_'.$num.'" value="0" '. |
' checked="checked" />'. |
' checked="checked" />'. |
&mt('No').'</label></td>'. |
$lt{'no'}.'</label></fieldset></td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
$num ++; |
$num ++; |
Line 1024 ENDMSG
|
Line 1054 ENDMSG
|
<input type="hidden" name="numnotify" value="$num" /> |
<input type="hidden" name="numnotify" value="$num" /> |
<input type="button" value="$lt{'prme'}" onclick="location.href='/adm/preferences'" /> |
<input type="button" value="$lt{'prme'}" onclick="location.href='/adm/preferences'" /> |
<input type="button" value="$lt{'chg'}" onclick="javascript:validate()" /> |
<input type="button" value="$lt{'chg'}" onclick="javascript:validate()" /> |
</form> |
</form></div> |
|); |
|); |
|
|
} |
} |
Line 1158 sub colorschanger {
|
Line 1188 sub colorschanger {
|
{ href => '/adm/preferences?action=changecolors', |
{ href => '/adm/preferences?action=changecolors', |
text => 'Change Colors'}); |
text => 'Change Colors'}); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
$r->print(Apache::loncommon::start_page('Page Display Settings')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors'). |
|
'<div class="LC_landmark" role="main">'); |
# figure out colors |
# figure out colors |
my $function=&Apache::loncommon::get_users_function(); |
my $function=&Apache::loncommon::get_users_function(); |
my $domain=&Apache::loncommon::determinedomain(); |
my $domain=&Apache::loncommon::determinedomain(); |
Line 1172 sub colorschanger {
|
Line 1203 sub colorschanger {
|
'vlink' => 'Visited Link Color', |
'vlink' => 'Visited Link Color', |
'alink' => 'Active Link Color', |
'alink' => 'Active Link Color', |
); |
); |
my $start_data_table = &Apache::loncommon::start_data_table(); |
my $start_data_table = &Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::data_table_caption(&mt('Colors for LON-CAPA pages')). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Page Element').'</th><th>'.&mt('Color').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row(); |
my $chtable=''; |
my $chtable=''; |
foreach my $item (sort(keys(%colortypes))) { |
foreach my $item (sort(keys(%colortypes))) { |
my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); |
my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); |
$chtable.=&Apache::loncommon::start_data_table_row(). |
$chtable.=&Apache::loncommon::start_data_table_row(). |
'<td>'.$colortypes{$item}.'<td><input name="'.$item. |
'<td><label for="'.$item.'">'.$colortypes{$item}.'</label></td>'. |
'" class="colorchooser" size="10" value="'.$curcol. |
'<td><input name="'.$item. |
|
'" class="colorchooser" id="'.$item.'" size="10" value="'.$curcol. |
'" /></td>'. |
'" /></td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
Line 1189 sub colorschanger {
|
Line 1225 sub colorschanger {
|
my $resetbuttondesc = &mt('Reset All Colors to Default'); |
my $resetbuttondesc = &mt('Reset All Colors to Default'); |
my $colorchooser=&Apache::lonhtmlcommon::color_picker(); |
my $colorchooser=&Apache::lonhtmlcommon::color_picker(); |
$r->print('<script type="text/javascript" language="JavaScript"> |
$r->print('<script type="text/javascript" language="JavaScript"> |
' . $colorchooser . ' |
// <![CDATA[' ."\n". $colorchooser . "\n". ' |
|
// ]]> |
</script> |
</script> |
'); |
'); |
$r->print(<<ENDCOL); |
$r->print(<<ENDCOL); |
Line 1199 sub colorschanger {
|
Line 1236 sub colorschanger {
|
<input type="hidden" name="pres_type" /> |
<input type="hidden" name="pres_type" /> |
<input type="hidden" name="pres_value" /> |
<input type="hidden" name="pres_value" /> |
</form> |
</form> |
|
<br /> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_colors" /> |
<input type="hidden" name="action" value="verify_and_change_colors" /> |
$start_data_table |
$start_data_table |
Line 1209 $end_data_table
|
Line 1247 $end_data_table
|
<input type="submit" value="$savebutton" /> |
<input type="submit" value="$savebutton" /> |
<input type="submit" name="resetall" value="$resetbutton" title="$resetbuttondesc" /> |
<input type="submit" name="resetall" value="$resetbutton" title="$resetbuttondesc" /> |
</p> |
</p> |
</form> |
</form></div> |
ENDCOL |
ENDCOL |
} |
} |
|
|
Line 1272 sub passwordchanger {
|
Line 1310 sub passwordchanger {
|
text => 'Change Password'}); |
text => 'Change Password'}); |
unless ($caller eq 'reset_by_email') { |
unless ($caller eq 'reset_by_email') { |
$r->print(Apache::loncommon::start_page('Personal Data')); |
$r->print(Apache::loncommon::start_page('Personal Data')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'). |
|
'<div class="LC_landmark" role="main">'); |
} |
} |
if ((!defined($caller)) || ($caller eq 'preferences')) { |
if ((!defined($caller)) || ($caller eq 'preferences')) { |
$user = $env{'user.name'}; |
$user = $env{'user.name'}; |
Line 1283 sub passwordchanger {
|
Line 1322 sub passwordchanger {
|
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('passwd',$clientip); |
&Apache::loncommon::blocking_status('passwd',$clientip); |
if ($blocked) { |
if ($blocked) { |
$r->print('<p class="LC_warning">'.$blocktext.'</p>'); |
$r->print('<p class="LC_warning">'.$blocktext.'</p></div>'); |
return; |
return; |
} |
} |
} elsif ($caller eq 'reset_by_email') { |
} elsif ($caller eq 'reset_by_email') { |
Line 1333 sub passwordchanger {
|
Line 1372 sub passwordchanger {
|
$r->print( |
$r->print( |
'<p class="LC_error">' |
'<p class="LC_error">' |
.&mt('Page requested in unexpected context') |
.&mt('Page requested in unexpected context') |
.'</p>' |
.'</p></div>' |
); |
); |
return; |
return; |
} |
} |
my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain); |
my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain); |
# Check for authentication types that allow changing of the password. |
# Check for authentication types that allow changing of the password. |
return if ($currentauth !~ /^(unix|internal):/); |
if ($currentauth !~ /^(unix|internal):/) { |
|
unless ($caller eq 'reset_by_email') { |
|
$r->print('</div>'); |
|
} |
|
return; |
|
} |
# |
# |
# Generate keys |
# Generate keys |
my ($lkey_cpass ,$ukey_cpass ) = &Apache::loncommon::des_keys(); |
my ($lkey_cpass ,$ukey_cpass ) = &Apache::loncommon::des_keys(); |
Line 1371 sub passwordchanger {
|
Line 1415 sub passwordchanger {
|
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
$errormessage |
$errormessage |
|
|
<p> |
<p></p> |
<!-- We separate the forms into 'server' and 'client' in order to |
<!-- We separate the forms into 'server' and 'client' in order to |
ensure that unencrypted passwords will not be sent out by a |
ensure that unencrypted passwords will not be sent out by a |
crappy browser --> |
crappy browser --> |
ENDFORM |
ENDFORM |
$r->print(&server_form($logtoken,$caller,$mailtoken,$extrafields)); |
$r->print(&server_form($logtoken,$caller,$mailtoken,$extrafields)); |
$r->print(&client_form($caller,\%hexkey,$currentpass,$domain,$extrafields)); |
$r->print(&client_form($caller,\%hexkey,$currentpass,$domain,$extrafields)); |
|
unless ($caller eq 'reset_by_email') { |
|
$r->print('</div>'); |
|
} |
# |
# |
return; |
return; |
} |
} |
Line 1480 sub jscript_send {
|
Line 1526 sub jscript_send {
|
ENDJS |
ENDJS |
my $output = qq| |
my $output = qq| |
<script type="text/javascript" language="JavaScript"> |
<script type="text/javascript" language="JavaScript"> |
|
// <![CDATA[ |
function send() { |
function send() { |
$passwdcheck |
$passwdcheck |
uextkey=this.document.client.elements.ukey_cpass.value; |
uextkey=this.document.client.elements.ukey_cpass.value; |
Line 1519 $passwdcheck
|
Line 1565 $passwdcheck
|
this.document.pserver.submit(); |
this.document.pserver.submit(); |
} |
} |
|
|
|
// ]]> |
</script> |
</script> |
|; |
|; |
} |
} |
Line 1557 sub client_form {
|
Line 1604 sub client_form {
|
} else { |
} else { |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
'<label for="currentpass">'.$lt{'currentpass'}.'</label>') |
.'<input type="password" name="currentpass" size="20"/>' |
.'<input type="password" name="currentpass" id="currentpass" size="20" />' |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
$output .= &Apache::lonhtmlcommon::row_title( |
$output .= &Apache::lonhtmlcommon::row_title( |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
'<label for="newpass_1">'.$lt{'newpass'}.'</label>') |
.'<input type="password" name="newpass_1" size="20" />' |
.'<input type="password" name="newpass_1" id="newpass_1" size="20" />' |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
'<label for="newpass_2">'.$lt{'confirmpass'}.'</label>') |
.'<input type="password" name="newpass_2" size="20" />' |
.'<input type="password" name="newpass_2" id="newpass_2" size="20" />' |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::row_closure(1) |
.&Apache::lonhtmlcommon::end_pick_box(); |
.&Apache::lonhtmlcommon::end_pick_box(); |
if ($caller eq 'reset_by_email') { |
if ($caller eq 'reset_by_email') { |
Line 1581 sub client_form {
|
Line 1628 sub client_form {
|
<input type="hidden" name="ukey_npass2" value="$hexkey->{'ukey_npass2'}" /> |
<input type="hidden" name="ukey_npass2" value="$hexkey->{'ukey_npass2'}" /> |
<input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" /> |
<input type="hidden" name="lkey_npass2" value="$hexkey->{'lkey_npass2'}" /> |
</form> |
</form> |
</p> |
|
|; |
|; |
return $output; |
return $output; |
} |
} |
Line 1848 sub discussionchanger {
|
Line 1894 sub discussionchanger {
|
{ href => '/adm/preferences?action=changediscussions', |
{ href => '/adm/preferences?action=changediscussions', |
text => 'Change Discussion Preferences'}); |
text => 'Change Discussion Preferences'}); |
$r->print(Apache::loncommon::start_page('Change Discussion Preferences')); |
$r->print(Apache::loncommon::start_page('Change Discussion Preferences')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences'). |
|
'<div class="LC_landmark" role="main">'); |
my $user = $env{'user.name'}; |
my $user = $env{'user.name'}; |
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
my %userenv = &Apache::lonnet::get |
my %userenv = &Apache::lonnet::get |
Line 1916 END
|
Line 1963 END
|
|
|
$r->print('<p class="LC_info">'.$lt{'thde'}.'</p>'); |
$r->print('<p class="LC_info">'.$lt{'thde'}.'</p>'); |
|
|
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<tr> |
|
<th>$lt{'pref'}</th> |
<th>$lt{'pref'}</th> |
<th>$lt{'curr'}</th> |
<th>$lt{'curr'}</th> |
<th>$lt{'actn'}?</th> |
<th>$lt{'actn'}?</th> |
</tr> |
|
END |
END |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row(). |
|
&Apache::loncommon::start_data_table_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<td>$lt{'disa'}</td> |
<td>$lt{'disa'}</td> |
<td>$lt{$discdisp}</td> |
<td>$lt{$discdisp}</td> |
Line 1936 END
|
Line 1983 END
|
<td>$lt{'npmr'}</td> |
<td>$lt{'npmr'}</td> |
<td>$lt{$discmark}</td> |
<td>$lt{$discmark}</td> |
<td><label><input type="checkbox" name="discmark" /><input type="hidden" name="newmark" value="$newmark" /> $lt{'chgt'} "$markchange"</label></td> |
<td><label><input type="checkbox" name="discmark" /><input type="hidden" name="newmark" value="$newmark" /> $lt{'chgt'} "$markchange"</label></td> |
</tr> |
|
END |
END |
$r->print(&Apache::loncommon::end_data_table_row(). |
$r->print(&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table()); |
&Apache::loncommon::end_data_table()); |
|
|
$r->print('<br />' |
$r->print('<br />' |
.'<input type="submit" name="sub" value="'.&mt('Save').'" />' |
.'<input type="submit" name="sub" value="'.&mt('Save').'" />' |
.'</form>' |
.'</form></div>' |
); |
); |
} |
} |
|
|
Line 2080 sub author_space_settings {
|
Line 2126 sub author_space_settings {
|
if (keys(%author_roles) > 0) { |
if (keys(%author_roles) > 0) { |
my ($showdomdefs,$js,$args,@items); |
my ($showdomdefs,$js,$args,@items); |
my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\''); |
my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\''); |
my $reqdmajor = 2; |
if (&expanded_authoring_settings()) { |
my $reqdminor = 12; |
@items = ('nocodemirror'); |
my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'user.domain'},$env{'user.home'}); |
if (&daxe_permitted(\%author_roles)) { |
my ($major,$minor) = ($loncaparev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/); |
push(@items,'daxecollapse'); |
unless (($major eq '' && $minor eq '') || |
} |
($reqdmajor > $major) || (($reqdmajor == $major) && ($reqdminor > $minor))) { |
push(@items,('copyright','sourceavail')); |
@items = ('nocodemirror','copyright','sourceavail'); |
|
$showdomdefs = 1; |
$showdomdefs = 1; |
$js = &toggle_options_js(); |
$js = &toggle_options_js(); |
my $onload; |
my $onload; |
Line 2102 sub author_space_settings {
|
Line 2147 sub author_space_settings {
|
my %domdefs = &Apache::lonnet::get_domain_defaults($domain); |
my %domdefs = &Apache::lonnet::get_domain_defaults($domain); |
my %staticdefaults = ( |
my %staticdefaults = ( |
'nocodemirror' => '0', |
'nocodemirror' => '0', |
|
'daxecollapse' => '0', |
'copyright' => 'default', |
'copyright' => 'default', |
'sourceavail' => 'closed', |
'sourceavail' => 'closed', |
); |
); |
my %lt = &authoring_settings_text(); |
my %lt = &authoring_settings_text(); |
my %titles = &authoring_settings_titles(); |
my %titles = &authoring_settings_titles(); |
$r->print("<h3>$lt{'auss'}</h3><br /><hr />\n". |
$r->print("<h3>$lt{'auss'}</h3>". |
'<form name="prefs" action="/adm/preferences" method="post">'."\n". |
'<form name="prefs" action="/adm/preferences" method="post">'."\n". |
|
'<input type="submit" value="'.$lt{'save'}.'" /><br /><hr />'."\n". |
'<input type="hidden" name="returnurl" value="'.$returnurl.'" />'."\n". |
'<input type="hidden" name="returnurl" value="'.$returnurl.'" />'."\n". |
'<input type="hidden" name="action" value="change_authoring_settings" />'."\n"); |
'<input type="hidden" name="action" value="change_authoring_settings" />'."\n"); |
foreach my $item (@items) { |
foreach my $item (@items) { |
Line 2130 sub author_space_settings {
|
Line 2177 sub author_space_settings {
|
$userelem = &selectbox('userchoice_'.$item,$userenv{$item},'', |
$userelem = &selectbox('userchoice_'.$item,$userenv{$item},'', |
\&Apache::loncommon::source_copyrightdescription, |
\&Apache::loncommon::source_copyrightdescription, |
(&Apache::loncommon::source_copyrightids)); |
(&Apache::loncommon::source_copyrightids)); |
} elsif ($item eq 'nocodemirror') { |
} elsif (($item eq 'nocodemirror') || ($item eq 'daxecollapse')) { |
if ($domdef) { |
if ($domdef) { |
$domdefdisplay = $lt{'yes'}; |
if ($item eq 'daxecollapse') { |
|
$domdefdisplay = $lt{'coll'}; |
|
} else { |
|
$domdefdisplay = $lt{'yes'}; |
|
} |
} else { |
} else { |
$domdefdisplay = $lt{'no'}; |
if ($item eq 'daxecollapse') { |
|
$domdefdisplay = $lt{'expa'}; |
|
} else { |
|
$domdefdisplay = $lt{'no'}; |
|
} |
} |
} |
my %checked; |
my (%checked,%text); |
$checked{'no'} = ' checked="checked"'; |
$checked{'no'} = ' checked="checked"'; |
if ($userenv{$item eq 'yes'}) { |
if ($userenv{$item} eq 'yes') { |
$checked{'yes'} = $checked{'no'}; |
$checked{'yes'} = $checked{'no'}; |
$checked{'no'} = ''; |
$checked{'no'} = ''; |
} |
} |
|
if ($item eq 'daxecollapse') { |
|
%text = ( |
|
yes => $lt{'coll'}, |
|
no => $lt{'expa'}, |
|
); |
|
} else { |
|
%text = ( |
|
yes => $lt{'yes'}, |
|
no => $lt{'no'}, |
|
); |
|
} |
$userelem = '<span class="LC_nobreak">'; |
$userelem = '<span class="LC_nobreak">'; |
foreach my $choice ('yes','no') { |
foreach my $choice ('yes','no') { |
$userelem .= '<label><input type="radio" name="userchoice_'.$item.'" value="'.$choice.'"'. |
$userelem .= '<label><input type="radio" name="userchoice_'.$item.'" value="'.$choice.'"'. |
$checked{$choice}.' />'.$lt{$choice}.'</label> '; |
$checked{$choice}.' />'.$text{$choice}.'</label> '; |
} |
} |
$userelem .= '</span>'; |
$userelem .= '</span>'; |
} |
} |
Line 2155 sub author_space_settings {
|
Line 2221 sub author_space_settings {
|
$divsty = 'display:inline-block'; |
$divsty = 'display:inline-block'; |
} |
} |
$r->print(<<"END"); |
$r->print(<<"END"); |
<h4><span class="LC_nobreak">$titles{$item}</span></h4> |
<h3 class="LC_heading_3"><span class="LC_nobreak">$titles{$item}</span></h3> |
<p class="LC_nobreak">$lt{'curd'}: <span style="font-style:italic">$domdefdisplay</span></p> |
<p class="LC_nobreak">$lt{'curd'}: <span style="font-style:italic">$domdefdisplay</span></p> |
<p class="LC_nobreak"> |
<p class="LC_nobreak"> |
<label><input type="radio" name="$item" value="dom" onclick="toggleOptions(this.form,'$item','user_$item');"$checkeddom />$lt{'used'}</label> |
<label><input type="radio" name="$item" value="dom" onclick="toggleOptions(this.form,'$item','user_$item');"$checkeddom />$lt{'used'}</label> |
Line 2166 $userelem
|
Line 2232 $userelem
|
</fieldset><br /><hr /> |
</fieldset><br /><hr /> |
END |
END |
} |
} |
$r->print('<br />'. |
$r->print('<input type="submit" value="'.$lt{'save'}.'" />'. |
'<input type="submit" value="'.$lt{'save'}.'" />'. |
|
'</form>'."\n"); |
'</form>'."\n"); |
} else { |
} else { |
my $constchecked=''; |
my $constchecked=''; |
Line 2197 sub change_authoring_settings {
|
Line 2262 sub change_authoring_settings {
|
my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au','ca','aa']); |
if (keys(%author_roles) > 0) { |
if (keys(%author_roles) > 0) { |
my $message; |
my $message; |
my $reqdmajor = 2; |
if (!&expanded_authoring_settings()) { |
my $reqdminor = 12; |
|
my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'user.domain'},$env{'user.home'}); |
|
my ($major,$minor) = ($loncaparev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/); |
|
if (($major eq '' && $minor eq '') || |
|
($reqdmajor > $major) || (($reqdmajor == $major) && ($reqdminor > $minor))) { |
|
my %ausettings=('environment.nocodemirror' => ''); |
my %ausettings=('environment.nocodemirror' => ''); |
if ($env{'form.cmoff'}) { $ausettings{'environment.nocodemirror'}='yes'; } |
if ($env{'form.cmoff'}) { $ausettings{'environment.nocodemirror'}='yes'; } |
&Apache::lonnet::put('environment',\%ausettings); |
&Apache::lonnet::put('environment',\%ausettings); |
Line 2216 sub change_authoring_settings {
|
Line 2276 sub change_authoring_settings {
|
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]','<i>'.&mt('Deactivate CodeMirror in Authoring Space').'</i>','<tt>'.$status.'</tt>')); |
$message=&Apache::loncommon::confirmwrapper($message); |
$message=&Apache::loncommon::confirmwrapper($message); |
} else { |
} else { |
my @items = ('nocodemirror','copyright','sourceavail'); |
my @items = ('nocodemirror'); |
|
if (&daxe_permitted(\%author_roles)) { |
|
push(@items,'daxecollapse'); |
|
} |
|
push(@items,('copyright','sourceavail')); |
my %oldsettings = &Apache::lonnet::get('environment',\@items); |
my %oldsettings = &Apache::lonnet::get('environment',\@items); |
my %domdefs = &Apache::lonnet::get_domain_defaults($domain); |
my %domdefs = &Apache::lonnet::get_domain_defaults($domain); |
my %lt = &authoring_settings_text(); |
my %lt = &authoring_settings_text(); |
Line 2232 sub change_authoring_settings {
|
Line 2296 sub change_authoring_settings {
|
} elsif ($env{'form.'.$item} eq 'user') { |
} elsif ($env{'form.'.$item} eq 'user') { |
my $newval = $env{'form.userchoice_'.$item}; |
my $newval = $env{'form.userchoice_'.$item}; |
my @possibles; |
my @possibles; |
if ($item eq 'nocodemirror') { |
if (($item eq 'nocodemirror') || ($item eq 'daxecollapse')) { |
if ($newval =~ /^yes|no$/) { |
if ($newval =~ /^yes|no$/) { |
$newsettings{$item} = $newval; |
$newsettings{$item} = $newval; |
} |
} |
Line 2287 sub change_authoring_settings {
|
Line 2351 sub change_authoring_settings {
|
my $value = $changes{$item}; |
my $value = $changes{$item}; |
if ($item eq 'nocodemirror') { |
if ($item eq 'nocodemirror') { |
$value = $lt{$changes{$item}}; |
$value = $lt{$changes{$item}}; |
|
} elsif ($item eq 'daxecollapse') { |
|
if ($value eq 'yes') { |
|
$value = $lt{'coll'}; |
|
} else { |
|
$value = $lt{'expa'}; |
|
} |
} elsif ($item eq 'copyright') { |
} elsif ($item eq 'copyright') { |
$value = &Apache::loncommon::copyrightdescription($changes{$item}); |
$value = &Apache::loncommon::copyrightdescription($changes{$item}); |
} elsif ($item eq 'sourceavail') { |
} elsif ($item eq 'sourceavail') { |
Line 2334 sub authoring_settings_text {
|
Line 2404 sub authoring_settings_text {
|
'save' => 'Save', |
'save' => 'Save', |
'yes' => 'Deactivated', |
'yes' => 'Deactivated', |
'no' => 'Activated', |
'no' => 'Activated', |
|
'expa' => 'Start Expanded', |
|
'coll' => 'Start Collapsed', |
); |
); |
} |
} |
|
|
sub authoring_settings_titles { |
sub authoring_settings_titles { |
return &Apache::lonlocal::texthash( |
return &Apache::lonlocal::texthash( |
'nocodemirror' => 'CodeMirror for EditXML editor', |
'nocodemirror' => 'CodeMirror for EditXML editor', |
|
'daxecollapse' => 'Daxe editor: collapsible standard LON-CAPA menus', |
'copyright' => 'Default Copyright/Distribution in new metadata file', |
'copyright' => 'Default Copyright/Distribution in new metadata file', |
'sourceavail' => 'Default Source Available in new metadata file', |
'sourceavail' => 'Default Source Available in new metadata file', |
); |
); |
} |
} |
|
|
|
sub expanded_authoring_settings { |
|
my $reqdmajor = 2; |
|
my $reqdminor = 12; |
|
my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'user.domain'},$env{'user.home'}); |
|
my ($major,$minor) = ($loncaparev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/); |
|
unless (($major eq '' && $minor eq '') || |
|
($reqdmajor > $major) || (($reqdmajor == $major) && ($reqdminor > $minor))) { |
|
return 1; |
|
} |
|
return; |
|
} |
|
|
|
sub daxe_permitted { |
|
my ($aurolesref) = @_; |
|
my $hasdaxe; |
|
if (ref($aurolesref) eq 'HASH') { |
|
my %editors; |
|
foreach my $key (keys(%{$aurolesref})) { |
|
if ($key =~ /^:$LONCAPA::match_domain:au$/) { |
|
if (exists($env{'environment.editors'})) { |
|
if (grep(/^daxe$/,split(/,/,$env{'environment.editors'}))) { |
|
$hasdaxe = 1; |
|
last; |
|
} |
|
} |
|
} else { |
|
my ($auname,$audom) = ($key =~ /^($LONCAPA::match_username):($LONCAPA::match_domain):(ca|aa)$/); |
|
if (exists($env{"environment.internal.editors./$audom/$auname"})) { |
|
if (grep(/^daxe$/,split(/,/,$env{"environment.internal.editors./$audom/$auname"}))) { |
|
$hasdaxe = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return $hasdaxe; |
|
} |
|
|
sub lockednameschanger { |
sub lockednameschanger { |
my $r = shift; |
my $r = shift; |
my %userenv = &Apache::lonnet::get('environment',['lockedname']); |
my %userenv = &Apache::lonnet::get('environment',['lockedname']); |
Line 2450 sub timezonechanger {
|
Line 2562 sub timezonechanger {
|
{ href => '/adm/preferences?action=', |
{ href => '/adm/preferences?action=', |
text => 'Set Your Time Zone'}); |
text => 'Set Your Time Zone'}); |
$r->print(Apache::loncommon::start_page('Set Your Time Zone',$js,$args)); |
$r->print(Apache::loncommon::start_page('Set Your Time Zone',$js,$args)); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Set Your Time Zone')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Set Your Time Zone'). |
|
'<div class="LC_landmark" role="main">'); |
my %userenv = &Apache::lonnet::get('environment',['timezone']); |
my %userenv = &Apache::lonnet::get('environment',['timezone']); |
my $timezone = $userenv{'timezone'}; |
my $timezone = $userenv{'timezone'}; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
|
tztu => 'Time Zone in use', |
lctz => 'Use Time Zone set by LON-CAPA', |
lctz => 'Use Time Zone set by LON-CAPA', |
owntz => 'Use Time Zone set by you', |
owntz => 'Use Time Zone set by you', |
save => 'Save', |
save => 'Save', |
Line 2471 sub timezonechanger {
|
Line 2585 sub timezonechanger {
|
$r->print(<<"END"); |
$r->print(<<"END"); |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_timezone" /> |
<input type="hidden" name="action" value="verify_and_change_timezone" /> |
|
<fieldset style="display:inline; padding: 5px;"><legend>$lt{'tztu'}</legend> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<label><input type="radio" name="settimezone" value="0"$checked{'lctz'}$onclick /> |
<label><input type="radio" name="settimezone" value="0"$checked{'lctz'}$onclick /> |
$lt{'lctz'}</label> |
$lt{'lctz'}</label></span><br /> |
|
<span class="LC_nobreak"> |
<label><input type="radio" name="settimezone" value="1"$checked{'owntz'}$onclick /> |
<label><input type="radio" name="settimezone" value="1"$checked{'owntz'}$onclick /> |
$lt{'owntz'}</label><div style="display:$tzsty" id="LC_timezone_selector"> |
$lt{'owntz'}</label></span><div style="display:$tzsty" id="LC_timezone_selector"> |
$selector |
$selector |
</div></span><br /><br /> |
</div></fieldset><p> |
<input type="submit" value="$lt{'save'}" /> |
<input type="submit" value="$lt{'save'}" /> |
</form> |
</p></form></div> |
END |
END |
} |
} |
return; |
return; |
Line 2547 my @menu=
|
Line 2663 my @menu=
|
permission => $permissions{'aboutme'}, |
permission => $permissions{'aboutme'}, |
#help => 'Prefs_About_Me', |
#help => 'Prefs_About_Me', |
icon => 'system-users.png', |
icon => 'system-users.png', |
|
alttext => 'About Me Icon', |
linktitle => 'Edit information about yourself that should be displayed on your public profile.' |
linktitle => 'Edit information about yourself that should be displayed on your public profile.' |
}, |
}, |
{ linktext => 'Screen Name', |
{ linktext => 'Screen Name', |
Line 2554 my @menu=
|
Line 2671 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => 'Prefs_Screen_Name_Nickname', |
#help => 'Prefs_Screen_Name_Nickname', |
icon => 'preferences-desktop-font.png', |
icon => 'preferences-desktop-font.png', |
|
alttext => 'Nickname Icon', |
linktitle => 'Change the name that is displayed in your posts.' |
linktitle => 'Change the name that is displayed in your posts.' |
}, |
}, |
] |
] |
Line 2565 my @menu=
|
Line 2683 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => 'Prefs_Language', |
#help => 'Prefs_Language', |
icon => 'preferences-desktop-locale.png', |
icon => 'preferences-desktop-locale.png', |
|
alttext => 'Language Icon', |
linktitle => 'Choose the default language for this user.' |
linktitle => 'Choose the default language for this user.' |
}, |
}, |
{ linktext => $role.' Page', |
{ linktext => $role.' Page', |
Line 2572 my @menu=
|
Line 2691 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'role_hotlist.png', |
icon => 'role_hotlist.png', |
|
alttext => 'Switch Role Icon', |
linktitle => 'Configure the roles hotlist.' |
linktitle => 'Configure the roles hotlist.' |
}, |
}, |
{ linktext => 'Math display settings', |
{ linktext => 'Math display settings', |
Line 2579 my @menu=
|
Line 2699 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'dismath.png', |
icon => 'dismath.png', |
|
alttext => 'Math Icon', |
linktitle => 'Change how math is displayed.' |
linktitle => 'Change how math is displayed.' |
}, |
}, |
{ |
{ |
Line 2587 my @menu=
|
Line 2708 my @menu=
|
permission => $permissions{'timezone'}, |
permission => $permissions{'timezone'}, |
#help => '', |
#help => '', |
icon => 'timezone.png', |
icon => 'timezone.png', |
|
alttext => 'Clock Icon', |
linktitle => 'Set your time zone.', |
linktitle => 'Set your time zone.', |
} |
} |
] |
] |
Line 2598 my @menu=
|
Line 2720 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => 'Change_Colors', |
#help => 'Change_Colors', |
icon => 'preferences-desktop-theme.png', |
icon => 'preferences-desktop-theme.png', |
|
alttext => 'Colors Icon', |
linktitle => 'Change LON-CAPA default colors.' |
linktitle => 'Change LON-CAPA default colors.' |
}, |
}, |
{ linktext => 'Menu Display', |
{ linktext => 'Menu Display', |
Line 2605 my @menu=
|
Line 2728 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'preferences-system-windows.png', |
icon => 'preferences-system-windows.png', |
|
alttext => 'Menus Icon', |
linktitle => 'Change whether the menus are displayed with icons or icons and text.' |
linktitle => 'Change whether the menus are displayed with icons or icons and text.' |
} |
} |
] |
] |
Line 2616 my @menu=
|
Line 2740 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => 'Prefs_Messages', |
#help => 'Prefs_Messages', |
icon => 'mail-reply-all.png', |
icon => 'mail-reply-all.png', |
|
alttext => 'Notifications Icon', |
linktitle => 'Change messageforwarding or notifications settings.' |
linktitle => 'Change messageforwarding or notifications settings.' |
}, |
}, |
{ linktext => 'Discussion Display', |
{ linktext => 'Discussion Display', |
Line 2623 my @menu=
|
Line 2748 my @menu=
|
permission => 'F', |
permission => 'F', |
#help => 'Change_Discussion_Display', |
#help => 'Change_Discussion_Display', |
icon => 'chat.png', |
icon => 'chat.png', |
|
alttext => 'Discussions Icon', |
linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.' |
linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.' |
}, |
}, |
] |
] |
Line 2637 if (keys(%author_coauthor_roles) > 0) {
|
Line 2763 if (keys(%author_coauthor_roles) > 0) {
|
url => '/adm/preferences?action=authorsettings', |
url => '/adm/preferences?action=authorsettings', |
permission => 'F', |
permission => 'F', |
icon => 'codemirror.png', |
icon => 'codemirror.png', |
|
alttext => 'Coding Icon', |
linktitle => 'Settings for your authoring space.', |
linktitle => 'Settings for your authoring space.', |
}, |
}, |
] |
] |
Line 2649 if (keys(%author_coauthor_roles) > 0) {
|
Line 2776 if (keys(%author_coauthor_roles) > 0) {
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'system-lock-screen.png', |
icon => 'system-lock-screen.png', |
|
alttext => 'Lock Icon', |
linktitle => 'Restrict domain coordinator access.', |
linktitle => 'Restrict domain coordinator access.', |
}); |
}); |
} |
} |
Line 2661 push(@menu,
|
Line 2789 push(@menu,
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'network-workgroup.png', |
icon => 'network-workgroup.png', |
|
alttext => 'Clicker Icon', |
linktitle => 'Register your clicker.' |
linktitle => 'Register your clicker.' |
}, |
}, |
] |
] |
Line 2674 push(@menu,
|
Line 2803 push(@menu,
|
permission => 'F', |
permission => 'F', |
#help => 'Change_Password', |
#help => 'Change_Password', |
icon => 'emblem-readonly.png', |
icon => 'emblem-readonly.png', |
|
alttext => 'Secure Icon', |
linktitle => 'Change your password.', |
linktitle => 'Change your password.', |
}); |
}); |
} |
} |
Line 2685 push(@menu,
|
Line 2815 push(@menu,
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'system-lock-screen.png', |
icon => 'system-lock-screen.png', |
|
alttext => 'Screen Lock Icon', |
linktitle => 'Allow/disallow propagation of name changes from institutional directory service', |
linktitle => 'Allow/disallow propagation of name changes from institutional directory service', |
}); |
}); |
} |
} |
Line 2698 push(@{ $menu[-1]->{items} }, {
|
Line 2829 push(@{ $menu[-1]->{items} }, {
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'course_ini.png', |
icon => 'course_ini.png', |
|
alttext => 'Course Launch Icon', |
linktitle => 'Set the default page to be displayed when you select a course role.', |
linktitle => 'Set the default page to be displayed when you select a course role.', |
}); |
}); |
|
|
Line 2710 push(@{ $menu[-1]->{items} }, {
|
Line 2842 push(@{ $menu[-1]->{items} }, {
|
permission => 'F', |
permission => 'F', |
#help => '', |
#help => '', |
icon => 'blog.png', |
icon => 'blog.png', |
|
alttext => 'Debugging Icon', |
linktitle => 'Toggle Debug Messages.', |
linktitle => 'Toggle Debug Messages.', |
}); |
}); |
} |
} |
|
|
$r->print(&Apache::loncommon::start_page('My Space')); |
$r->print(&Apache::loncommon::start_page('My Space')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences')); |
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences')); |
$r->print($message); |
$r->print('<div class="LC_landmark" role="main">'."\n".$message); |
$r->print(Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(Apache::lonhtmlcommon::generate_menu(@menu)."\n".'</div>'); |
$r->print(Apache::loncommon::end_page()); |
$r->print(Apache::loncommon::end_page()); |
} |
} |
|
|