--- loncom/xml/londefdef.pm 2009/05/26 14:06:23 1.406 +++ loncom/xml/londefdef.pm 2009/10/15 22:39:58 1.412 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.406 2009/05/26 14:06:23 bisitz Exp $ +# $Id: londefdef.pm,v 1.412 2009/10/15 22:39:58 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -540,14 +540,18 @@ sub start_body { # Breadcrumbs &Apache::lonhtmlcommon::clear_breadcrumbs(); - &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', - 'href' => '', # FIXME Add link to /priv/[user] - }); - &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'HTML Editor', - 'href' => '', - }); + if ($env{'request.state'} eq 'construct') { + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Construction Space', + 'href' => &Apache::loncommon::authorspace(), + }); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'HTML Editor', + 'href' => '', + }); + } else { + # FIXME Where are we? + } $currentstring = &Apache::loncommon::start_page($Apache::londefdef::title, @@ -557,18 +561,30 @@ sub start_body { # 'no_title' => 1, 'force_register' => 1}); - $currentstring .= &Apache::lonhtmlcommon::breadcrumbs() - .&Apache::loncommon::head_subbox( - &Apache::loncommon::CSTR_pageheader()); - - if ($env{'request.state'} ne 'published') { - $currentstring.=&Apache::lonmenu::constspaceform(); - $currentstring.=&Apache::londefdef::edit_controls(); - } - $currentstring.=&Apache::lonxml::message_location(); + if ($env{'request.state'} eq 'construct') { + $currentstring .= &Apache::lonhtmlcommon::breadcrumbs(); + } + + my $header = ''; + if ($env{'request.state'} ne 'published' && + $env{'request.state'} ne 'construct') { + $header=&Apache::lonmenu::constspaceform(); + } + if ($env{'request.state'} ne 'published') { + $header.=&Apache::londefdef::edit_controls(); + } + if ($env{'request.state'} eq 'construct') { + $currentstring.=&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader() + .$header); + } elsif ($env{'request.state'} eq 'edit') { + $currentstring.=&Apache::loncommon::head_subbox($header); + } + $currentstring.=&Apache::lonxml::message_location(); } elsif ($target eq 'tex') { - $currentstring = ''; # '\begin{document}' is in header. - } + $currentstring = ''; # '\begin{document}' is in header. + } + return $currentstring; } @@ -585,9 +601,14 @@ sub edit_controls { '; } $result .= ' -
+
'; + if (($env{'request.course.id'}) && ($env{'form.forceedit'})) { + $result .= (' ' x 3).''; + } + $result .= '
+ -
'; +'; return $result; }