--- loncom/interface/lonmenu.pm 2010/08/13 13:13:26 1.332
+++ loncom/interface/lonmenu.pm 2010/12/02 06:00:12 1.340
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.332 2010/08/13 13:13:26 wenzelju Exp $
+# $Id: lonmenu.pm,v 1.340 2010/12/02 06:00:12 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -155,7 +155,6 @@ use Apache::lonhtmlcommon();
use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
-use Apache::lonwishlist();
use LONCAPA qw(:DEFAULT :match);
use HTML::Entities();
@@ -215,7 +214,18 @@ sub primary_menu {
if ($$menuitem[3] eq 'Help') { # special treatment for helplink
- $menu .= '
'.&Apache::loncommon::top_nav_help('Help').'
';
+ if ($public) {
+ my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
+ my $defdom = &Apache::lonnet::default_login_domain();
+ my $to = &Apache::loncommon::build_recipient_list(undef,
+ 'helpdeskmail',
+ $defdom,$origmail);
+ if ($to ne '') {
+ $menu .= &prep_menuitem($menuitem);
+ }
+ } else {
+ $menu .= '
'.&Apache::loncommon::top_nav_help('Help').'
';
+ }
} else {
$menu .= prep_menuitem($menuitem);
}
@@ -526,15 +536,18 @@ sub innerregister {
if ($nocrsedit) {
$editbutton=&clear(6,1);
} else {
+ my $bot = "go('$cfile')";
if ($switchserver) {
if ( $env{'request.symb'} && $env{'request.course.id'} ) {
- my ($mapurl,$rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread());
- $cfile = '/adm/switchserver?otherserver='.$home.'&role='.$env{'request.role'}.'&symb='.$env{'request.symb'}.'&origurl='.$resurl;
+ $cfile = '/adm/switchserver?otherserver='.$home.'&role='.
+ &HTML::Entities::encode($env{'request.role'},'"<>&').'&symb='.
+ &HTML::Entities::encode($env{'request.symb'},'"<>&');
+ $bot = "need_switchserver('$cfile');";
}
}
$editbutton=&switch
('','',6,1,'pcstr.png','edit[_1]','resource[_2]',
- "go('".$cfile."');","Edit this resource");
+ $bot,"Edit this resource");
$noeditbutton = 0;
}
} elsif ($editbutton eq '') {
@@ -1105,14 +1118,8 @@ sub utilityfunctions {
my $end_page_annotate =
&Apache::loncommon::end_page({'js_ready' => 1});
- my $start_page_bookmark =
- &Apache::loncommon::start_page('Bookmarks',undef,
- {'only_body' => 1,
- 'js_ready' => 1,
- 'bgcolor' => '#BBBBBB',});
-
- my $end_page_bookmark =
- &Apache::loncommon::end_page({'js_ready' => 1});
+ my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'.
+ &mt('Switch server?');
my $start_page_wishlistlink =
&Apache::loncommon::start_page('Set link to wishlist',undef,
@@ -1127,6 +1134,10 @@ sub utilityfunctions {
# it is split into 3 parts and the inputfields for title and path are left out
# these fields are inserted later to set the values for title and path
# automatically via JavaScript (document.title and location.pathname)
+ my %folders = &Apache::lonnet::get('wishlist',['folders']);
+ if ($folders{'folders'} eq '') {
+ $folders{'folders'} = '';
+ }
my $in_page_wishlistlink1 = '