[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Sat Oct 5 20:30:26 EDT 2024
raeburn Sun Oct 6 00:30:26 2024 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncommon.pm lonmenu.pm
Log:
- For 2.11 Remote Control in use.
- Authoring Space screen top row menu now consistent with other screens when
Remote Control in use: Name (no drop-down on hover), Context, Help,
"Switch to Inline Menu Mode"; no secondary
- Functions in Authoring Space includes "Edit Metadata" if directory list
and Options, if called in course context.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.170 loncom/interface/loncommon.pm:1.1075.2.171
--- loncom/interface/loncommon.pm:1.1075.2.170 Sat Oct 5 23:19:24 2024
+++ loncom/interface/loncommon.pm Sun Oct 6 00:30:26 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.170 2024/10/05 23:19:24 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.171 2024/10/06 00:30:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5829,27 +5829,34 @@
$bodytag .= Apache::lonhtmlcommon::scripttag(
Apache::lonmenu::utilityfunctions($httphost), 'start');
- my ($left,$right) = Apache::lonmenu::primary_menu($args->{'links_disabled'});
+ if (($env{'environment.remote'} eq 'on') && ($env{'request.state'} eq 'construct')) {
+ unless ($env{'form.inhibitmenu'}) {
+ $bodytag .= &inline_for_remote($public,$role,$realm,$dc_info,$no_inline_link);
+ }
+ } else {
+ my ($left,$right) = Apache::lonmenu::primary_menu($args->{'links_disabled'});
- if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
- if ($dc_info) {
- $dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|;
+ if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
+ if ($dc_info) {
+ $dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|;
+ }
+ $bodytag .= qq|<div id="LC_nav_bar">$left $role<br />
+ <em>$realm</em> $dc_info</div>|;
+
+ return $bodytag;
}
- $bodytag .= qq|<div id="LC_nav_bar">$left $role<br />
- <em>$realm</em> $dc_info</div>|;
- return $bodytag;
- }
- unless ($env{'request.symb'} =~ m/\.page___\d+___/) {
- $bodytag .= qq|<div id="LC_nav_bar">$left $role</div>|;
- }
+ unless ($env{'request.symb'} =~ m/\.page___\d+___/) {
+ $bodytag .= qq|<div id="LC_nav_bar">$left $role</div>|;
+ }
- $bodytag .= $right;
+ $bodytag .= $right;
- if ($dc_info) {
- $dc_info = &dc_courseid_toggle($dc_info);
+ if ($dc_info) {
+ $dc_info = &dc_courseid_toggle($dc_info);
+ }
+ $bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|;
}
- $bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|;
#if directed to not display the secondary menu, don't.
if ($args->{'no_secondary_menu'}) {
@@ -5857,7 +5864,10 @@
}
#don't show menus for public users
if (!$public){
- $bodytag .= Apache::lonmenu::secondary_menu($httphost,$args->{'links_disabled'});
+ unless (($env{'environment.remote'} eq 'on') &&
+ ($env{'request.state'} eq 'construct')) {
+ $bodytag .= Apache::lonmenu::secondary_menu($httphost,$args->{'links_disabled'});
+ }
$bodytag .= Apache::lonmenu::serverform();
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
if ($env{'request.state'} eq 'construct') {
@@ -5911,15 +5921,37 @@
}
unless ($env{'form.inhibitmenu'}) {
- $bodytag .= qq|<div id="LC_nav_bar">$name $role</div>
- <ol class="LC_primary_menu LC_floatright LC_right">
- <li>$help</li>
- <li>$menu</li>
- </ol><div id="LC_realm"> $realm $dc_info</div>|;
+ $bodytag .= &inline_for_remote($public,$role,$realm,$dc_info,$no_inline_link);
}
return $bodytag."\n".$funclist;
}
+sub inline_for_remote {
+ my ($public,$role,$realm,$dc_info,$no_inline_link) = @_;
+ my $help=($no_inline_link?''
+ :&Apache::loncommon::top_nav_help('Help'));
+
+ # Explicit link to get inline menu
+ my $menu= ($no_inline_link?''
+ :'<a href="/adm/remote?action=collapse" target="_top">'.&mt('Switch to Inline Menu Mode').'</a>');
+
+ if ($dc_info) {
+ $dc_info = qq|<span class="LC_cusr_subheading">($dc_info)</span>|;
+ }
+
+ my $name = &plainname($env{'user.name'},$env{'user.domain'});
+ unless ($public) {
+ $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'},
+ undef,'LC_menubuttons_link');
+ }
+
+ return qq|<div id="LC_nav_bar">$name $role</div>
+ <ol class="LC_primary_menu LC_floatright LC_right">
+ <li>$help</li>
+ <li>$menu</li>
+ </ol><div id="LC_realm"> $realm $dc_info</div>|;
+}
+
sub dc_courseid_toggle {
my ($dc_info) = @_;
return ' <span id="dccidtext" class="LC_cusr_subheading LC_nobreak">'.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.85 loncom/interface/lonmenu.pm:1.369.2.86
--- loncom/interface/lonmenu.pm:1.369.2.85 Wed Jul 3 04:09:36 2024
+++ loncom/interface/lonmenu.pm Sun Oct 6 00:30:26 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.85 2024/07/03 04:09:36 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.86 2024/10/06 00:30:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1004,7 +1004,7 @@
# accessed in a different way, when Authoring Space is accessed in course
# context
#
- if ($env{'request.role'} !~/^(aa|ca|au)/) {
+ if (($env{'request.role'} !~/^(aa|ca|au)/) || (!$noremote)) {
my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
$menuitems .= (<<ENDMENUITEMS);
s&7&5&editops.png&Options&edit[_1]&gocstr('/adm/preferences?action=authorsettings','$privfile')&Authoring Space Options
@@ -1197,7 +1197,7 @@
&switch('','', at rest);
}
&Apache::lonhtmlcommon::add_breadcrumb_tool('advtools',
- @inlineremote[63,61,71,72]);
+ @inlineremote[63,74,61,71,72,75]);
$cstrcrumbs = &Apache::lonhtmlcommon::scripttag('', 'start')
.&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
More information about the LON-CAPA-cvs
mailing list