--- loncom/interface/lonpreferences.pm 2007/01/23 04:09:03 1.96 +++ loncom/interface/lonpreferences.pm 2007/04/13 13:39:32 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.96 2007/01/23 04:09:03 albertel Exp $ +# $Id: lonpreferences.pm,v 1.98 2007/04/13 13:39:32 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -516,6 +516,45 @@ 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 +} + +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 # ################################################################ @@ -852,10 +891,10 @@ sub client_form { if ($caller eq 'reset_by_email') { $output .= qq| E-mail address: - + Username: - + Domain: @@ -1340,7 +1379,7 @@ sub handler { })); push (@Options,({ action => 'changemsgforward', - linktext => 'Change Message Forwarding and Notification Addresses', + linktext => 'Change Message Forwarding and Notification Email Addresses', href => '/adm/preferences', help => 'Prefs_Forwarding', breadcrumb => @@ -1470,6 +1509,22 @@ 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'}) || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/' .$env{'request.course.sec'})) {