<?php
/**
* Smarty Plugin for slider module
*
* @copyright	The TacmicCMS Project
* @license		http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since		1.0
* @author		Tac Hisaoka <phoenyx@impresscms.de>
* @package		banners
* @version		$Id$
*/

/**
 * construct the html code to display a banner
 *
 * @param array $params
 * @param object $smarty
 * @return string html code for the banner
 */
function smarty_function_owslider($params, &$smarty) {
	static $cache;

	$module = icms::handler("icms_module")->getByDirname('slider');

	// only proceed if banners module is present and active
	if (!is_object($module) || !$module->getVar("isactive")){
		$ans = '
    	<div class="page-slider">
        <div id="carousel-face" class="carousel slide carousel-slider" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators carousel-indicators-frontend">
                <li data-target="#carousel-face" data-slide-to="0" class="active"></li>
            </ol>
            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">
                <!-- First slide -->
                <div class="item carousel-item-one active">
                </div>
            </div>
        </div>
    	</div>';
		return $ans;
  }

	// get the banner for the given position
	//$slider_data_handler = icms_getModuleHandler('slider', $module->getVar("dirname"), 'data');
	//$modid = icms_view_PageBuilder::getPage();

	include_once(XOOPS_ROOT_PATH . '/modules/slider/include/slider.php');
	$myslider = myslider_show();
	return $myslider['ow_ans'];


}
