Skip to content

Joomla! Integration

Update (Nov, 2016)

Joomla! is now supported out of the box. Please see
http://phpgrid.com/example/joomla-cms-native-support/



The following is only for phpGrid older versions (<7):

Joomla uses their own session management so when you use php session it wont work guarantee. 

Solution: Replace session_start(); in your external script with
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' ));
 
require_once ( JPATH_BASE '/includes/defines.php' );
require_once ( JPATH_BASE '/includes/framework.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();

Be sure to change JPATH_BASE to suit your directory structure.

Replace the $_SESSION[ 'name' ] = "value"; in your external script with

$session = JFactory::getSession();
$session->set('name', "value");

Now you can retrieve this session variable using:

$session = JFactory::getSession();
echo $session->get('name');
Source: http://docs.joomla.org/How_to_access_session_variables_set_by_an_external_script

There are several places to change. 

  • server/classes/*.php (all)
  • ajaxfiledelete.php
  • ajaxfileupload.php
  • data.php
  • edit.php
  • export.php
  • masterdetail.php
  • subgrid.php
In future release, a phpGrid custom session handler class that will be used.

Feedback and Knowledge Base