--- loncom/interface/loncommon.pm 2012/05/24 23:41:50 1.1075.2.5 +++ loncom/interface/loncommon.pm 2012/09/01 09:49:08 1.1075.2.14 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.5 2012/05/24 23:41:50 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.14 2012/09/01 09:49:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,6 +70,8 @@ use Apache::lonclonecourse(); use LONCAPA qw(:DEFAULT :match); use DateTime::TimeZone; use DateTime::Locale::Catalog; +use Authen::Captcha; +use Captcha::reCAPTCHA; # ---------------------------------------------- Designs use vars qw(%defaultdesign); @@ -885,10 +887,14 @@ sub check_uncheck_jscript { function checkAll(field) { if (field.length > 0) { for (i = 0; i < field.length; i++) { - field[i].checked = true ; + if (!field[i].disabled) { + field[i].checked = true; + } } } else { - field.checked = true + if (!field.disabled) { + field.checked = true; + } } } @@ -4954,6 +4960,9 @@ 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, @@ -4971,7 +4980,7 @@ other decorations will be returned. sub bodytag { my ($title,$function,$addentries,$bodyonly,$domain,$forcereg, - $no_nav_bar,$bgcolor,$args)=@_; + $no_nav_bar,$bgcolor,$no_inline_link,$args)=@_; my $public; if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) @@ -5013,6 +5022,8 @@ sub bodytag { } if (!$realm) { $realm=' '; } +# Set messages + my $messages=&domainlogo($domain); my $extra_body_attr = &make_attr_string($forcereg,\%design); @@ -5047,11 +5058,13 @@ sub bodytag { $role = '('.$role.')' if $role; &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); - if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { - return $bodytag; - } + if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { + return $bodytag; + } + + if ($env{'request.state'} eq 'construct') { $forcereg=1; } - if ($env{'request.state'} eq 'construct') { $forcereg=1; } + unless ($env{'environment.remote'} eq 'on') { # if ($env{'request.state'} eq 'construct') { # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls @@ -5103,6 +5116,55 @@ 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)|; + } + + unless ($env{'form.inhibitmenu'}) { + $bodytag .= qq|
+'; + my $endbodytag; + unless ((ref($args) eq 'HASH') && ($args->{'notbody'})) { + $endbodytag=''; + } $endbodytag=&Apache::lontexconvert::jsMath_process()."\n".$endbodytag; if ( exists( $env{'internal.head.redirect'} ) ) { if (!(ref($args) eq 'HASH' && $args->{'noredirectlink'})) { @@ -6583,6 +6655,7 @@ ul#LC_secondary_menu li:hover ul, ul#LC_ float: none; background-color: $data_table_light; z-index: 2; + margin-left: -1px; } ul#LC_secondary_menu li ul li { @@ -6936,6 +7009,7 @@ ul#LC_toolbar { list-style:none; position:relative; background-color:white; + overflow: auto; } ul#LC_toolbar li { @@ -6945,6 +7019,7 @@ ul#LC_toolbar li { float: left; display:inline; vertical-align:middle; + white-space: nowrap; } @@ -7094,8 +7169,8 @@ sub headtag { if (!$args->{'frameset'}) { $result .= &Apache::lonhtmlcommon::htmlareaheaders(); } - if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) { - $result .= Apache::lonxml::display_title(); + if ($args->{'force_register'}) { + $result .= &Apache::lonmenu::registerurl(1); } if (!$args->{'no_nav_bar'} && !$args->{'only_body'} @@ -7304,6 +7379,8 @@ $args - additional optional args support skip_phases -> hash ref of head -> skip the
generation body -> skip all