--- loncom/interface/lonmenu.pm 2023/09/02 15:56:34 1.369.2.83.2.9 +++ loncom/interface/lonmenu.pm 2012/05/15 01:41:27 1.370 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.369.2.83.2.9 2023/09/02 15:56:34 raeburn Exp $ +# $Id: lonmenu.pm,v 1.370 2012/05/15 01:41:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,6 +26,8 @@ # http://www.lon-capa.org/ # # +# There is one parameter controlling the action of this module: +# =head1 NAME @@ -33,8 +35,7 @@ Apache::lonmenu =head1 SYNOPSIS -Loads contents of /home/httpd/lonTabs/mydesk.tab, -used to generate inline menu, and Main Menu page. +Coordinates the response to clicking an image. This is part of the LearningOnline Network with CAPA project described at http://www.lon-capa.org. @@ -73,19 +74,10 @@ It is set to 'done' in the BEGIN block o =item @primary_menu The elements of this array reference arrays that are made up of the components -of those lines of mydesk.tab that start with prim:. +of those lines of mydesk.tab that start with prim. It is used by primary_menu() to generate the corresponding menu. It gets filled in the BEGIN block of this module. -=item %primary_sub_menu - -The keys of this hash reference are the names of items in the primary_menu array -which have sub-menus. For each key, the corresponding value is a reference to -an array containing components extracted from lines in mydesk.tab which begin -with primsub:. -This hash, which is used by primary_menu to generate sub-menus, is populated in -the BEGIN block. - =item @secondary_menu The elements of this array reference arrays that are made up of the components @@ -99,91 +91,26 @@ It gets filled in the BEGIN block of thi =over -=item prep_menuitems(\@menuitem,$target,$listclass,$linkattr) +=item prep_menuitems(\@menuitem) This routine wraps a menuitem in proper HTML. It is used by primary_menu() and secondary_menu(). =item primary_menu() -This routine evaluates @primary_menu and returns a two item array, -with the array elements containing XHTML for the left and right sides of -the menu that contains the following links: About, Message, Roles, Help, Logout +This routine evaluates @primary_menu and returns XHTML for the menu +that contains following links: About, Message, Roles, Help, Logout @primary_menu is filled within the BEGIN block of this module with -entries from mydesk.tab +entries from mydesk.tab =item secondary_menu() Same as primary_menu() but operates on @secondary_menu. -=item create_submenu() - -Creates XHTML for unordered list of sub-menu items which belong to a -particular top-level menu item. Uses hover pseudo class in css to display -dropdown list when mouse hovers over top-level item. Support for IE6 -(no hover psuedo class) via LC_hoverable class for
'; - $menu .= '
$link
-ENDREMOTEFORM -} - -sub get_menu_name { - my $hostid = $Apache::lonnet::perlvar{'lonHostID'}; - $hostid =~ s/\W//g; - return 'LCmenu'.$hostid; -} - -sub reopenmenu { - unless ($env{'environment.remote'} eq 'on') { return ''; } - my $menuname = &get_menu_name(); - my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); - return('window.open('.$nothing.',"'.$menuname.'","",false);'); + return &Apache::lonhtmlcommon::scripttag('', 'start') + . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0) + . &Apache::lonhtmlcommon::scripttag('', 'end'); } - -sub open { - my $returnval=''; - unless ($env{'environment.remote'} eq 'on') { - return - ''; - } - my $menuname = &get_menu_name(); - -# unless (shift eq 'unix') { -# resizing does not work on linux because of virtual desktop sizes -# $returnval.=(<'; - if ($type eq 'map') { - $lt{'miss'} .= &mt('Submissions are missing for [quant,_1,question part,question parts] in this folder.',$missing); - } else { - $lt{'miss'} .= &mt('Submissions are missing for [quant,_1,part] in this question.',$missing); - } - if ($missing > 1) { - $lt{'miss'} .= ' '.&mt('If you confirm you are done you will be unable to submit answers for them.').''; - } else { - $lt{'miss'} .= ' '.&mt('If you confirm you are done you will be unable to submit an answer for it.').'
'; - } - } - $donebuttontext = &HTML::Entities::encode($donebuttontext,'<>&"'); - if ($proctor) { - if ($height !~ /^\d+$/) { - $height = 400; - if ($missing) { - $height += 60; - } - } - if ($width !~ /^\d+$/) { - $width = 400; - if ($missing) { - $width += 60; - } - } - return <$lt{'preamble'} $lt{$type}
- $lt{'miss'} -$lt{'proctor'}
- -$lt{'cancel'}
-';
- }
- return < $lt{'preamble'} $lt{$type} $lt{'miss'} $lt{'okdone'} $lt{'cancel'}