--- loncom/interface/loncommon.pm 2007/04/11 02:42:00 1.521 +++ loncom/interface/loncommon.pm 2007/06/18 23:19:12 1.537 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.521 2007/04/11 02:42:00 www Exp $ +# $Id: loncommon.pm,v 1.537 2007/06/18 23:19:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -240,7 +240,7 @@ Inputs: formname, elementname formname and elementname specify the name of the html form and the name of the element the selection from the search results will be placed in. - +=back =cut sub browser_and_searcher_javascript { @@ -1467,6 +1467,8 @@ sub home_server_option_list { =pod +=back + =cut ############################################################### @@ -2052,6 +2054,7 @@ if $first is set to 'lastname' then it r ############################################################### sub plainname { my ($uname,$udom,$first)=@_; + return if (!defined($uname) || !defined($udom)); my %names=&getnames($uname,$udom); my $name=&Apache::lonnet::format_name($names{'firstname'}, $names{'middlename'}, @@ -2083,6 +2086,7 @@ if the user does not sub nickname { my ($uname,$udom)=@_; + return if (!defined($uname) || !defined($udom)); my %names=&getnames($uname,$udom); my $name=$names{'nickname'}; if ($name) { @@ -2098,6 +2102,7 @@ sub nickname { sub getnames { my ($uname,$udom)=@_; + return if (!defined($uname) || !defined($udom)); if ($udom eq 'public' && $uname eq 'public') { return ('lastname' => &mt('Public')); } @@ -2912,7 +2917,7 @@ sub blockcheck { } my $no_ownblock = 0; my $no_userblock = 0; - if ($otheruser) { + if ($otheruser && $activity ne 'com') { # Check if current user has 'evb' priv for this if (defined($own_courses{$course})) { foreach my $sec (keys(%{$own_courses{$course}})) { @@ -3165,7 +3170,7 @@ Returns: Determines which domain should ############################################### sub determinedomain { my $domain=shift; - if (! $domain) { + if (! $domain) { # Determine domain if we have not been given one $domain = $Apache::lonnet::perlvar{'lonDefDomain'}; if ($env{'user.domain'}) { $domain=$env{'user.domain'}; } @@ -3411,9 +3416,7 @@ sub bodytag { my $bodytag = "". &Apache::lontexconvert::init_math_support(); - if ($bodyonly - || ($env{'request.state'} eq 'construct' - && $env{'environment.remote'} ne 'off' )) { + if ($bodyonly) { return $bodytag; } elsif ($env{'browser.interface'} eq 'textual') { # Accessibility @@ -3690,20 +3693,18 @@ sub standard_css { my $border = ($env{'browser.type'} eq 'explorer') ? '0px 2px 0px 2px' : '0px 3px 0px 4px'; + return < $defquota) { + $defquota = $quotahash{'quota'}{$item}; + $settingstatus = $item; + } + } + } + } + if ($defquota eq '') { + $defquota = $quotahash{'quota'}{'default'}; + $settingstatus = 'default'; + } + } else { + $settingstatus = 'default'; + $defquota = 20; + } + if (wantarray) { + return ($defquota,$settingstatus); } else { - return '20'; + return $defquota; } }