<?php
/**
* PAjFF Joomla port
*
* <p>Include this fiole instead of <i>pajff.php</i> if you want to write
* a Joomla component as it initalizes Joomla.</p>
*
* {@link http://sourceforge.net/projects/pajff Project home}
*
* @package PAjFF
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Atanas Markov hide@address.com
* @version 0.0.2
* @copyright 2006 by Atanas Markov
*
* @subpackage pajff_joomla
**/
/**
* @global boolean $ajaxcall
*/
global $ajaxcall;
$ajaxcall = false;
/**
* Initialized to use Joomla relative path to the framework
* @global string $pajffxajaxpath
*/
$pajffxajaxpath='/components/com_'.$pajffappname.'/pajff/ajax';
if (!$pajffpath){
global $pajffpath;
$pajffpath= "http://".$_SERVER['HTTP_HOST'].
dirname($_SERVER['PHP_SELF']).
'/components/com_'.$pajffappname.'/pajff/';
}
//print $pajffpath;
/**
* Local path to Joomla
* @global string $mosConfig_absolute_path
*/
if (!$mosConfig_absolute_path) {
require_once( '../../configuration.php' );
}
/**
* tell the world it's Joomla
*
*/
define( '_VALID_MOS', 1 );
/**
* Joomla component path
* @global string $thiscomppath
*/
global $thiscomppath;
$thiscomppath = $mosConfig_absolute_path.'/components/com_'.$pajffappname.'/';
ini_set('include_path', $mosConfig_absolute_path . PATH_SEPARATOR . ini_get('include_path'));
include_once( 'globals.php' );
// displays offline page
if ( $mosConfig_offline == 1 )
{
include( 'offline.php' );
exit();
}
// Make a validation betweeen Joomla! and Mambo
if ( file_exists( $thiscomppath.'../../includes/joomla.php' ) )
{
require_once( $thiscomppath.'../../includes/joomla.php' );
} else {
require_once( $thiscomppath.'../../includes/mambo.php' );
}
/*
* Script initialization goes here
*/
//global parameters
/**
* Joomla database object
* @global database $database
*/
global $database;
global $mosConfig_absolute_path;
/**
* Joomla URL
* @global string $mosConfig_live_site
*/
global $mosConfig_live_site;
//self path
/**
* Joomla command to call the component
* @global string $mycompurl
*/
global $mycompurl;
$mycompurl=$mosConfig_live_site."/index.php?option=com_".$thiscompname;
/**
* PAjFF framework charset for database communication
* @global string $pajffcharset
*/
global $pajffcharset;
if ($pajffcharset){
//select charset for mysql session
if ($database) {
$database->setQuery( "set names '$pajffcharset'" );
$database->query();
}
}
/**
* @global $pajffmaindatabase;
*/
global $pajffdefaultdatabase;
$pajffdefaultdatabase= $database;
include_once("pajff.php");
/* End initialization */
?>