<?php
/**JFlickr is a port of the Jquery Flickr Script by Project Atomic http://www.projectatomic.com/2008/04/jquery-flickr/
**/
/**
* @id			$Id$
* @version  	mod_jflickr.php
* @package  	JB jFlickr
* @copyright 	Copyright (C) 2006 - 2010 Joomla Bamboo. http://www.joomlabamboo.com  All rights reserved.
* @license  	GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$document =& JFactory::getDocument();
$modbase = JURI::base(true).'/modules/mod_jflickr/';
$library = JURI::base(true).'/media/plg_jblibrary/';
$loadCSS = $params->get('loadCSS','head');
$loadJS = $params->get('loadJS','head');
$number	= $params->get( 'number', '8' );
$size = $params->get( 'size', 'original' );
$tsize = $params->get( 'tsize', 's' );
$type = $params->get( 'type', 'photoset' );
$photoset_id = $params->get( 'photoset_id', '981332' );
$text = $params->get( 'text', '' );
$user_id = $params->get( 'user_id', '' );
$group_id = $params->get( 'group_id', '' );
$sort = $params->get( 'sort', 'relevance' );
$tags = $params->get( 'tags', '' );
$random = $params->get( 'random', 'false' );
$fancyBox = $params->get( 'fancybox', 'yes' );
$fancyBoxScript = $params->get( 'fancyboxScript', 'yes' );
$fancyEasing = $params->get( 'fancyEasing', 'yes' ); 
$fancyOverlayShow = $params->get('fancyOverlayShow','true');
$fancyOverlay = $params->get('fancyOverlay','0.6');
$fancyPadding = str_replace('px', '', $params->get('fancyPadding','20'));
$moduleID = $module->id;
$apiKey = $params->get( 'apiKey', 'f28804be7a09c5845676349c7e47d636' );

if ($type =="user") {
    $type1 ="search";
}    
if ($type =="group") {
    $type1 ="search";
}

$zoomClass = 'flickrZoom';
if($loadCSS=='head') {
	$document->addStyleDeclaration('.gallery-flickr ul li {list-style-type:none;float:left;background: none;margin-left:0}.gallery-flickr ul {margin: 0} #right .gallery-flickr ul li a,#left .gallery-flickr ul li a,.gallery-flickr ul li a {float:left;margin:0 4px 4px 0;padding: 0;background:none;border: 0;} .gallery-flickr ul li a:hover {background: #ddd} #gallery-flickr {padding: 0;line-height: 0;margin: 0} .clearfix {clear:both}');
	if (($fancyBoxScript == "yes") && ($fancyBox == "yes")){
		$document->addStyleSheet($modbase.'js/jquery.fancybox/jquery.fancybox-1.3.4.css');
		$zoomClass .= $moduleID;
	}
}
if($loadJS=='head') {
	$document->addScript($modbase . "js/JFlickr.js");
	if (($fancyBoxScript == "yes") && ($fancyBox == "yes")){
		$document->addScript($modbase . "js/jquery.fancybox/jquery.fancybox-1.3.4.pack.js");
		if ($fancyEasing == "yes"){
			$document->addScript($modbase . "js/jquery.fancybox/jquery.easing-1.3.pack.js");
		}
	}
}
require(JModuleHelper::getLayoutPath('mod_jflickr', 'default'));
?>