HelloWorld Solution

 * * PHP version 4 and 5 * * LICENSE: This source file is subject to LGPL license * that is available through the world-wide-web at the following URI: * http://www.gnu.org/copyleft/lesser.html * * @author	  Chamindra de Silva (http://www.linux.lk/~chamindra) * @author	  Ralph Morelli (http://www.cs.trincoll.edu/~ram) * @copyright Lanka Software Foundation - http://www.opensource.lk * @package    module * @subpackage skel * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL) * */

/** * Place all your dependent libraries below. Given are some typical ones * required for the module */ include_once $global['approot'].'/inc/lib_menu.inc'; include_once $global['approot'].'/inc/lib_form.inc'; include_once $global['approot'].'/inc/lib_validate.inc'; include_once $global['approot'].'/inc/lib_errors.inc'; include_once($global['approot'].'inc/lib_log.inc');

/** * This function allows you to override the mainmenu. This is often done * to include the modules own menu * * @access public * @return void */ function shn_hw_mainmenu {   global $global; $module = $global['module']; // Create the module menu shn_mod_menuopen(_('Hello World Module'));

shn_mod_menuitem('default',_('Home')); shn_sub_mod_menuitem('about',_('About')); // Calls the about function shn_sub_mod_menuopen(_('Greetings')); shn_sub_mod_menuitem('hello',_('Hello')); // Calls the hello function shn_sub_mod_menuitem('ciao',_('Ciao'));   // Calls the ciao function shn_sub_mod_menuclose;

shn_mod_menuclose; // include the main menu so that the user can navigate outside the module include $global['approot'].'/inc/handler_mainmenu.inc';

}

/** * Other sections you can override */ // function shn_skel_header {} // function shn_skel_footer {} // function shn_skel_html_head {}

/** * This function displays the default page of the module when it is selected * This function has to exist! * * @access public * @return void */ function shn_hw_default {   global $global; ?> <?=_(" Welcome to the Hello World ModuleChoose an item from the Greetings menu. ")?> <?=_(" Features Saying hello in EnglishSaying ciao in Italian")?>

<?php }

/** * This is the about call from the greeting sub menu * * @access public * @return void */ function shn_hw_about {   echo ' '._('This is a workshop exercise.').' '; shn_hw_default; }

/** * This is the call from the greeting sub menu * * @access public * @return void */ function shn_hw_hello {   echo ' '._('Hello World!').' '; shn_hw_default; }

/** * This is the call from the greeting sub menu * * @access public * @return void */ function shn_hw_ciao {   echo ' '._('Ciao Mondo!').' '; shn_hw_default; }