--- loncom/interface/lonmenu.pm 2011/10/31 22:46:09 1.358 +++ loncom/interface/lonmenu.pm 2011/12/28 22:41:02 1.366 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.358 2011/10/31 22:46:09 raeburn Exp $ +# $Id: lonmenu.pm,v 1.366 2011/12/28 22:41:02 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 @@ -707,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]); } } } @@ -1222,7 +1230,7 @@ function golist(url) { function catalog_info() { - loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); + openMyModal(window.location.pathname+'.meta',500,400,'yes'); } function chat_win() { @@ -1248,18 +1256,6 @@ function annotate() { annotator.document.close(); } -function set_wishlistlink(title, path) { - if (!title) { - title = document.title; - title = title.replace(/^LON-CAPA /,''); - } - if (!path) { - path = location.pathname; - } - Win = window.open('/adm/wishlist?mode=newLink&setTitle='+title+'&setPath='+path, - 'wishlistNewLink','width=560,height=350,scrollbars=0'); -} - function open_Wishlist_Import(rat) { var newWin; if (rat) { @@ -1660,11 +1656,12 @@ sub required_privs { '/adm/populate' => 'cst', '/adm/trackstudent' => 'vsa', '/adm/statistics' => 'vgr', + '/adm/setblock' => 'dcm', }; unless ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'spreadsheet') { - $privs->{'/adm/classcalc'} => 'vgr', - $privs->{'/adm/assesscalc'} => 'vgr', - $privs->{'/adm/studentcalc'} => 'vgr'; + $privs->{'/adm/classcalc'} = 'vgr', + $privs->{'/adm/assesscalc'} = 'vgr', + $privs->{'/adm/studentcalc'} = 'vgr'; } return $privs; }