--- loncom/interface/lonmenu.pm 2013/03/19 23:28:57 1.410 +++ loncom/interface/lonmenu.pm 2013/05/05 00:15:02 1.412 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.410 2013/03/19 23:28:57 raeburn Exp $ +# $Id: lonmenu.pm,v 1.412 2013/05/05 00:15:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -514,6 +514,14 @@ sub innerregister { &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); } return $trail; + } elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) { + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &prepare_functions('/public'.$courseurl."/syllabus", + $forcereg,$group,undef,undef,1); + $title = &mt('Syllabus File'); + my ($trail) = + &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); + return $trail; } unless ($env{'request.state'} eq 'construct') { &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -846,24 +854,18 @@ sub prepare_functions { # # This applies in course context # - if (($resurl eq "/public/$cdom/$cnum/syllabus") && ($perms{'mdc'})) { - if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) { - &switch('','',6,1,'pcstr.png','Edit', - 'resource[_2]', - "go('/adm/courseprefs?phase=display&actions=courseinfo')", - 'Edit this resource'); - $editbutton = 1; + if (($perms{'mdc'}) && + (($resurl eq "/public/$cdom/$cnum/syllabus") || + ($resurl =~ m{^/uploaded/$cdom/$cnum/portfolio/syllabus/}))) { + $cfile = $resurl; + $home = &Apache::lonnet::homeserver($cnum,$cdom); + if ($env{'form.forceedit'}) { + $forceview = 1; } else { - $cfile = $resurl; - $home = &Apache::lonnet::homeserver($cnum,$cdom); - if ($env{'form.forceedit'}) { - $forceview = 1; - } else { - $forceedit = 1; - } - $editbutton = &get_editbutton($cfile,$home,$switchserver, - $forceedit,$forceview,$forcereg); + $forceedit = 1; } + $editbutton = &get_editbutton($cfile,$home,$switchserver, + $forceedit,$forceview,$forcereg); } elsif (($resurl eq '/adm/extresedit') && (($env{'form.symb'}) || ($env{'form.folderpath'}))) { ($cfile,$home,$switchserver,$forceedit,$forceview) = @@ -991,6 +993,7 @@ sub advtools_crumbs { &Apache::lonhtmlcommon::add_breadcrumb_tool( 'advtools', $funcs[61]); } + return; } # ================================================================== Raw Config