--- loncom/interface/loncommon.pm 2010/03/18 11:41:01 1.958 +++ loncom/interface/loncommon.pm 2010/05/30 12:47:05 1.969 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.958 2010/03/18 11:41:01 onken Exp $ +# $Id: loncommon.pm,v 1.969 2010/05/30 12:47:05 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3687,10 +3687,13 @@ sub submlink { } if (!$symb) { $symb=&Apache::lonnet::symbread(); } $symb=&escape($symb); - if ($target) { $target="target=\"$target\""; } - return ''.$text.''; + if ($target) { $target=" target=\"$target\""; } + return + ''.$text.''; } ############################################## @@ -4536,10 +4539,6 @@ Inputs: =item * $bgcolor, used to override the bgcolor on a webpage to a specific value -#SD -#RC =item * $no_inline_link, if true and in remote mode, don't show the -#RC 'Switch To Inline Menu' link -#RC =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, @@ -4557,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')) @@ -4599,8 +4598,6 @@ sub bodytag { } if (!$realm) { $realm=' '; } -# Set messages - my $messages=&domainlogo($domain); my $extra_body_attr = &make_attr_string($forcereg,\%design); @@ -4634,7 +4631,6 @@ sub bodytag { $role = '('.$role.')' if $role; &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); - # No Remote if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { return $bodytag; } @@ -4676,7 +4672,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); @@ -4795,10 +4791,6 @@ sub standard_css { my $vlink = &designparm($function.'.vlink', $domain); my $link = &designparm($function.'.link', $domain); - my $loginbg = &designparm('login.sidebg',$domain); - my $bgcol = &designparm('login.bgcol',$domain); - my $textcol = &designparm('login.textcol',$domain); - my $sans = 'Verdana,Arial,Helvetica,sans-serif'; my $mono = 'monospace'; my $data_table_head = $sidebg; @@ -4840,7 +4832,8 @@ body { color:$font; } -a:focus { +a:focus, +a:focus img { color: red; background: yellow; } @@ -5060,6 +5053,7 @@ td.LC_table_cell_checkbox { background: #F8F8F8; /* $sidebg; */ border: 1px solid $sidebg; margin: 0 0 10px 0; + padding: 3px; } .LC_fontsize_medium { @@ -5586,16 +5580,6 @@ table.LC_group_priv td { padding: 0; } -table.LC_notify_front_page { - background: white; - border: 1px solid black; - padding: 8px; -} - -table.LC_notify_front_page td { - padding: 8px; -} - .LC_navbuttons { margin: 2ex 0ex 2ex 0ex; } @@ -6029,7 +6013,7 @@ fieldset > legend { #LC_nav_bar { float: left; - margin: 0; + margin: 0 0 2px 0; } #LC_realm { @@ -6044,6 +6028,11 @@ fieldset > legend { font-style: normal; } +/* Preliminary fix to hide nav_bar inside bookmarks window */ +#LC_bookmarks #LC_nav_bar { + display:none; +} + ol.LC_primary_menu { float: right; margin: 0; @@ -6118,7 +6107,7 @@ ul.LC_TabContent { ul.LC_TabContent li { vertical-align:middle; - padding: 0 10px 0 10px; + padding: 0 16px 0 10px; background-color:$tabbg; border-bottom:solid 1px $lg_border_color; border-right: solid 1px $font; @@ -6134,12 +6123,14 @@ ul.LC_TabContent li { text-decoration:none; font-size:95%; font-weight:bold; - padding-right: 16px; min-height:20px; } -ul.LC_TabContent li a:hover { +ul.LC_TabContent li a:hover, +ul.LC_TabContent li a:focus { color: $button_hover; + background:none; + outline:none; } ul.LC_TabContent li:hover { @@ -6154,6 +6145,11 @@ ul.LC_TabContent li.active { cursor: default; } +ul.LC_TabContent li.active a { + color:$font; + background:#FFFFFF; + outline: none; +} #maincoursedoc { clear:both; } @@ -6241,6 +6237,14 @@ ul.LC_CourseBreadcrumbs li a { font-size:90%; } +ol#LC_MenuBreadcrumbs h1 { + display: inline; + font-size: 90%; + line-height: 2.5em; + margin: 0; + padding: 0; +} + ol#LC_PathBreadcrumbs li a { text-decoration:none; font-size:100%; @@ -6337,52 +6341,6 @@ div.LC_columnSection>* { overflow:hidden; } -.LC_loginpage_container { - text-align:left; - margin : 0 auto; - width:90%; - padding: 10px; - height: auto; - background-color:#FFFFFF; - border:1px solid #CCCCCC; -} - - -.LC_loginpage_loginContainer { - float:left; - width: 182px; - padding: 2px; - border:1px solid #CCCCCC; - background-color:$loginbg; -} - -.LC_loginpage_loginContainer h2 { - margin-top: 0; - display:block; - background:$bgcol; - color:$textcol; - padding-left:5px; -} - -.LC_loginpage_loginInfo { - float:left; - width:182px; - border:1px solid #CCCCCC; - padding:2px; -} - -.LC_loginpage_space { - clear: both; - margin-bottom: 20px; - border-bottom: 1px solid #CCCCCC; -} - -.LC_loginpage_floatLeft { - float: left; - width: 200px; - margin: 0; -} - table em { font-weight: bold; font-style: normal; @@ -6559,8 +6517,8 @@ sub headtag { if (!$args->{'frameset'}) { $result .= &Apache::lonhtmlcommon::htmlareaheaders(); } - if ($args->{'force_register'}) { - $result .= &Apache::lonmenu::registerurl(); + if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) { + $result .= Apache::lonxml::display_title(); } if (!$args->{'no_nav_bar'} && !$args->{'only_body'} @@ -6586,7 +6544,7 @@ ADDMETA $result .= ' LON-CAPA '.$title.'' .'' .$head_extra; - return $result; + return $result.''; } =pod @@ -6643,43 +6601,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. @@ -6717,8 +6638,6 @@ $args - additional optional args support skip_phases -> hash ref of head -> skip the generation body -> skip all generation -#RC no_inline_link -> if true and in remote mode, don't show the -#RC '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 @@ -6735,6 +6654,14 @@ $args - additional optional args support sub start_page { my ($title,$head_extra,$args) = @_; #&Apache::lonnet::logthis("start_page ".join(':',caller(0))); +#SD +#I don't see why we copy certain elements of %$args to %head_args +#head args is passed to headtag() and this routine only reads those +#keys that are needed. There doesn't happen any writes or any processing +#of other keys. +#proposal: just pass $args to headtag instead of \%head_args and delete +#marked lines +#<- MARK my %head_args; foreach my $arg ('redirect','force_register','domain','function', 'bgcolor','frameset','no_nav_bar','only_body', @@ -6743,13 +6670,16 @@ sub start_page { $head_args{$arg} = $args->{$arg}; } } +#MARK -> $env{'internal.start_page'}++; my $result; + if (! exists($args->{'skip_phases'}{'head'}) ) { - $result.= - &xml_begin(). - &headtag($title,$head_extra,\%head_args).&endheadtag(); + $result .= + &xml_begin() . &headtag($title,$head_extra,\%head_args); +#replace prev line by +# &xml_begin() . &headtag($title, $head_extra, $args); } if (! exists($args->{'skip_phases'}{'body'}) ) { @@ -6763,8 +6693,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); } } @@ -6780,15 +6709,10 @@ sub start_page { # $result .= &build_functionlist(); #} - # Don't add anything more if only_body wanted - return $result if $args->{'only_body'}; + # Don't add anything more if only_body wanted or in const space + return $result if $args->{'only_body'} + || $env{'request.state'} eq 'construct'; - #Breadcrumbs for Construction Space provided by &bodytag. - if ( - $env{'request.state'} eq 'construct') { - return $result; - } - #Breadcrumbs if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) { &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -6809,28 +6733,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 - rather than - dicsussion -> if true will get discussion from - lonxml::xmlend - (you can pass the target and parser arguments - through optional 'target' and 'parser' args - to this routine) - -=cut - sub end_page { my ($args) = @_; $env{'internal.end_page'}++; @@ -6920,15 +6822,26 @@ sub simple_error_page { { my @row_count; + + sub start_data_table_count { + unshift(@row_count, 0); + return; + } + + sub end_data_table_count { + shift(@row_count); + return; + } + sub start_data_table { my ($add_class) = @_; my $css_class = (join(' ','LC_data_table',$add_class)); - unshift(@row_count,0); + &start_data_table_count(); return ''."\n"; } sub end_data_table { - shift(@row_count); + &end_data_table_count(); return '
'."\n";; } @@ -10466,7 +10379,7 @@ sub construct_course { $title=&mt('Syllabus'); $url='/public/'.$$crsudom.'/'.$$crsunum.'/syllabus'; } else { - $title=&mt('Navigate Contents'); + $title=&mt('Table of Contents'); $url='/adm/navmaps'; }