<?php
/*
 *
 * @package		ARI Smart Content
 * @author		ARI Soft
 * @copyright	Copyright (c) 2011 www.ari-soft.com. All rights reserved
 * @license		GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
 * 
 */

(defined('_JEXEC') && defined('ARI_FRAMEWORK_LOADED')) or die;

jimport('joomla.plugin.plugin');

class AriSmartContentPluginLightbox extends JPlugin
{
	var $_group = null;

	function isImage($link)
	{
		$uri = new JURI($link);
		$path = $uri->getPath();
		
		return (preg_match('/\.(jpg|jpeg|png|bmp|gif)$/i', $path) > 0);
	}
	
	function isLink($link)
	{
		return !$this->isImage($link);
	}
	
	function setGroup($group = null)
	{
		if ($group === true)
			$group = uniqid('lg_', false);

		$this->_group = $group;
	}
	
	function getGroup()
	{
		return $this->_group;
	}

	function processLink(&$linkAttrs, $group = null, $options = null)
	{
		if (is_null($group))
			$group = $this->getGroup();

		$this->processLinkImpl($linkAttrs, $group, $options);
	}
	
	function processLinkImpl(&$linkAttrs, $group, $options)
	{
		
	}
	
	function getInitClientCode($container, $group = null)
	{
		if (is_null($group))
			$group = $this->getGroup();

		return $this->getInitClientCodeImpl($container, $group);
	}
	
	function getInitClientCodeImpl($container, $group)
	{
		
	}
	
	function loadAssets()
	{
		
	}
}