Joseph L. LeBlanc
homeportfoliojoomlabiocontactblog
articles
guides
tutorials
all
forum
Subscribe in NewsGator Online

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

 

Welcome to Joseph LeBlanc's Joomla resources. First time visitors will find the Daily Message Component Tutorial to be helpful. (Daily Message for Joomla 1.0 is also available, as well as many other tutorials based around it). In addition to the tutorials, there are articles covering conceptual topics, such as the oft-asked question "What is the difference between a component and a module?" To receive alerts for new tutorials and articles, choose a newsfeed at the right appropriate for your newsreader.

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.

 

?>