home forums resources search newsjoinmembers: 5932
Main Network: Joomla Wordpress Drupal Drupal.se Fireorb Flash Java PHP Ruby Windows Linux
Hiveminds | Wed, 2008-05-07 20:23  tags: , ,

<?php

/**
* @package HelloWorld
* @version 1.0
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software and parts of it may contain or be derived from the
* GNU General Public License or other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
/*
 * DEVNOTE: This is the 'main' file.
 * It's the one that will be called when we go to the HELLOWORD component.
 */
// no direct access
defined'_JEXEC' ) or die( 'Restricted access' );
/*
 * Make sure the user is authorized to view this page
 */
/* get rid of it...must be changed in libraries\joomla\user\authorization.php
$user = & JFactory::getUser();
if (!$user->authorize( 'com_helloword', 'manage' )) {
    $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
}
*/
// Load the html class
// DEVNOTE: This will include the admin.helloworld.html.php file,
// so now we can use anything that it provides!
//require_once( JApplicationHelper::getPath( 'admin_html' ) );
//No more helpers. these funcions were moved to controlers an views.
// specific controller?
 
if($controller JRequest::getVar('controller'))
// Require specific controller if requested
  
{
   require_once (
JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php');
   require_once( 
JPATH_COMPONENT.DS.'models'.DS.'helloworld.php' );
   require_once( 
JPATH_COMPONENT.DS.'views'.DS.$controller.DS.'view.php' );
  }
 else
// Require the base controller - default
  
{
  require_once (
JPATH_COMPONENT.DS.'controllers'.DS.'default.php');
  require_once( 
JPATH_COMPONENT.DS.'models'.DS.'helloworld.php' );
  require_once (
JPATH_COMPONENT.DS.'views'.DS.'default'.DS.'view.php');
  }
// Create the controller
$classname  'HelloWorldController_'.$controller;
//echo $classname;
//echo JRequest::getVar('task' );
//exit;
$controller = new $classname( array('default_task' => 'display') );
//$controller = new $classname();
// Perform the Request task
$controller->executeJRequest::getVar('task' ));
// Redirect if set by the controller
$controller->redirect();

?>

Hiveminds's picture
This article brought to you by the Hiveminds Magazine - Staff. Contact us if you want to post an article or announcement anonymously
 
Drupal Joomla! Drupal Content Management Systems Content Management Systems PHP Joomla! eRuby Adobe Flex
 

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.