<?php
/* $Id: [sahana_home]/mod/hw/main.inc,v 1.0 2006/10/02  */
/**
 *
 * Hello World Module --  creates the menu system for the VR module 
 *
 * <p>This file was adapted from Volunteer Management's 
 * version of main.inc.  Volunteer Management's version of
 * main.inc was adapted from Organization Registry's main.inc.  
 * This file creates a two-field menu system when the Volunteer Registry 
 * field in the main menu is clicked.  It calls the
 * function shn_vr_vol_add() via the function shn_vr_default().
 * shn_vr_default() produces the web get query:
 * index.php?mod=vr&act=default.</p>  
 *
 * @package    Trinity_College_hw_demo
 * @copyright  Copyright {@link http://www.opensource.lk Lanka Software Foundation} 2006
 * @license    http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL) 
 * @author     R. Morelli <ralph.morelli@trincoll.edu>
 */
 
global $global;
include_once $global['approot']."/inc/lib_form.inc";       // Include the forms library
include_once $global['approot']."/inc/lib_menu.inc";       // Needed for the HW menu.
include_once $global['approot']."/inc/lib_validate.inc";   // Needed to validate menu items.
//include_once $global['approot']."/mod/vr/lib_vr.inc";      // Local Library: Contains the _shn_form_select_gender() function
include_once ("lib_vr.inc");                               // Local Library: Contains the _shn_form_select_gender() function
include_once ("say_hello.inc");                            // Contains the code for the form.
include_once ("process_hello.inc");                        // Contains the method to process the form.

/**
 * Creates the main menu for the HW module.
 *
 * @access public
 * @return void
 */
function shn_hw_mainmenu() 
{
    global $global;
    $module = $global['module'];
    shn_mod_menuopen(_lc("Hello World"));                    // Create the module menue
    shn_mod_menuitem("say_hello","Say Hello");
    shn_mod_menuclose();
    include $global['approot']."/inc/handler_mainmenu.inc";  // Include the main menu
} 

/**
 *  This function is called automatically when the HW module is 
 *  selected.  It displays the default welcome page defined in home.inc.
 *
 *  @access public
 *  @return void
 */
function shn_hw_default()
{
?>
<div id="home">
    <?=_("<h2>Welcome to the Hello World Module<BR>Choose an item from the Hello World menu.</h2>")?>
</div>
<br />
<?php
}

?>

