--- loncom/interface/loncommon.pm 2002/09/05 15:03:33 1.64 +++ loncom/interface/loncommon.pm 2002/09/17 15:21:51 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.64 2002/09/05 15:03:33 sakharuk Exp $ +# $Id: loncommon.pm,v 1.69 2002/09/17 15:21:51 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -974,6 +974,26 @@ sub plainname { return $name; } +# -------------------------------------------------------------------- Nickname + + +sub nickname { + my ($uname,$udom)=@_; + my %names=&Apache::lonnet::get('environment', + ['nickname','firstname','middlename','lastname','generation'],$udom,$uname); + my $name=$names{'nickname'}; + if ($name) { + $name='"'.$name.'"'; + } else { + $name=$names{'firstname'}.' '.$names{'middlename'}.' '. + $names{'lastname'}.' '.$names{'generation'}; + $name=~s/\s+$//; + $name=~s/\s+/ /g; + } + return $name; +} + + # ------------------------------------------------------------------ Screenname sub screenname { @@ -993,8 +1013,8 @@ sub messagewrapper { # ------------------------------------------------------------- Aboutme Wrapper sub aboutmewrapper { - my ($link,$un,$do)=@_; - return "$link"; + my ($link,$username,$domain)=@_; + return "$link"; } # ------------------------------------------------------------ Syllabus Wrapper @@ -1781,7 +1801,7 @@ will result in $ENV{'form.uname'} and $E returns cache-controlling header code -=item nocache() +=item no_cache($r) specifies header code to not have cache