--- loncom/interface/lonmenu.pm 2011/11/10 21:15:55 1.361 +++ loncom/interface/lonmenu.pm 2012/05/14 13:58:04 1.369.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.361 2011/11/10 21:15:55 raeburn Exp $ +# $Id: lonmenu.pm,v 1.369.2.2 2012/05/14 13:58:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,7 +156,6 @@ use Apache::lonlocal; use Apache::lonmsg(); use LONCAPA qw(:DEFAULT :match); use HTML::Entities(); -use Apache::lonwishlist(); use vars qw(@desklines %category_names %category_members %category_positions $readdesk @primary_menu @secondary_menu); @@ -428,6 +427,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 @@ -622,14 +627,9 @@ c&6&3 c&8&1 c&8&2 s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document +s&9&1&sbkm.png&Bookmark&set[_1]bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1 + ENDMENUITEMS - if (&Apache::lonnet::allowed('bre', $env{'request.course.id'}) eq 'F' && $env{'request.uri'} =~ /^\/res/) { - # wishlist is only available for users with access to resource-pool - # and links can only be set for resources within the resource-pool - $menuitems .= (<'); + } +# +# 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(< +// + +ENDREMOTESTARTUP +} + +sub setflags() { + return(< +// + +ENDSETFLAGS +} + +sub maincall() { + if ($env{'environment.remote'} eq 'off') { return ''; } + return(< +// + +ENDMAINCALL +} + +sub load_remote_msg { + my ($lowerurl)=@_; + + if ($env{'environment.remote'} eq 'off') { return ''; } + + my $esclowerurl=&escape($lowerurl); + my $link=&mt('[_1]Continue[_2] on in Inline Menu mode' + ,'' + ,''); + 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.=(< +ENDOPEN + return ''; +} + + # ================================================================== Raw Config sub clear { @@ -1070,6 +1222,28 @@ sub check_for_rcrs { return $showreqcrs; } +# ======================================================================= Close + +sub close { + if ($env{'environment.remote'} eq 'off') { return ''; } + my $menuname = &get_menu_name(); + return(< +// + +ENDCLOSE +} + sub dc_popup_js { my %lt = &Apache::lonlocal::texthash( more => '(More ...)', @@ -1081,13 +1255,13 @@ function showCourseID() { document.getElementById('dccid').style.display='block'; document.getElementById('dccid').style.textAlign='left'; document.getElementById('dccid').style.textFace='normal'; - document.getElementById('dccidtext').innerHTML ='$lt{'less'}'; + document.getElementById('dccidtext').innerHTML ='$lt{'less'}'; return; } function hideCourseID() { document.getElementById('dccid').style.display='none'; - document.getElementById('dccidtext').innerHTML ='$lt{'more'}'; + document.getElementById('dccidtext').innerHTML ='$lt{'more'}'; return; } @@ -1123,15 +1297,26 @@ 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 $esc_url=&escape($currenturl); + my $esc_symb=&escape($currentsymb); return (<
' + +'
Link Name:
' + +'
Address:

' + +'$end_page_bookmark' ); + bmquery.document.close(); } ENDUTILITY @@ -1662,11 +1851,13 @@ sub required_privs { '/adm/populate' => 'cst', '/adm/trackstudent' => 'vsa', '/adm/statistics' => 'vgr', + '/adm/setblock' => 'dcm', + '/adm/coursedocs' => 'mdc', }; 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; }