homejoomlablogministries
articles
guides
tutorials
all
forum

Learning Joomla! for the first time? Buy the Joomla! 1.5 Essential training CD-ROM or watch it on Lynda.com.

 

I am speaking at OpenCamp 2010 in Addison, TX


PDF Print E-mail

 

toolbar.dailymessage.php

 

For all components, Joomla loads toolbar code for the administrator interface. The creation of this code is fairly straightforward as the functionality is very well defined. The code in this file is essentially one switch statement that loads the appropriate toolbar based on the 'task' and 'act' variables.

 

<?

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

require_once( $mainframe->getPath( 'toolbar_html' ) );

 

First, make sure the code is running within mambo and load up the toolbar.dailymessage.html.php file, which will handle the HTML output for the menu.

 

switch ( $task ) {

case 'edit':

menuDailyMessage::EDIT_MENU();

break;

 

case 'new':

menuDailyMessage::EDIT_MENU();

break;

 

default:

switch($act)

{

case "configure":

menuDailyMessage::CONFIGURE_MENU();

break;

 

default:

menuDailyMessage::DEFAULT_MENU();

break;

}

break;

 

}

 

Notice that both the 'new' and 'edit' tasks share the same menu. This does not cause a conflict, because the menu merely launches tasks and is not functionally dependent on the current task. The current task and 'act' merely determine which options will be displayed. All of the menus are called through functions in the menuDailyMessage class contained in toolbar.dailymessage.html.php file.

 

?>