');
my $hotlist_flag=$userenv{'recentroles'};
my $hotlist_n=$userenv{'recentrolesn'};
my ($checkedon,$checkedoff);
@@ -294,49 +296,49 @@ sub rolesprefchanger {
}
# Get list of recent roles and display with checkbox in front
- my $roles_check_list = '';
- my $role_key='';
+ my $roles_check_list;
if ($env{'environment.recentroles'}) {
my %recent_roles =
&Apache::lonhtmlcommon::get_recent('roles',$env{'environment.recentrolesn'});
my %frozen_roles =
&Apache::lonhtmlcommon::get_recent_frozen('roles',$env{'environment.recentrolesn'});
-
+
my %role_text = &rolespref_get_role_text([keys(%recent_roles)]);
my @sorted_roles = sort {$role_text{$a} cmp $role_text{$b}} keys(%role_text);
- $roles_check_list .=
- &Apache::loncommon::start_data_table().
- &Apache::loncommon::start_data_table_header_row().
- "
');
unless ($checkedon) {
$r->print(&mt('LON-CAPA users with several '.$lc_role.'s may wish to enable the Hotlist.').' ');
}
@@ -344,7 +346,7 @@ sub rolesprefchanger {
'."\n");
} else {
my $constchecked='';
@@ -2206,7 +2276,11 @@ sub change_authoring_settings {
$message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Deactivate CodeMirror in Authoring Space').'',''.$status.''));
$message=&Apache::loncommon::confirmwrapper($message);
} 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 %domdefs = &Apache::lonnet::get_domain_defaults($domain);
my %lt = &authoring_settings_text();
@@ -2222,7 +2296,7 @@ sub change_authoring_settings {
} elsif ($env{'form.'.$item} eq 'user') {
my $newval = $env{'form.userchoice_'.$item};
my @possibles;
- if ($item eq 'nocodemirror') {
+ if (($item eq 'nocodemirror') || ($item eq 'daxecollapse')) {
if ($newval =~ /^yes|no$/) {
$newsettings{$item} = $newval;
}
@@ -2277,6 +2351,12 @@ sub change_authoring_settings {
my $value = $changes{$item};
if ($item eq 'nocodemirror') {
$value = $lt{$changes{$item}};
+ } elsif ($item eq 'daxecollapse') {
+ if ($value eq 'yes') {
+ $value = $lt{'coll'};
+ } else {
+ $value = $lt{'expa'};
+ }
} elsif ($item eq 'copyright') {
$value = &Apache::loncommon::copyrightdescription($changes{$item});
} elsif ($item eq 'sourceavail') {
@@ -2324,12 +2404,15 @@ sub authoring_settings_text {
'save' => 'Save',
'yes' => 'Deactivated',
'no' => 'Activated',
+ 'expa' => 'Start Expanded',
+ 'coll' => 'Start Collapsed',
);
}
sub authoring_settings_titles {
return &Apache::lonlocal::texthash(
'nocodemirror' => 'CodeMirror for EditXML editor',
+ 'daxecollapse' => 'Daxe editor: collapsible standard LON-CAPA menus',
'copyright' => 'Default Copyright/Distribution in new metadata file',
'sourceavail' => 'Default Source Available in new metadata file',
);
@@ -2347,6 +2430,33 @@ sub expanded_authoring_settings {
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 {
my $r = shift;
my %userenv = &Apache::lonnet::get('environment',['lockedname']);
@@ -2452,10 +2562,12 @@ sub timezonechanger {
{ href => '/adm/preferences?action=',
text => 'Set Your Time Zone'});
$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').
+ '
');
my %userenv = &Apache::lonnet::get('environment',['timezone']);
my $timezone = $userenv{'timezone'};
my %lt = &Apache::lonlocal::texthash(
+ tztu => 'Time Zone in use',
lctz => 'Use Time Zone set by LON-CAPA',
owntz => 'Use Time Zone set by you',
save => 'Save',
@@ -2473,15 +2585,17 @@ sub timezonechanger {
$r->print(<<"END");
+
-
+
END
}
return;
@@ -2549,6 +2663,7 @@ my @menu=
permission => $permissions{'aboutme'},
#help => 'Prefs_About_Me',
icon => 'system-users.png',
+ alttext => 'About Me Icon',
linktitle => 'Edit information about yourself that should be displayed on your public profile.'
},
{ linktext => 'Screen Name',
@@ -2556,6 +2671,7 @@ my @menu=
permission => 'F',
#help => 'Prefs_Screen_Name_Nickname',
icon => 'preferences-desktop-font.png',
+ alttext => 'Nickname Icon',
linktitle => 'Change the name that is displayed in your posts.'
},
]
@@ -2567,6 +2683,7 @@ my @menu=
permission => 'F',
#help => 'Prefs_Language',
icon => 'preferences-desktop-locale.png',
+ alttext => 'Language Icon',
linktitle => 'Choose the default language for this user.'
},
{ linktext => $role.' Page',
@@ -2574,6 +2691,7 @@ my @menu=
permission => 'F',
#help => '',
icon => 'role_hotlist.png',
+ alttext => 'Switch Role Icon',
linktitle => 'Configure the roles hotlist.'
},
{ linktext => 'Math display settings',
@@ -2581,6 +2699,7 @@ my @menu=
permission => 'F',
#help => '',
icon => 'dismath.png',
+ alttext => 'Math Icon',
linktitle => 'Change how math is displayed.'
},
{
@@ -2589,6 +2708,7 @@ my @menu=
permission => $permissions{'timezone'},
#help => '',
icon => 'timezone.png',
+ alttext => 'Clock Icon',
linktitle => 'Set your time zone.',
}
]
@@ -2600,6 +2720,7 @@ my @menu=
permission => 'F',
#help => 'Change_Colors',
icon => 'preferences-desktop-theme.png',
+ alttext => 'Colors Icon',
linktitle => 'Change LON-CAPA default colors.'
},
{ linktext => 'Menu Display',
@@ -2607,6 +2728,7 @@ my @menu=
permission => 'F',
#help => '',
icon => 'preferences-system-windows.png',
+ alttext => 'Menus Icon',
linktitle => 'Change whether the menus are displayed with icons or icons and text.'
}
]
@@ -2618,6 +2740,7 @@ my @menu=
permission => 'F',
#help => 'Prefs_Messages',
icon => 'mail-reply-all.png',
+ alttext => 'Notifications Icon',
linktitle => 'Change messageforwarding or notifications settings.'
},
{ linktext => 'Discussion Display',
@@ -2625,6 +2748,7 @@ my @menu=
permission => 'F',
#help => 'Change_Discussion_Display',
icon => 'chat.png',
+ alttext => 'Discussions Icon',
linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'
},
]
@@ -2639,6 +2763,7 @@ if (keys(%author_coauthor_roles) > 0) {
url => '/adm/preferences?action=authorsettings',
permission => 'F',
icon => 'codemirror.png',
+ alttext => 'Coding Icon',
linktitle => 'Settings for your authoring space.',
},
]
@@ -2651,6 +2776,7 @@ if (keys(%author_coauthor_roles) > 0) {
permission => 'F',
#help => '',
icon => 'system-lock-screen.png',
+ alttext => 'Lock Icon',
linktitle => 'Restrict domain coordinator access.',
});
}
@@ -2663,6 +2789,7 @@ push(@menu,
permission => 'F',
#help => '',
icon => 'network-workgroup.png',
+ alttext => 'Clicker Icon',
linktitle => 'Register your clicker.'
},
]
@@ -2676,6 +2803,7 @@ push(@menu,
permission => 'F',
#help => 'Change_Password',
icon => 'emblem-readonly.png',
+ alttext => 'Secure Icon',
linktitle => 'Change your password.',
});
}
@@ -2687,6 +2815,7 @@ push(@menu,
permission => 'F',
#help => '',
icon => 'system-lock-screen.png',
+ alttext => 'Screen Lock Icon',
linktitle => 'Allow/disallow propagation of name changes from institutional directory service',
});
}
@@ -2700,6 +2829,7 @@ push(@{ $menu[-1]->{items} }, {
permission => 'F',
#help => '',
icon => 'course_ini.png',
+ alttext => 'Course Launch Icon',
linktitle => 'Set the default page to be displayed when you select a course role.',
});
@@ -2712,14 +2842,15 @@ push(@{ $menu[-1]->{items} }, {
permission => 'F',
#help => '',
icon => 'blog.png',
+ alttext => 'Debugging Icon',
linktitle => 'Toggle Debug Messages.',
});
}
$r->print(&Apache::loncommon::start_page('My Space'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));
- $r->print($message);
- $r->print(Apache::lonhtmlcommon::generate_menu(@menu));
+ $r->print('