--- loncom/interface/loncommon.pm 2003/02/13 21:35:50 1.80 +++ loncom/interface/loncommon.pm 2003/02/24 23:32:32 1.83 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.80 2003/02/13 21:35:50 albertel Exp $ +# $Id: loncommon.pm,v 1.83 2003/02/24 23:32:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -81,6 +81,7 @@ use GDBM_File; use POSIX qw(strftime mktime); use Apache::Constants qw(:common); use Apache::lonmsg(); +use Apache::lonmenu(); my $readit; =pod @@ -1103,7 +1104,17 @@ sub get_related_words { ############################################################### # -------------------------------------------------------------- Plaintext name +=pod + +=item plainname($uname,$udom) + +Gets a users name and returns it as a string in +"first middle last generation" +form + +=cut +############################################################### sub plainname { my ($uname,$udom)=@_; my %names=&Apache::lonnet::get('environment', @@ -1117,7 +1128,21 @@ sub plainname { } # -------------------------------------------------------------------- Nickname +=pod + +=item nickname($uname,$udom) + +Gets a users name and returns it as a string as + +""nickname"" +if the user has a nickname or + +"first middle last generation" + +if the user does not + +=cut sub nickname { my ($uname,$udom)=@_; @@ -1138,6 +1163,14 @@ sub nickname { # ------------------------------------------------------------------ Screenname +=pod + +=item screenname($uname,$udom) + +Gets a users screenname and returns it as a string + +=cut + sub screenname { my ($uname,$udom)=@_; my %names= @@ -1449,8 +1482,10 @@ sub domainlogo { my $domain = &determinedomain(shift); # See if there is a logo if (-e '/home/httpd/html/adm/lonDomLogos/'.$domain.'.gif') { - return ''; + my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; + if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } + return ''; } elsif(exists($Apache::lonnet::domaindescription{$domain})) { return $Apache::lonnet::domaindescription{$domain}; } else { @@ -1543,6 +1578,8 @@ sub bodytag { # Set messages my $messages=&domainlogo($domain); # Output + my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; + if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } my $bodytag = < @@ -1550,14 +1587,14 @@ END if ($bodyonly) { return $bodytag; } elsif ($ENV{'browser.interface'} eq 'textual') { - return $bodytag.'

LON-CAPA: '.$title. - '

Main Menu
'; + return $bodytag.&Apache::lonmenu::menubuttons(undef,'web'). + '

LON-CAPA: '.$title.'

'; } else { return(< - + $messages