API

Article Index

Interface class

In order to use the interface class it needs to be included in your extension first. This happens with the follwing code:

$file = JPATH_ROOT.DS.'components'.DS.'com_joomgallery'.DS.'interface.php';
if(!file_exists($file))
{
JError::raiseError(500, 'JoomGallery seems not to be installed');
}
else
{
require_once $file;
$interface = new JoomInterface();
}

The variable '$interface' now holds the interface object (provided that JoomGallery is installed).

By now you are able to use the functions the interface provides.
A call looks like this, for example:

$interface->getPageHeader();

or like this if something you need is returned by the function:

$images = $interface->getPicsOfUser($userid);

The funktion 'getPageHeader' will be important if your extension shall output images or the like and you want to use the style definitions of the gallery, because it loads the CSS files of JoomGallery.

Please have a look at the interface class on your own ('components/com_joomgallery/interface.php'). There are descriptions in the header of every function, which list what the function does, what it returns possibly and which parameters it needs.

At this point only the function 'addConfig()' shall be mentioned additionally. With this one, you are able to configure the interface. For example, you may define the method which will be used to open an image:

$interface->addConfig('openimage', 6);

The number 6 is mapped with Slimbox, other assignments are listed below:

0 => Default view
1 => New window
2 => JavaScript window
3 => DHTML Container
5 => Thickbox3
6 => Slimbox
12 => additional plugins

If 'openimage' isn't set, the interface will use the correspondent setting of JoomGallery's configuration manager ('Entering Detail View' in tab 'Category View' -> 'General Settings').

Further options are 'group', 'limit' or 'type', for example.

Joomla!®

Joom::Gallery is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.