version 1.97, 2007/03/07 16:24:08
|
version 1.98, 2007/04/13 13:39:32
|
Line 516 ENDVCSCREEN
|
Line 516 ENDVCSCREEN
|
} |
} |
|
|
################################################################ |
################################################################ |
|
# Icon Subroutines # |
|
################################################################ |
|
sub iconchanger { |
|
my $r = shift; |
|
my $user = $env{'user.name'}; |
|
my $domain = $env{'user.domain'}; |
|
my %userenv = &Apache::lonnet::get |
|
('environment',['icons']); |
|
my $iconic='checked="checked"'; |
|
my $classic=''; |
|
if ($userenv{'icons'} eq 'classic') { |
|
$classic='checked="checked"'; |
|
$iconic=''; |
|
} |
|
my $useicons=&mt('Use icons'); |
|
my $usebuttons=&mt('Use classic buttons'); |
|
my $change=&mt('Change'); |
|
$r->print(<<ENDSCREEN); |
|
<form name="prefs" action="/adm/preferences" method="post"> |
|
<input type="hidden" name="action" value="verify_and_change_icons" /> |
|
<label><input type="radio" name="menumode" value="iconic" $iconic /> $useicons</label><br /> |
|
<label><input type="radio" name="menumode" value="classic" $classic /> $usebuttons</label><br /> |
|
<input type="submit" value="$change" /> |
|
</form> |
|
ENDSCREEN |
|
} |
|
|
|
sub verify_and_change_icons { |
|
my $r = shift; |
|
my $user = $env{'user.name'}; |
|
my $domain = $env{'user.domain'}; |
|
my $newicons = $env{'form.menumode'}; |
|
|
|
&Apache::lonnet::put('environment',{'icons' => $newicons}); |
|
&Apache::lonnet::appenv('environment.icons' => $newicons); |
|
$r->print(&mt('Set menu mode to [_1].',$newicons)); |
|
} |
|
|
|
################################################################ |
# Message Forward # |
# Message Forward # |
################################################################ |
################################################################ |
|
|
Line 1470 sub handler {
|
Line 1509 sub handler {
|
})); |
})); |
} |
} |
|
|
|
push (@Options,({ action => 'changeicons', |
|
linktext => 'Change How Main Menu is Displayed', |
|
href => '/adm/preferences', |
|
subroutine => \&iconchanger, |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changeicons', |
|
text => 'Change Main Menu'}, |
|
}, |
|
{ action => 'verify_and_change_icons', |
|
subroutine => \&verify_and_change_icons, |
|
breadcrumb => |
|
{ href => '/adm/preferences?action=changeicons', |
|
text => 'Change Main Menu'}, |
|
printmenu => 'yes', |
|
})); |
|
|
if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) |
if (&Apache::lonnet::allowed('whn',$env{'request.course.id'}) |
|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' |
|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' |
.$env{'request.course.sec'})) { |
.$env{'request.course.sec'})) { |