How to propagate the Joomla context

A multipurpose module, plugin and component

How to propagate the Joomla context

New postby fgw44 » Sun Dec 26, 2010 12:57 am

Hi all,

I use Jumi in order to add custom PHP pages to a Joomla website.

The first call works well using : {jumi [planning/planning.php]}

Then, within planning.php, I use the Art Sexy Lightbox plugin to show the next php page (named detail_stage.php) :

<a href="<? echo JURI::root() . JRoute::_('planning/inscription/auto/detail_stage.php?sta_id=' . $tmp_array[0] . '&TB_iframe=true&amp;height=600&amp;width=900') ?>" rel="sexylightbox" style="text-decoration:none">
</a>
<?
$aslpp = new ArtSexyLightboxPluginProcessor;
echo $aslpp->processPlugins('{artsexylightbox}{/artsexylightbox}');
?>

I then lose the Joomla context :
- It says "Direct Access to this location is not allowed."
- JPATH_SITE and DS Joomla constants are not seen any more.

I tried putting nested Jumi calls within planning.php but it actually clips all the nested page within the main page.

Is there a way to import the Joomla context (using Jumi APIs maybe) within detail_stage.php ?

Thanks in advance.

Cheers,

F. Williams (France)
fgw44
 
Posts: 2
Joined: Sun Dec 26, 2010 12:46 am

Re: How to propagate the Joomla context

New postby fgw44 » Sun Dec 26, 2010 1:39 am

I found this but I am not sure that it is a clean solution :

/**
* Init framework Joomla
**/
$root_dir = dirname(dirname(dirname(dirname(__FILE__))));
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR);
define('JPATH_BASE', $root_dir);

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
fgw44
 
Posts: 2
Joined: Sun Dec 26, 2010 12:46 am


Return to Jumi

Who is online

Users browsing this forum: No registered users and 2 guests

cron