|
Page 8 of 9 toolbar.hello_world.php - Sets up the toolbar. <?php //hello_world Component// /** * Content code * @package hello_world * @Copyright (C) 2004 Doyle Lewis * @ All rights reserved * @ hello_world is Free Software * @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html * @version 1.0 **/ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); require_once( $mainframe->getPath( 'toolbar_html' ) ); if($task) { switch($task) { case 'new': case 'edit': $act = "edit"; break; } } if ($act) { switch ( $act ) { case 'edit': menuHello_world::EDIT_MENU(); break; case 'text': menuHello_world::TEXT_MENU(); break; } } ?> Now let's look at how the file works: require_once( $mainframe->getPath( 'toolbar_html' ) ); Works the same as requiring the admin.hello_world.html.php file in admin.hello_world.php if($task) { switch($task) { case 'new': case 'edit': $act = "edit"; break; } } "new" and "edit" will use the same toolbar. case 'edit': menuHello_world::EDIT_MENU(); break; This tells toolbar.hello_world.html.php which function to use.
|