--- loncom/interface/lonmenu.pm 2010/01/19 16:53:10 1.244.2.14
+++ loncom/interface/lonmenu.pm 2009/07/13 08:24:21 1.275
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.244.2.14 2010/01/19 16:53:10 raeburn Exp $
+# $Id: lonmenu.pm,v 1.275 2009/07/13 08:24:21 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,15 +26,10 @@
# http://www.lon-capa.org/
#
#
-# There are two parameters controlling the action of this module:
-#
-# browser.interface - if this is 'textual', it overrides the second parameter
-# and goes to screen reader PDA mode
+# There is one parameter controlling the action of this module:
#
# environment.remote - if this is 'on', the routines controll the remote
-# control, otherwise they render the main window controls; ignored it
-# browser.interface is 'textual'
-#
+# control, otherwise they render the main window controls;
=head1 NAME
@@ -51,8 +46,6 @@ described at http://www.lon-capa.org.
=over
-=item show_course()
-
Little texts
=item initlittle()
@@ -120,6 +113,11 @@ The javascript is usually similar to "go
=item get_nav_status()
+=item convert_menu_function()
+
+FIXME this needs to move into mydesktab and the other locations
+the text is generated
+
=item hidden_button_check()
=item roles_selector()
@@ -139,28 +137,15 @@ use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
use LONCAPA qw(:DEFAULT :match);
-use HTML::Entities();
use vars qw(@desklines %category_names %category_members %category_positions $readdesk);
my @inlineremote;
-
-
-sub show_course {
- my $course = !$env{'user.adv'};
- if (!$env{'user.adv'}) {
- foreach my $env (keys(%env)) {
- next if ($env !~ m/^user\.priv\./);
- if ($env !~ m/^user\.priv\.(?:st|cm)/) {
- $course = 0;
- last;
- }
- }
- }
- return $course;
-}
+#
+# This routine returns a translated hash for the menu items in the top inline menu row
+# Probably should be in mydesk.tab
sub initlittle {
return &Apache::lonlocal::texthash('ret' => 'Return to Last Location',
@@ -174,7 +159,7 @@ sub initlittle {
'login' => 'Log In',
'launch' => 'Launch Remote Control',
'groups' => 'Groups',
- 'gdoc' => 'Community Documents',
+ 'gdoc' => 'Group Documents',
);
}
@@ -182,6 +167,9 @@ sub menubuttons {
my $forcereg=shift;
my $registration=shift;
my $titletable=shift;
+#
+# Early-out for pages that should not have a menu, triggered by query string "inhibitmenu=yes"
+#
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['inhibitmenu']);
if (($env{'form.inhibitmenu'} eq 'yes') ||
@@ -198,14 +186,20 @@ sub menubuttons {
my $role_selector;
my $showgroups=0;
my ($cnum,$cdom);
+#
+# if the URL is hidden, symbs and the non-versioned version of the URL would be encrypted
+#
my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
- $logo = '
| ';
+ $logo = '';
if ($env{'request.state'} eq 'construct') {
+#
+# We are in construction space
+#
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) {
my $returnurl = $env{'request.filename'};
$returnurl =~ s:^/home/([^/]+)/public_html/(.*)$:/priv/$1/$2:;
@@ -213,6 +207,9 @@ sub menubuttons {
}
}
if ($env{'request.course.id'}) {
+#
+# We are in a course
+#
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my %coursegroups;
@@ -230,78 +227,28 @@ sub menubuttons {
}
}
- if ($env{'browser.interface'} eq 'textual') {
-# Textual display only
- if ($env{'request.course.id'}) {
- $navmaps=(<$lt{'nav'}
-ENDNAV
- if (&show_return_link()) {
- my $escreload=&escape('return:');
- $reloadlink=(<$lt{'ret'}
-ENDRELOAD
- }
- my $is_community =
- (&Apache::loncommon::course_type() eq 'Community');
- if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
- my $text = ($is_community) ? $lt{'gdoc'} : $lt{'docs'};
- $docs=(<$text
-ENDDOCS
- }
- if ($showgroups) {
- $groups =(<$lt{'groups'}
-ENDGROUPS
- }
- }
- my $form=&serverform();
- my $utility=&utilityfunctions();
- my $output=(<
-// BEGIN LON-CAPA Internal
-$utility
-
-
-
-
-$form
-ENDMAINMENU
- if ($registration) { $output.=&innerregister($forcereg); }
- return $output."
";
- } elsif ($env{'environment.remote'} eq 'off') {
+ if ($env{'environment.remote'} eq 'off') {
# Remote Control is switched off
# figure out colors
- my %lt=&initlittle();
+ my %lt=&initlittle();
my $domain=&Apache::loncommon::determinedomain();
- my $function =&Apache::loncommon::get_users_function();
+ my $function =&Apache::loncommon::get_users_function();
my $link=&Apache::loncommon::designparm($function.'.link',$domain);
my $alink=&Apache::loncommon::designparm($function.'.alink',$domain);
my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain);
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain);
- if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
- return (<
-
- $logo
- |
-
- $lt{'login'}
- |
-
-
-
+
+ if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
+ return (<