--- loncom/interface/lonmenu.pm 2011/10/31 13:44:30 1.356
+++ loncom/interface/lonmenu.pm 2012/05/13 23:45:07 1.369.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.356 2011/10/31 13:44:30 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.1 2012/05/13 23:45:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -153,6 +153,7 @@ use Apache::lonhtmlcommon();
use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
+use Apache::lonmsg();
use LONCAPA qw(:DEFAULT :match);
use HTML::Entities();
use Apache::lonwishlist();
@@ -334,7 +335,8 @@ sub secondary_menu {
and ( $env{'request.noversionuri'} eq ''
|| !defined($env{'request.noversionuri'})))
{
- ($escurl = $env{'request.filename'}) =~ s{^/home/httpd/html}{};
+ my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
+ ($escurl = $env{'request.filename'}) =~ s{^\Q$londocroot\E}{};
$escurl = &escape($escurl);
}
$menu =~ s/\[url\]/$escurl/g;
@@ -409,7 +411,7 @@ sub innerregister {
my $hwkadd='';
if ($env{'request.symb'} ne '' &&
- $env{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form|task)$/) {
+ $env{'request.filename'}=~/$LONCAPA::assess_re/) {
if (&Apache::lonnet::allowed('mgr',$crs)) {
$hwkadd.=&switch('','',7,2,'pgrd.png','Content Grades','grades[_4]',
"gocmd('/adm/grades','gradingmenu')",
@@ -426,6 +428,12 @@ sub innerregister {
"gocmd('/adm/parmset','set')",
'Content Settings');
}
+ if ($env{'request.symb'}=~/^uploaded/ &&
+ &Apache::lonnet::allowed('mdc',$crs)) {
+ $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
+ "gocmd('/adm/coursedocs','direct')",
+ 'Folder/Page Content');
+ }
# -- End Homework
###
### Determine whether or not to display the 'cstr' button for this
@@ -491,8 +499,9 @@ sub innerregister {
$uploaded = &is_course_upload($file,$cnum,$cdom);
}
if (!$uploaded) {
-
- $file=~s{^($match_domain)/($match_username)}{/priv/$1/$2};
+
+ $file=~s{^(priv/$match_domain/$match_username)}{/$1};
+ $file=~s{^($match_domain/$match_username)}{/priv/$1};
# Check that the user has permission to edit this resource
my $setpriv = 1;
@@ -706,7 +715,7 @@ ENDMENUITEMS
unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
&Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'advtools', @inlineremote[61,71,72,73,92]);
+ 'advtools', @inlineremote[61,71,72,73,74,92]);
}
}
}
@@ -752,6 +761,164 @@ sub edit_course_upload {
return $cfile;
}
+sub startupremote {
+ my ($lowerurl)=@_;
+ if ($env{'environment.remote'} eq 'off') {
+ return ('');
+ }
+#
+# The Remote actually gets launched!
+#
+ my $configmenu=&rawconfig();
+ my $esclowerurl=&escape($lowerurl);
+ my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited');
+ return(<
$link
+ENDREMOTEFORM +} + +sub get_menu_name { + my $hostid = $Apache::lonnet::perlvar{'lonHostID'}; + $hostid =~ s/\W//g; + return 'LCmenu'.$hostid; +} + + +sub reopenmenu { + if ($env{'environment.remote'} eq 'off') { return ''; } + my $menuname = &get_menu_name(); + my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); + return('window.open('.$nothing.',"'.$menuname.'","",false);'); +} + + +sub open { + my $returnval=''; + if ($env{'environment.remote'} eq 'off') { + return + ''; + } + my $menuname = &get_menu_name(); + +# unless (shift eq 'unix') { +# resizing does not work on linux because of virtual desktop sizes +# $returnval.=(<