I want to embed G2 into a PHP app but am having some problem. The documentation is rather hard to understand with not a whole lot of information.
I'm trying to use this code to embed G2 into a PHP file which in included by a root level PHP file.
<?php
require_once(dirname(__FILE__) . '/gallery2/embed.php');
$ret = GalleryEmbed::init(array(
'embedUri' => '?view=gallery', 'relativeG2Path' => 'modules/gallery/gallery2', 'loginRedirect' => '?view=gallery'));
if ($ret->isError()) {
// $ret->getAsHtml() has error details..
exit;
}
list ($ret, $g2data) = GalleryEmbed::handleRequest();
if ($ret->isError()) {
// $ret->getAsHtml() has error details..
exit;
}
if ($g2data['isDone']) {
exit; // G2 has already sent output (redirect or binary data)
}
// Use $g2data['headHtml'] and $g2data['bodyHtml']
// to display G2 content inside embedding application
?>
But I get the following notice and nothing shows up:
[The whole date] PHP Notice: Undefined index: itemLink in /web/documents/path/machcms/modules/gallery/gallery2/modules/panorama/module.inc on line 150
I'm working on a module system for a CMS I'm working on.
I'm sure there is something wrong with what I did. Can anyone give me a hint or is embedding not yet working? I'm using CVS.