--- loncom/interface/loncommon.pm 2006/07/19 08:36:11 1.431
+++ loncom/interface/loncommon.pm 2006/07/25 15:52:58 1.437
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.431 2006/07/19 08:36:11 albertel Exp $
+# $Id: loncommon.pm,v 1.437 2006/07/25 15:52:58 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -285,7 +285,7 @@ sub browser_and_searcher_javascript {
}
url += 'element=' + elementname + '';
var title = 'Browser';
- var options = 'scrollbars=1,resizable=1,menubar=1,location=1';
+ var options = 'scrollbars=1,resizable=1,menubar=0,toolbar=1,location=1';
options += ',width=700,height=600';
editbrowser = open(url,title,options,'1');
editbrowser.focus();
@@ -306,7 +306,7 @@ sub browser_and_searcher_javascript {
}
url += 'element=' + elementname + '';
var title = 'Search';
- var options = 'scrollbars=1,resizable=1,menubar=0';
+ var options = 'scrollbars=1,resizable=1,menubar=0,toolbar=1,location=1';
options += ',width=700,height=600';
editsearcher = open(url,title,options,'1');
editsearcher.focus();
@@ -672,14 +672,14 @@ sub help_open_topic {
{
$template .=
"
".
- "$text";
+ " | $text";
}
# Add the graphic
my $title = &mt('Online Help');
my $helpicon=&lonhttpdurl("/adm/help/gif/smallHelp.gif");
$template .= <<"ENDTEMPLATE";
-
+
ENDTEMPLATE
if ($text ne '') { $template.=' |
' };
return $template;
@@ -766,29 +766,35 @@ sub help_open_menu {
sub top_nav_help {
my ($text) = @_;
- my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height);
-
- $text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'browser.interface'} eq 'textual' ||
- $env{'environment.remote'} eq 'off' ) {
- $stayOnPage=1;
- }
- $width = 620 if (not defined $width);
- $height = 600 if (not defined $height);
- my $link='';
+ $text = &mt($text);
+
+ my $stayOnPage =
+ ($env{'browser.interface'} eq 'textual' ||
+ $env{'environment.remote'} eq 'off' );
+ my $link= ($stayOnPage) ? "javascript:helpMenu('display')"
+ : "javascript:helpMenu('open')";
+ my $banner_link = &update_help_link(undef,undef,undef,undef,$stayOnPage);
+
my $title = &mt('Get help');
- if ($stayOnPage) {
- $link = "javascript:helpMenu('display')";
- } else {
- $link = "javascript:helpMenu('open')";
- }
+
+ return <<"END";
+$banner_link
+ $text
+END
+}
+
+sub help_menu_js {
+ my ($text) = @_;
+
+ my $stayOnPage =
+ ($env{'browser.interface'} eq 'textual' ||
+ $env{'environment.remote'} eq 'off' );
+
+ my $width = 620;
+ my $height = 600;
my $helptopic=&general_help();
- my $banner_link = &update_help_link($topic,$component_help,$faq,$bug,$stayOnPage);
my $details_link = '/adm/help/'.$helptopic.'.hlp';
- my $template;
my $nothing=&Apache::lonhtmlcommon::javascript_nothing();
- my $helpicon=&lonhttpdurl("/adm/lonIcons/helpgateway.gif");
my $start_page =
&Apache::loncommon::start_page('Help Menu', undef,
{'frameset' => 1,
@@ -800,8 +806,8 @@ sub top_nav_help {
&Apache::loncommon::end_page({'frameset' => 1,
'js_ready' => 1,});
- $template .= <<"ENDTEMPLATE";
-
-$banner_link
- $text
+
ENDTEMPLATE
return $template;
}
@@ -868,14 +872,14 @@ sub help_open_bug {
{
$template .=
"".
- "$text";
+ " | $text";
}
# Add the graphic
my $title = &mt('Report a Bug');
my $bugicon=&lonhttpdurl("/adm/lonMisc/smallBug.gif");
$template .= <<"ENDTEMPLATE";
-
+
ENDTEMPLATE
if ($text ne '') { $template.=' |
' };
return $template;
@@ -913,14 +917,14 @@ sub help_open_faq {
{
$template .=
"".
- "$text";
+ " | $text";
}
# Add the graphic
my $title = &mt('View the FAQ');
my $faqicon=&lonhttpdurl("/adm/lonMisc/smallFAQ.gif");
$template .= <<"ENDTEMPLATE";
-
+
ENDTEMPLATE
if ($text ne '') { $template.=' |
' };
return $template;
@@ -2048,6 +2052,9 @@ sub nickname {
sub getnames {
my ($uname,$udom)=@_;
+ if ($udom eq 'public' && $uname eq 'public') {
+ return ('lastname' => &mt('Public'));
+ }
my $id=$uname.':'.$udom;
my ($names,$cached)=&Apache::lonnet::is_cached_new('namescache',$id);
if ($cached) {
@@ -2885,6 +2892,7 @@ sub bodytag {
} else {
$role = &Apache::lonnet::plaintext($role);
}
+
if (!$realm) { $realm=' '; }
# Set messages
my $messages=&domainlogo($domain);
@@ -2913,6 +2921,11 @@ sub bodytag {
}
my $name = &plainname($env{'user.name'},$env{'user.domain'});
+ if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
+ undef($role);
+ } else {
+ $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
+ }
my $roleinfo=(<
@@ -3262,14 +3275,18 @@ table#LC_top_nav td a, div#LC_top_nav a
}
table#LC_top_nav td.LC_top_nav_logo {
background: $tabbg;
- text-align: right;
+ text-align: left;
white-space: nowrap;
- font-weight: bold;
+ width: 31px;
}
table#LC_top_nav td.LC_top_nav_logo img {
- margin-left: 0.2em;
+ border: 0px;
vertical-align: bottom;
}
+table#LC_top_nav td.LC_top_nav_exit,
+table#LC_top_nav td.LC_top_nav_help {
+ width: 2.0em;
+}
table.LC_breadcrumbs td, table.LC_docs_path td {
background: $tabbg;
color: $font;
@@ -3680,6 +3697,11 @@ sub headtag {
if ($args->{'force_register'}) {
$result .= &Apache::lonmenu::registerurl(1);
}
+ if (!$args->{'no_nav_bar'}
+ && !$args->{'only_body'}
+ && !$args->{'frameset'}) {
+ $result .= &help_menu_js();
+ }
if (ref($args->{'redirect'})) {
my ($time,$url,$inhibit_continue) = @{$args->{'redirect'}};
@@ -3849,7 +3871,7 @@ sub start_page {
#&Apache::lonnet::logthis("start_page ".join(':',caller(0)));
my %head_args;
foreach my $arg ('redirect','force_register','domain','function',
- 'bgcolor') {
+ 'bgcolor','frameset','no_nav_bar','only_body') {
if (defined($args->{$arg})) {
$head_args{$arg} = $args->{$arg};
}