--- loncom/interface/loncommon.pm 2007/04/05 21:36:15 1.519
+++ 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.519 2007/04/05 21:36:15 raeburn 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'}; }
@@ -3248,7 +3253,7 @@ sub domainlogo {
# See if there is a logo
if ($designhash{$domain.'.login.domlogo'} ne '') {
my $imgsrc = $designhash{$domain.'.login.domlogo'};
- if ($imgsrc =~ /^\/adm/) {
+ if ($imgsrc =~ /^\/(adm|res)/) {
$imgsrc = &lonhttpdurl($imgsrc);
}
return '';
@@ -3290,11 +3295,19 @@ sub designparm {
}
$domain=&determinedomain($domain);
my %domdesign = &get_domainconf($domain);
+ my $output;
if ($domdesign{$domain.'.'.$which} ne '') {
- return $domdesign{$domain.'.'.$which};
+ $output = $domdesign{$domain.'.'.$which};
} else {
- return $defaultdesign{$which};
+ $output = $defaultdesign{$which};
+ }
+ if (($which =~ /^(student|coordinator|author|admin)\.img$/) ||
+ ($which =~ /login\.(img|logo|domlogo)/)) {
+ if ($output =~ /^\/(adm|res)\//) {
+ $output = &lonhttpdurl($output);
+ }
}
+ return $output;
}
###############################################
@@ -3403,9 +3416,7 @@ sub bodytag {
my $bodytag = "