--- loncom/interface/lonhtmlcommon.pm 2012/11/03 23:32:37 1.329 +++ loncom/interface/lonhtmlcommon.pm 2012/11/08 18:37:44 1.330 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.329 2012/11/03 23:32:37 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.330 2012/11/08 18:37:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ use Time::HiRes; use Apache::lonlocal; use Apache::lonnet; use HTML::Entities(); -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub java_not_enabled { return "\n".''. @@ -1651,6 +1651,14 @@ returns: nothing $description = $env{'course.'.$env{'request.course.id'}.'.description'}; $no_mt_descr = 1; + if ($env{'request.noversionuri'} =~ + m{^/public/($match_domain)/($match_courseid)/syllabus$}) { + unless (($env{'course.'.$env{'request.course.id'}.'.domain'} eq $1) && + ($env{'course.'.$env{'request.course.id'}.'.num'} eq $2)) { + $description = 'Menu'; + $no_mt_descr = 0; + } + } } $menulink = { href =>'/adm/menu', title =>'Go to main menu', @@ -1666,7 +1674,7 @@ returns: nothing } } my $links; - if ((&show_return_link) && (!$CourseBreadcrumbs)) { + if ((&show_return_link) && (!$CourseBreadcrumbs) && (ref($last) eq 'HASH')) { my $alttext = &mt('Go Back'); $links=&htmltag( 'a',''.$alttext.'', { href => '/adm/flip?postdata=return:', @@ -1701,8 +1709,10 @@ returns: nothing # last breadcrumb is the first order heading of a page # for course breadcrumbs it's just bold - $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', - $lasttext), {title => $lasttext}); + if ($lasttext ne '') { + $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', + $lasttext), {title => $lasttext}); + } my $icons = ''; $faq = $last->{'faq'} if (exists($last->{'faq'})); @@ -1723,11 +1733,12 @@ returns: nothing # - - unless ($CourseBreadcrumbs) { - $links = &htmltag('ol', $links, { id => "LC_MenuBreadcrumbs" }); - } else { - $links = &htmltag('ul', $links, { class => "LC_CourseBreadcrumbs" }); + if ($links ne '') { + unless ($CourseBreadcrumbs) { + $links = &htmltag('ol', $links, { id => "LC_MenuBreadcrumbs" }); + } else { + $links = &htmltag('ul', $links, { class => "LC_CourseBreadcrumbs" }); + } } @@ -3018,21 +3029,32 @@ ENDUTILITY } sub jump_to_editres { - my ($cfile,$home,$switchserver,$uploaded,$symb) = @_; + my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb) = @_; my $jscall; if ($switchserver) { if ($symb && $home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. - &HTML::Entities::encode($env{'request.role'},'"<>&').'&'. - 'symb='.&HTML::Entities::encode($env{'request.symb'},'"<>&'); - if ($uploaded) { + &HTML::Entities::encode($env{'request.role'},'"<>&'). + '&symb='.&HTML::Entities::encode($symb,'"<>&'); + if ($forceedit) { $cfile .= '&forceedit=1'; } + if ($forcereg) { + $cfile .= '&register=1'; + } $jscall = "need_switchserver('$cfile');"; } } else { - if ($uploaded) { - $cfile .= '?forceedit=1'; + unless ($cfile =~ m{^/priv/}) { + if ($symb) { + $cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb"; + } + if ($forceedit) { + $cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1'; + } + if ($forcereg) { + $cfile .= (($cfile=~/\?/)?'&':'?').'register=1'; + } } $jscall = "go('$cfile')"; }