--- loncom/interface/lonmenu.pm 2023/06/11 20:45:35 1.532 +++ loncom/interface/lonmenu.pm 2023/09/28 15:56:48 1.538 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.532 2023/06/11 20:45:35 raeburn Exp $ +# $Id: lonmenu.pm,v 1.538 2023/09/28 15:56:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -210,7 +210,6 @@ use Apache::lonenc(); use Apache::lonlocal; use Apache::lonmsg(); use LONCAPA qw(:DEFAULT :match); -use LONCAPA::ltiutils; use HTML::Entities(); use Apache::lonwishlist(); @@ -969,6 +968,18 @@ sub innerregister { $$showncrumbsref = 1; } return $trail; + } elsif (($resurl eq '/public'.$courseurl.'/syllabus') && + ($env{'form.folderpath'})) { + if ($env{'form.title'}) { + $title = $env{'form.title'}; + } else { + $title = 'Syllabus'; + } + &prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname); + $title = &HTML::Entities::encode($title,'\'"<>&'); + my ($trail) = + &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); + return $trail; } unless ($env{'request.state'} eq 'construct') { &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -1094,15 +1105,17 @@ sub innerregister { $leftvis = 'inline'; $defdom = $cdom; } - my $sellink = &Apache::loncommon::selectstudent_link('userview','vuname','vudom'); + my $sellink = &Apache::loncommon::selectstudent_link('userview','vuname','vudom','','','vuidentifier'); my $selscript=&Apache::loncommon::studentbrowser_javascript(); my $shownsymb = &HTML::Entities::encode(&Apache::lonenc::check_encrypt($env{'request.symb'}),'<>&"'); - my $input = &mt('User: [_1] or ID: [_2] at: [_3]', - '', - '', - &Apache::loncommon::select_dom_form($defdom,'vudom')). - '', - ''; + my $input = &mt('[_1]Username:[_2] or [_3]ID:[_4] | ', + '', + ''). + ''. + '', + ''; my $chooser = < @@ -1131,7 +1144,7 @@ END # End course context # Prepare the rest of the buttons - my ($menuitems,$got_prt,$got_wishlist); + my ($menuitems,$got_prt,$got_wishlist,$crsauthor); if ($const_space) { # # We are in construction space @@ -1140,15 +1153,17 @@ END my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; my ($udom,$uname,$thisdisfn) = ($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); + my $crsauthor; + if (($env{'request.course.id'}) && + ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && + ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { + $crsauthor = 1; + } my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; if ($currdir =~ m-/$-) { $is_const_dir = 1; - if ($thisdisfn eq '') { - unless (($env{'request.course.id'}) && - ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && - ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { - $is_const_dir = 2; - } + if (($thisdisfn eq '') && ($crsauthor)) { + $is_const_dir = 2; } my $esc_currdir = &Apache::loncommon::escape_single($currdir); $menuitems=(< 0) { + var i; + for (i=0; i