[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Sat Sep 7 17:08:58 EDT 2013
raeburn Sat Sep 7 21:08:58 2013 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmenu.pm
Log:
- For 2.11
- Backport 1.421
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.46 loncom/interface/lonmenu.pm:1.369.2.47
--- loncom/interface/lonmenu.pm:1.369.2.46 Tue Aug 13 14:17:37 2013
+++ loncom/interface/lonmenu.pm Sat Sep 7 21:08:58 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.46 2013/08/13 14:17:37 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.47 2013/09/07 21:08:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -333,6 +333,7 @@
}
sub secondary_menu {
+ my ($httphost) = @_;
my $menu;
my $crstype = &Apache::loncommon::course_type();
@@ -465,7 +466,8 @@
($roleswitcher_js,$roleswitcher_form,my $switcher) =
&roles_selector(
$env{'course.' . $env{'request.course.id'} . '.domain'},
- $env{'course.' . $env{'request.course.id'} . '.num'}
+ $env{'course.' . $env{'request.course.id'} . '.num'},
+ $httphost
);
$menu .= $switcher;
} else {
@@ -1954,6 +1956,7 @@
}
sub utilityfunctions {
+ my ($httphost) = @_;
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
if ($currenturl =~ m{^/adm/wrapper/ext/}
&& $env{'request.external.querystring'} ) {
@@ -1989,7 +1992,7 @@
my $countdown = &countdown_toggle_js();
return (<<ENDUTILITY)
-
+ var host="$httphost";
var currentURL=unescape("$esc_url");
var reloadURL=unescape("$esc_url");
var currentSymb=unescape("$esc_symb");
@@ -2000,7 +2003,7 @@
if (url!='' && url!= null) {
currentURL = null;
currentSymb= null;
- window.location.href=url;
+ window.location.href=host+url;
}
}
@@ -2008,7 +2011,7 @@
function gopost(url,postdata) {
if (url!='') {
- this.document.server.action=url;
+ this.document.server.action=host+url;
this.document.server.postdata.value=postdata;
this.document.server.command.value='';
this.document.server.url.value='';
@@ -2019,7 +2022,7 @@
function gocmd(url,cmd) {
if (url!='') {
- this.document.server.action=url;
+ this.document.server.action=host+url;
this.document.server.postdata.value='';
this.document.server.command.value=cmd;
this.document.server.url.value=currentURL;
@@ -2071,7 +2074,7 @@
if (url!='' && url!= null) {
currentURL = null;
currentSymb= null;
- top.location.href=url;
+ top.location.href=host+url;
}
}
@@ -2082,11 +2085,11 @@
}
function chat_win() {
- lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=480,resizable=yes,location=no,menubar=no,toolbar=no');
+ lonchat=window.open(host+'/res/adm/pages/chatroom.html',"LONchat",'height=320,width=480,resizable=yes,location=no,menubar=no,toolbar=no');
}
function group_chat(group) {
- var url = '/adm/groupchat?group='+group;
+ var url = host+'/adm/groupchat?group='+group;
var winName = 'LONchat_'+group;
grpchat=window.open(url,winName,'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
}
@@ -2107,11 +2110,11 @@
function open_StoredLinks_Import(rat) {
var newWin;
if (rat) {
- newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import&rat='+rat,
+ newWin = window.open(host+'/adm/wishlist?inhibitmenu=yes&mode=import&rat='+rat,
'wishlistImport','scrollbars=1,resizable=1,menubar=0');
}
else {
- newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import',
+ newWin = window.open(host+'/adm/wishlist?inhibitmenu=yes&mode=import',
'wishlistImport','scrollbars=1,resizable=1,menubar=0');
}
newWin.focus();
@@ -2186,7 +2189,7 @@
}
sub roles_selector {
- my ($cdom,$cnum) = @_;
+ my ($cdom,$cnum,$httphost) = @_;
my $crstype = &Apache::loncommon::course_type();
my $now = time;
my (%courseroles,%seccount,%courseprivs);
@@ -2291,7 +2294,7 @@
my @submenu;
$js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,$priv);
$form =
- '<form name="rolechooser" method="post" action="/adm/roles">'."\n".
+ '<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles">'."\n".
' <input type="hidden" name="destinationurl" value="'.
&HTML::Entities::encode($destinationurl).'" />'."\n".
' <input type="hidden" name="gotorole" value="1" />'."\n".
More information about the LON-CAPA-cvs
mailing list