<?php
$init_script = <<<HTML
	jQuery('[name="_source[]"]').live("change",function(){
		var __val = jQuery(this).val();
		var _val={};
		jQuery.each(__val, function(key, value) { 
			if(value.indexOf('|')!=-1){
				var source = value.split('|');
				if(_val[source[0]] == undefined){
					_val[source[0]]=[];
				}
				if(_val[source[0]] != true){
					_val[source[0]].push(source[1])
				}
			}else{
				_val[value] = true;
			}
		});
		var val=[];
		jQuery.each(_val, function(key, value) { 
			if($.isArray(value)){
				val.push('{'+key+':'+value.join(',')+'}');
			}else{
				val.push('{'+key+'}');
			}
		});
		jQuery('[name="source"]').val(val.join(''));
	});
HTML;
if (! function_exists("theme_dialog_slideshow_source")) {
function theme_dialog_slideshow_source($option){
	include_once (THEME_HELPERS . '/baseOptionsGenerator.php');
	$generator = new baseOptionsGenerator();
	echo '<input type="hidden" id="' . $option['id'] . '" name="' . $option['id'] . '" value="" />';
	$option['id'] = '_source';
	$generator->multiselect($option);
}
}
return array(
	"title" => __("CoverFlow Slideshow", THEME_ADMIN_DOMAIN),
	"shortcode" => 'slideshow',
	"attributes" => 'type="flow"',
	"type" => 'both',
	"init" => $init_script,
	"options" => array(
		array(
			"name" => __("Images Srcs (optional)",THEME_ADMIN_DOMAIN),
			"id" => "content",
			"default" => "",
			"type" => "textarea"
		),
		array(
			"name" => __("Number (optional)",THEME_ADMIN_DOMAIN),
			"desc" => __("Sets the number of images to display.<br> 0: Display all images.",THEME_ADMIN_DOMAIN),
			"id" => "number",
			"default" => '0',
			"min" => 0,
			"max" => 20,
			"step" => "1",
			"type" => "range"
		),
		array(
			"name" => __("SlideShow Source (optional)",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which SlideShow Source to show.",THEME_ADMIN_DOMAIN),
			"id" => "source",
			"options" => array(
				"g" => __('Self Gallery',THEME_ADMIN_DOMAIN),
			),
			"default" => "",
			"chosen" => true,
			"prompt" => __("Select Source..",THEME_ADMIN_DOMAIN),
			'target' => 'slideshow_source',
			'function' => 'theme_dialog_slideshow_source',
			"type" => "custom"
		),
		array(
			"name" =>  __("Align (optional)",THEME_ADMIN_DOMAIN),
			"id" => "align",
			"default" => '',
			"prompt" => __("Default",THEME_ADMIN_DOMAIN),
			"options" => array(
				"left" => __('left',THEME_ADMIN_DOMAIN),
				"right" => __('right',THEME_ADMIN_DOMAIN),
				"center" => __('center',THEME_ADMIN_DOMAIN),
			),
			"type" => "select",
		),
		array(
			"name" => __("Border width",THEME_ADMIN_DOMAIN),
			"id" => "borderwidth",
			"min" => "0",
			"max" => "10",
			"step" => "1",
			"unit" => 'px',
			"default" => "2",
			"type" => "range"
		),
		array(
			"name" => __("Boder Color",THEME_ADMIN_DOMAIN),
			"id" => "bordercolor",
			"default" => "#5D5D5D",
			"type" => "color"
		),
		array(
			"name" => __("Slideshow width",THEME_ADMIN_DOMAIN),
			"id" => "width",
			"min" => "100",
			"max" => "960",
			"step" => "1",
			"unit" => 'px',
			"default" => "628",
			"type" => "range"
		),
		 array(
			"name" => __("Slideshow height",THEME_ADMIN_DOMAIN),
			"id" => "height",
			"min" => "100",
			"max" => "800",
			"step" => "1",
			"unit" => 'px',
			"default" => "280",
			"type" => "range"
		),
		array(
			"name" => __("Large Feature width",THEME_ADMIN_DOMAIN),
			"id" => "largew",
			"min" => "100",
			"max" => "800",
			"step" => "1",
			"unit" => 'px',
			"default" => "400",
			"type" => "range"
		),
		array(
			"name" => __("Large Feature height",THEME_ADMIN_DOMAIN),
			"id" => "largeh",
			"min" => "100",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "400",
			"type" => "range"
		),
		 array(
			"name" => __("Small Feature width",THEME_ADMIN_DOMAIN),
			"id" => "smallw",
			"min" => "100",
			"max" => "800",
			"step" => "1",
			"unit" => 'px',
			"default" => "400",
			"type" => "range"
		),
		array(
			"name" => __("Small Feature height",THEME_ADMIN_DOMAIN),
			"id" => "smallh",
			"min" => "100",
			"max" => "600",
			"step" => "1",
			"unit" => 'px',
			"default" => "400",
			"type" => "range"
		),
		array(
			"name" => __("Small Feature Offset Top",THEME_ADMIN_DOMAIN),
			"id" => "offsetside",
			"min" => "0",
			"max" => "100",
			"step" => "1",
			"unit" => 'px',
			"default" => "50",
			"type" => "range"
		),
		array(
			"name" => __("Captions",THEME_ADMIN_DOMAIN),
			"desc" => __("If you want display on the head of item, turn off the button.",THEME_ADMIN_DOMAIN),
			"id" => "captions",
			"default" => false,
			"type" => "toggle"
		),
		array(
			"name" => __("Caption Position",THEME_ADMIN_DOMAIN),
			"desc" => __("The Position of Caption.",THEME_ADMIN_DOMAIN),
			"id" => "captionposition",
			"options" => array(
				"top" => __("top",THEME_ADMIN_DOMAIN),
				"bottom" => __("bottom",THEME_ADMIN_DOMAIN),
				"center"=>__("center",THEME_ADMIN_DOMAIN),
				"right"=>__("right",THEME_ADMIN_DOMAIN),
				"left"=>__("left",THEME_ADMIN_DOMAIN),
			),
			"default" => "bottom",
			"type" => "select"
		),
		array(
			"name" => __("SlideText Animations Easing",THEME_ADMIN_DOMAIN),
			"desc" => __("Select which animation easing to use.",THEME_ADMIN_DOMAIN),
			"id" => "easing",
			"default" => 'swing',
			"type" => "select",
			"options" => array(
				'swing'=>__("swing",THEME_ADMIN_DOMAIN),
				'linear'=>__("linear",THEME_ADMIN_DOMAIN),
				'easeInQuad'=>__("easeInQuad",THEME_ADMIN_DOMAIN),
				'easeOutQuad'=>__("easeOutQuad",THEME_ADMIN_DOMAIN),
				'easeInOutQuad'=>__("easeInOutQuad",THEME_ADMIN_DOMAIN),
				'easeInCubic'=>__("easeInCubic",THEME_ADMIN_DOMAIN),
				'easeOutCubic'=>__("easeOutCubic",THEME_ADMIN_DOMAIN),
				'easeInOutCubic'=>__("easeInOutCubic",THEME_ADMIN_DOMAIN),
				'easeInQuart'=>__("easeInQuart",THEME_ADMIN_DOMAIN),
				'easeOutQuart'=>__("easeOutQuart",THEME_ADMIN_DOMAIN),
				'easeInOutQuart'=>__("easeInOutQuart",THEME_ADMIN_DOMAIN),
				'easeInQuint'=>__("easeInQuint",THEME_ADMIN_DOMAIN),
				'easeOutQuint'=>__("easeOutQuint",THEME_ADMIN_DOMAIN),
				'easeInOutQuint'=>__("easeInOutQuint",THEME_ADMIN_DOMAIN),
				'easeInSine'=>__("easeInSine",THEME_ADMIN_DOMAIN),
				'easeOutSine'=>__("easeOutSine",THEME_ADMIN_DOMAIN),
				'easeInOutSine'=>__("easeInOutSine",THEME_ADMIN_DOMAIN),
				'easeInExpo'=>__("easeInExpo",THEME_ADMIN_DOMAIN),
				'easeOutExpo'=>__("easeOutExpo",THEME_ADMIN_DOMAIN),
				'easeInCirc'=>__("easeInCirc",THEME_ADMIN_DOMAIN),
				'easeOutCirc'=>__("easeOutCirc",THEME_ADMIN_DOMAIN),
				'easeInOutCirc'=>__("easeInOutCirc",THEME_ADMIN_DOMAIN),
				'easeInElastic'=>__("easeInElastic",THEME_ADMIN_DOMAIN),
				'easeOutElastic'=>__("easeOutElastic",THEME_ADMIN_DOMAIN),
				'easeInOutSine'=>__("easeInOutSine",THEME_ADMIN_DOMAIN),
				'easeInBack'=>__("easeInBack",THEME_ADMIN_DOMAIN),
				'easeOutBack'=>__("easeOutBack",THEME_ADMIN_DOMAIN),
				'easeInOutBack'=>__("easeInOutBack",THEME_ADMIN_DOMAIN),
				'easeInBounce'=>__("easeInBounce",THEME_ADMIN_DOMAIN),
				'easeOutBounce'=>__("easeOutBounce",THEME_ADMIN_DOMAIN),
				'easeInOutBounce'=>__("easeInOutBounce",THEME_ADMIN_DOMAIN),
			),
		),
		array(
			"name" => __("Animation Speed",THEME_ADMIN_DOMAIN),
			"desc" => __("Define the duration of the animations.",THEME_ADMIN_DOMAIN),
			"id" => "animatespeed",
			"min" => "200",
			"max" => "10000",
			"step" => "100",
			'unit' => 'miliseconds',
			"default" => "500",
			"type" => "range"
		),
		array(
			"name" => __("Pause Time",THEME_ADMIN_DOMAIN),
			"desc" => __("Define the delay which each slide will have to wait to be played",THEME_ADMIN_DOMAIN),
			"id" => "pausetime",
			"min" => "1000",
			"max" => "50000",
			"step" => "500",
			"unit" => 'miliseconds',
			"default" => "3000",
			"type" => "range"
		),
		array(
			"name" => __("Pause On Hover",THEME_ADMIN_DOMAIN),
			"desc" => __("If you want stop animation while hovering, turn on the button.",THEME_ADMIN_DOMAIN),
			"id" => "pauseonhover",
			"default" => true,
			"type" => "toggle"
		),
		array(
			"name" => __("Css Code",THEME_ADMIN_DOMAIN),
			"id" => "style",
			"default" => "",
			"type" => "textarea"
		),
	),
);
