--- loncom/interface/lonmenu.pm 2023/09/06 16:05:23 1.369.2.83.2.10
+++ loncom/interface/lonmenu.pm 2023/10/06 02:16:46 1.369.2.83.2.11
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.83.2.10 2023/09/06 16:05:23 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.83.2.11 2023/10/06 02:16:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1009,6 +1009,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();
@@ -1125,11 +1137,30 @@ sub innerregister {
if (($env{'request.symb'} ne '') &&
($env{'request.filename'}=~/$LONCAPA::assess_re/) &&
(($perms{'mgr'}) || ($perms{'vgr'}))) {
- my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$defdom,$righticon);
+ my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$defdom,
+ $domselector,$righticon);
my %lt = &Apache::lonlocal::texthash(
view => 'View',
upda => 'Update',
);
+ my $possdomstr = $env{'course.'.$env{'request.course.id'}.'.internal.userdomains'};
+ if ($possdomstr =~ /,/) {
+ my @possdoms = split(/,/,$possdomstr);
+ if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) {
+ $defdom = $1;
+ } elsif (grep(/^\Q$cdom\E$/,@possdoms)) {
+ $defdom = $cdom;
+ } elsif (&Apache::lonnet::domain($possdoms[0]) ne '') {
+ $defdom = $possdoms[0];
+ }
+ $domselector = &Apache::loncommon::select_dom_form($defdom,'vudom','','','',\@possdoms);
+ } elsif (($possdomstr ne '') && (&Apache::lonnet::domain($possdomstr) ne '')) {
+ if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) {
+ $defdom = $1;
+ } else {
+ $defdom = $possdomstr;
+ }
+ }
if ($env{'request.user_in_effect'} =~ /^($match_username):($match_domain)$/) {
($vuname,$vudom) = ($1,$2);
unless (&Apache::lonnet::is_advanced_user($vudom,$vuname)) {
@@ -1147,17 +1178,29 @@ sub innerregister {
$change = 'on';
$visibility = 'none';
$leftvis = 'inline';
- $defdom = $cdom;
+ if ($defdom eq '') {
+ $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;
+ my @items = (
+ '',
+ ''
+ );
+ if ($domselector) {
+ push(@items,$domselector);
+ $input = &mt('[_1]User:[_2] or [_3]ID:[_4] at [_5] | ',@items);
+ } else {
+ $input = &mt('[_1]Username:[_2] or [_3]ID:[_4] | ',@items).
+ '';
+ }
+ $input .= '',
+ '';
my $chooser = <