--- loncom/interface/loncommon.pm 2010/05/18 02:26:39 1.948.2.5
+++ loncom/interface/loncommon.pm 2010/03/29 13:40:03 1.963
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.948.2.5 2010/05/18 02:26:39 raeburn Exp $
+# $Id: loncommon.pm,v 1.963 2010/03/29 13:40:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1202,12 +1202,7 @@ ENDOUTPUT
sub help_open_menu {
my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text)
= @_;
- $stayOnPage = 0 if (not defined $stayOnPage);
- # only use pop-up help (stayOnPage == 0)
- # if environment.remote is on (using remote control UI)
- if ($env{'environment.remote'} eq 'off' ) {
- $stayOnPage=1;
- }
+ $stayOnPage = 1;
my $output;
if ($component_help) {
if (!$text) {
@@ -1228,8 +1223,8 @@ sub help_open_menu {
sub top_nav_help {
my ($text) = @_;
$text = &mt($text);
- my $stay_on_page =
- ($env{'environment.remote'} eq 'off' );
+ my $stay_on_page = 1;
+
my $link = ($stay_on_page) ? "javascript:helpMenu('display')"
: "javascript:helpMenu('open')";
my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
@@ -1244,10 +1239,7 @@ END
sub help_menu_js {
my ($text) = @_;
-
- my $stayOnPage =
- ($env{'environment.remote'} eq 'off' );
-
+ my $stayOnPage = 1;
my $width = 620;
my $height = 600;
my $helptopic=&general_help();
@@ -1304,10 +1296,7 @@ sub help_open_bug {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'BugzillaHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 600 if (not defined $width);
$height = 600 if (not defined $height);
@@ -1348,10 +1337,7 @@ sub help_open_faq {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'FAQHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 350 if (not defined $width);
$height = 400 if (not defined $height);
@@ -4553,9 +4539,6 @@ Inputs:
=item * $bgcolor, used to override the bgcolor on a webpage to a specific value
-=item * $no_inline_link, if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
-
=item * $args, optional argument valid values are
no_auto_mt_title -> prevents &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
@@ -4573,7 +4556,7 @@ other decorations will be returned.
sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
- $no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
+ $no_nav_bar,$bgcolor,$args)=@_;
my $public;
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
@@ -4634,7 +4617,7 @@ sub bodytag {
} else {
$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
}
-
+
my $titleinfo = '
'.$title.'
';
#
# Extra info if you are the DC
@@ -4650,8 +4633,6 @@ sub bodytag {
$role = '('.$role.')' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
- if ($env{'environment.remote'} eq 'off') {
- # No Remote
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
return $bodytag;
}
@@ -4693,7 +4674,7 @@ sub bodytag {
$bodytag .= Apache::lonmenu::serverform();
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
if ($env{'request.state'} eq 'construct') {
- $bodytag .= &Apache::lonmenu::innerregister($forcereg,'',
+ $bodytag .= &Apache::lonmenu::innerregister($forcereg,
$args->{'bread_crumbs'});
} elsif ($forcereg) {
$bodytag .= &Apache::lonmenu::innerregister($forcereg);
@@ -4706,40 +4687,6 @@ sub bodytag {
}
return $bodytag;
- }
-
-#
-# Top frame rendering, Remote is up
-#
-
- my $imgsrc = $img;
- if ($img =~ /^\/adm/) {
- $imgsrc = &lonhttpdurl($img);
- }
- my $upperleft='';
-
- # Explicit link to get inline menu
- my $menu= ($no_inline_link?''
- :''.&mt('Switch to Inline Menu Mode').'');
-
- if ($dc_info) {
- $dc_info = qq|($dc_info)|;
- }
-
- $bodytag .= qq|
$name $role
-
-
$menu
-
$realm $dc_info
| unless $env{'form.inhibitmenu'};
- return(<
-
$upperleft
-
$messages
-
-
$titleinfo $dc_info $menu
-
-
-ENDBODY
}
sub dc_courseid_toggle {
@@ -4771,22 +4718,8 @@ sub make_attr_string {
delete($attr_ref->{$key});
}
}
- $attr_ref->{'onload'} =
- &Apache::lonmenu::loadevents(). $on_load;
- $attr_ref->{'onunload'}=
- &Apache::lonmenu::unloadevents().$on_unload;
- }
-
-# Accessibility font enhance
- if ($env{'browser.fontenhance'} eq 'on') {
- my $style;
- foreach my $key (keys(%{$attr_ref})) {
- if (lc($key) eq 'style') {
- $style.=$attr_ref->{$key}.';';
- delete($attr_ref->{$key});
- }
- }
- $attr_ref->{'style'}=$style.'; font-size: x-large;';
+ $attr_ref->{'onload'} = $on_load;
+ $attr_ref->{'onunload'}= $on_unload;
}
my $attr_string;
@@ -4888,6 +4821,7 @@ sub standard_css {
$env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px'
: '0 3px 0 4px';
+
return <{'frameset'}) {
$result .= &Apache::lonhtmlcommon::htmlareaheaders();
}
- if ($args->{'force_register'}) {
- $result .= &Apache::lonmenu::registerurl(1);
+ if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) {
+ $result .= Apache::lonxml::display_title();
}
if (!$args->{'no_nav_bar'}
&& !$args->{'only_body'}
@@ -6670,7 +6592,7 @@ ADDMETA
$result .= ' LON-CAPA '.$title.''
.''
.$head_extra;
- return $result;
+ return $result.'';
}
=pod
@@ -6727,43 +6649,6 @@ sub xml_begin {
=pod
-=item * &endheadtag()
-
-Returns a uniform for LON-CAPA web pages.
-
-Inputs: none
-
-=cut
-
-sub endheadtag {
- return '';
-}
-
-=pod
-
-=item * &head()
-
-Returns a uniform complete .. section for LON-CAPA web pages.
-
-Inputs:
-
-=over 4
-
-$title - optional title for the page
-
-$head_extra - optional extra HTML to put inside the
-
-=back
-
-=cut
-
-sub head {
- my ($title,$head_extra,$args) = @_;
- return &headtag($title,$head_extra,$args).&endheadtag();
-}
-
-=pod
-
=item * &start_page()
Returns a complete .. section for LON-CAPA web pages.
@@ -6801,8 +6686,6 @@ $args - additional optional args support
skip_phases -> hash ref of
head -> skip the generation
body -> skip all generation
- no_inline_link -> if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
no_auto_mt_title -> prevent &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
should it have jsmath forced on by the
@@ -6833,7 +6716,7 @@ sub start_page {
if (! exists($args->{'skip_phases'}{'head'}) ) {
$result.=
&xml_begin().
- &headtag($title,$head_extra,\%head_args).&endheadtag();
+ &headtag($title,$head_extra,\%head_args);
}
if (! exists($args->{'skip_phases'}{'body'}) ) {
@@ -6847,8 +6730,7 @@ sub start_page {
$args->{'function'}, $args->{'add_entries'},
$args->{'only_body'}, $args->{'domain'},
$args->{'force_register'}, $args->{'no_nav_bar'},
- $args->{'bgcolor'}, $args->{'no_inline_link'},
- $args);
+ $args->{'bgcolor'}, $args);
}
}
@@ -6868,7 +6750,8 @@ sub start_page {
return $result if $args->{'only_body'};
#Breadcrumbs for Construction Space provided by &bodytag.
- if (($env{'environment.remote'} eq 'off') && ($env{'request.state'} eq 'construct')) {
+ if (
+ $env{'request.state'} eq 'construct') {
return $result;
}
@@ -6892,28 +6775,6 @@ sub start_page {
return $result;
}
-
-=pod
-
-=item * &head()
-
-Returns a complete section for LON-CAPA web pages.
-
-Inputs: $args - additional optional args supported are:
- js_ready -> return a string ready for being used in
- a javascript writeln
- html_encode -> return a string ready for being used in
- a html attribute
- frameset -> if true will start with a