--- loncom/interface/lonmenu.pm 2009/10/29 16:15:57 1.297 +++ loncom/interface/lonmenu.pm 2010/03/16 19:55:49 1.318 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.297 2009/10/29 16:15:57 raeburn Exp $ +# $Id: lonmenu.pm,v 1.318 2010/03/16 19:55:49 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,8 +28,6 @@ # # There is one parameter controlling the action of this module: # -# environment.remote - if this is 'on', the routines controll the remote -# control, otherwise they render the main window controls; =head1 NAME @@ -42,48 +40,83 @@ Coordinates the response to clicking an This is part of the LearningOnline Network with CAPA project described at http://www.lon-capa.org. -=head1 SUBROUTINES +=head1 GLOBAL VARIABLES =over -Little texts +=item @desklines -=item initlittle() +Each element of this array contains a line of mydesk.tab that doesn't start with +cat, prim or scnd. +It gets filled in the BEGIN block of this module. -=item menubuttons() +=item %category_names -This gets called at the top of the body section +The keys of this hash are the abbreviations used in mydesk.tab in those lines that +start with cat, the values are strings representing titles. +It gets filled in the BEGIN block of this module. -=item show_return_link() +=item %category_members -=item registerurl() +TODO -This gets called in the header section +=item %category_positions -=item innerregister() +The keys of this hash are the abbreviations used in mydesk.tab in those lines that +start with cat, its values are position vectors (column, row). +It gets filled in the BEGIN block of this module. -This gets called in order to register a URL, both with the Remote -and in the body of the document +=item $readdesk + +Indicates that mydesk.tab has been read. +It is set to 'done' in the BEGIN block of this module. + +=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. +It is used by primary_menu() to generate the corresponding menu. +It gets filled in the BEGIN block of this module. + +=item @secondary_menu -=item loadevents() +The elements of this array reference arrays that are made up of the components +of those lines of mydesk.tab that start with scnd. +It is used by secondary_menu() to generate the corresponding menu. +It gets filled in the BEGIN block of this module. -=item unloadevents() +=back + +=head1 SUBROUTINES + +=over + +=item prep_menuitems(\@menuitem) -=item startupremote() +This routine wraps a menuitem in proper HTML. It is used by primary_menu() and +secondary_menu(). -=item setflags() +=item primary_menu() -=item maincall() +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 -=item load_remote_msg() +=item secondary_menu() -=item get_menu_name() +Same as primary_menu() but operates on @secondary_menu. -=item reopenmenu() +=item show_return_link() + +=item registerurl() + +This gets called in the header section -=item open() +=item innerregister() -Open the menu +This gets called in order to register a URL, both with the Remote +and in the body of the document =item clear() @@ -101,10 +134,6 @@ The javascript is usually similar to "go =item rawconfig() -=item close() - -=item footer() - =item utilityfunctions() =item serverform() @@ -150,7 +179,10 @@ sub prep_menuitem { } else { # textual Link $link = &mt($$menuitem[3]); } - 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.=(<';
for (my $row=1; $row<=8; $row++) {
foreach my $cat (keys(%category_members)) {
if ($category_positions{$cat} ne "$col,$row") { next; }
#$output.='
|