--- loncom/interface/loncommon.pm 2006/05/01 19:07:16 1.357 +++ loncom/interface/loncommon.pm 2006/05/05 18:04:27 1.362 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.357 2006/05/01 19:07:16 albertel Exp $ +# $Id: loncommon.pm,v 1.362 2006/05/05 18:04:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2773,6 +2773,9 @@ Inputs: =item * $notitle, if true keep the nav controls, but remove the title bar +=item * $no_inline_link, if true and in remote mode, don't show the + 'Switch To Inline Menu' link + =back @@ -2785,15 +2788,13 @@ other decorations will be returned. sub bodytag { my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle, - $notopbar,$bgcolor,$notitle)=@_; + $notopbar,$bgcolor,$notitle,$no_inline_link)=@_; $title=&mt($title); $function = &get_users_function() if (!$function); my $img = &designparm($function.'.img',$domain); - my $tabbg = &designparm($function.'.tabbg',$domain); my $font = &designparm($function.'.font',$domain); - my $sidebg = &designparm($function.'.sidebg',$domain); my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain); my %design = ( 'style' => 'margin-top: 0px', @@ -2805,14 +2806,13 @@ sub bodytag { @$addentries{keys(%design)} = @design{keys(%design)}; # role and realm - my ($role,$realm) - =&Apache::lonnet::plaintext((split(/\./,$env{'request.role'}))[0]); + my ($role,$realm) = + &Apache::lonnet::plaintext((split(/\./,$env{'request.role'}))[0]); # realm if ($env{'request.course.id'}) { - $realm= - $env{'course.'.$env{'request.course.id'}.'.description'}; + $realm = $env{'course.'.$env{'request.course.id'}.'.description'}; } - unless ($realm) { $realm=' '; } + if (!$realm) { $realm=' '; } # Set messages my $messages=&domainlogo($domain); # Port for miniserver @@ -2822,14 +2822,9 @@ sub bodytag { my $extra_body_attr = &make_attr_string($forcereg,$addentries); # construct main body tag - my $bodytag = < -END + my $bodytag = "". + &Apache::lontexconvert::init_math_support(); - $bodytag .= &Apache::lontexconvert::init_math_support(); - - my $upperleft=''.$function.''; if ($bodyonly || ($env{'request.state'} eq 'construct' && $env{'environment.remote'} ne 'off' )) { @@ -2842,75 +2837,92 @@ END $bodytag.='

LON-CAPA: '.$title.'

