<?php
/**
* LayerSlider v5.1.2 - Responsive Slideshow Module http://layerslider.webshopworks.com
*
*  @author    WebshopWorks <info@webshopworks.com>
*  @copyright 2015 WebshopWorks
*  @license   One Domain Licence
*/

if (!defined('_PS_VERSION_'))
	exit;

function lsGetSkins()
{
	$skins = array_map('basename', glob(LS_ROOT_PATH.'/static/skins/*', GLOB_ONLYDIR));
	$ret = array();

	foreach ($skins as $key => $skin)
	{
		if ($skin == 'preview')
			continue;

		$ret[$key]['folder'] = $ret[$key]['name'] = $skin;

		if (file_exists(LS_IMG_PATH.'/skins/'.$skin.'/screenshot.jpg'))
			$ret[$key]['screenshot'] = LS_IMG_PATH.'/skins/'.$skin.'/screenshot.jpg';

		if (file_exists(LS_ROOT_PATH.'/static/skins/'.$skin.'/info.json'))
		{
			$ret[$key]['info'] = Tools::jsonDecode(Tools::file_get_contents(LS_ROOT_PATH.'/static/skins/'.$skin.'/info.json'), true);
			$ret[$key]['name'] = $ret[$key]['info']['name'];
		}
	}

	return $ret;
}

?>