'; } return $bodytag; - } elsif ($env{'environment.remote'} eq 'off') { -# No Remote - my $roleinfo=(< - + } + + + + my $roleinfo=(< +
$env{'environment.firstname'} $env{'environment.middlename'} $env{'environment.lastname'} $env{'environment.generation'} -   -
-$role  -
-$realm  +   +
+
+$role  +
+
+$realm  +
ENDROLE - my $titleinfo = ''.$title.''; - if ($customtitle) { - $titleinfo = $customtitle; - } + my $titleinfo = ''.$title.''; + if ($customtitle) { + $titleinfo = $customtitle; + } + # + # Extra info if you are the DC + my $dc_info = ''; + if ($env{'user.adv'} && exists($env{'user.role.dc./'. + $env{'course.'.$env{'request.course.id'}. + '.domain'}.'/'})) { + my $cid = $env{'request.course.id'}; + $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; + $dc_info = '('.$dc_info.')'; + } + + if ($env{'environment.remote'} eq 'off') { + # No Remote if ($env{'request.state'} eq 'construct') { + $forcereg=1; + } + + if (!$customtitle && $env{'request.state'} eq 'construct') { + # this is for resources; directories have customtitle, and crumbs + # and select recent are created in lonpubdir.pm my ($uname,$thisdisfn)= ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|); my $formaction='/priv/'.$uname.'/'.$thisdisfn; $formaction=~s/\/+/\//g; - unless ($customtitle) { #this is for resources; directories have customtitle, and crumbs and select recent are created in lonpubdir.pm - my $parentpath = ''; - my $lastitem = ''; - if ($thisdisfn =~ m-(.+/)([^/]*)$-) { - $parentpath = $1; - $lastitem = $2; - } else { - $lastitem = $thisdisfn; - } - $titleinfo = &Apache::loncommon::help_open_menu('','','','',3,'Authoring'). - 'Construction Space: '. - '
' - .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" - .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') - .'
' - .&Apache::lonmenu::constspaceform(); - } - $forcereg=1; + my $parentpath = ''; + my $lastitem = ''; + if ($thisdisfn =~ m-(.+/)([^/]*)$-) { + $parentpath = $1; + $lastitem = $2; + } else { + $lastitem = $thisdisfn; + } + $titleinfo = + &Apache::loncommon::help_open_menu('','','','',3,'Authoring'). + 'Construction Space: '. + '
' + .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" + .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') + .'
' + .&Apache::lonmenu::constspaceform(); } + my $titletable; if (!$notitle) { $titletable = - ''. - ''.$roleinfo.'
'. - $titleinfo.'
'; + ''. + "".$roleinfo. + '
$titleinfo $dc_info
'; } - if ($env{'request.state'} eq 'construct') { - if ($notopbar) { - $bodytag .= $titletable; - } else { + if ($notopbar) { + $bodytag .= $titletable; + } else { + if ($env{'request.state'} eq 'construct') { $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg, $titletable); - } - } else { - if ($notopbar) { - $bodytag .= $titletable; } else { $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg). - $titletable; + $titletable; } } return $bodytag; @@ -2919,50 +2931,25 @@ ENDROLE # # Top frame rendering, Remote is up # - my $titleinfo = ' '.$title.''; - if ($customtitle) { - $titleinfo = $customtitle; - } - # - # Extra info if you are the DC - my $dc_info = ''; - if ($env{'user.adv'} && exists($env{'user.role.dc./'. - $env{'course.'.$env{'request.course.id'}. - '.domain'}.'/'})) { - my $cid = $env{'request.course.id'}; - $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; - $dc_info = '('.$dc_info.')'; - } + + my $upperleft=''.$function.''; + # Explicit link to get inline menu - my $menu='
 '.&mt('Switch to Inline Menu Mode').''; + my $menu= ($no_inline_link?'' + :'
'.&mt('Switch to Inline Menu Mode').''); # if ($notitle) { return $bodytag; } return(< - -$upperleft -$messages  - - - -$titleinfo $dc_info $menu - - - $env{'environment.firstname'} - $env{'environment.middlename'} - $env{'environment.lastname'} - $env{'environment.generation'} -   - + + + - - - + +$roleinfo
$upperleft
-$role  -
$realm 
$titleinfo $dc_info $menu
ENDBODY } @@ -3122,11 +3109,45 @@ table#LC_top_nav, table#LC_menubuttons, width: 100%; background: $pgbg; border: 0px; - border-spacing: 1px; + border-spacing: 2px 1px; padding: 0px; margin: 0px; border-collapse: separate; } +table#LC_title_bar { + width: 100%; + border: 0; + border-spacing: 0px 1px; + background: $pgbg; + font-family: $sans; + border-collapse: collapse; +} +table#LC_title_bar.LC_with_remote { + width: 100%; + border: 0; + border-spacing: 0; + background: $pgbg; + font-family: $sans; + border-collapse: collapse; +} +table#LC_title_bar td { + padding: 3px; + background: $tabbg; +} +table#LC_title_bar td.LC_title_bar_who { + background: $tabbg; + color: $font; + font: medium $sans; + text-align: right; +} +span.LC_title_bar_title { + font: bold xx-large $sans; +} +table#LC_title_bar td.LC_title_bar_domain_logo { + background: $sidebg; + text-align: right; +} + table#LC_menubuttons_mainmenu { background: $pgbg; border: 0px; @@ -3149,7 +3170,7 @@ table#LC_breadcrumbs td { background: $tabbg; color: $font; font-family: $sans; - font-size: smallest; + font-size: smaller; } table#LC_breadcrumbs td.LC_breadcrumb_component { background: $tabbg; @@ -3436,6 +3457,9 @@ Inputs: $title - optional title for the 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 + =back =cut @@ -3471,7 +3495,7 @@ sub start_page { $args->{'only_body'}, $args->{'domain'}, $args->{'force_register'}, $args->{'body_title'}, $args->{'no_nav_bar'}, $args->{'bgcolor'}, - $args->{'no_title'}); + $args->{'no_title'}, $args->{'no_inline_link'}); } }