<?php
/*
	DevSaver Web Framework
	Copyright (c) 2013-2016 DevSaver. 
	All rights reserved.
		web:  www.devsaver.com
		mail: support@devsaver.com				
*/


class CWidgetsWidgetRichTextEditorwCarousel extends CWidget {

	/**
	* description
	*
	* @var type
	*
	* @access type
	*/
	var $meta = array(
		"type"	=> "1",
		"name"	=> "Rich Text Editor Carousel",
		"module"	=> array(
			"name"	=> "",
			"id"	=> "",
			"type"	=> "",
		)
	);

	

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function Render($widget) {
		global $base;
		
		$items = $this->module->GetStaticItems($widget);

		if (!is_array($items)) {
			return "";
		}

		foreach ($items as $key => $val) {

			$items[$key]["link"] =  "";

			$more = $this->plugins["modules"]->BuildLink(array(
				"type"	=> $val["item_link_type"],
				"link"	=> $val["item_link_link"],
				"module"=> $val["item_link_module"],
				"global"=> $val["item_link_global"],
			));

			if ($more) {
				$items[$key]["link"] = $this->tpl->blockReplace(
					"Link" ,
					array(
						"link"	=> $more,
						"size"	=> $val["item_link_size"],
						"target"=> $val["item_link_target"],
						"text"	=> $val["item_link_text"],
						"rel"		=> $val["item_link_rel"],
						"style"		=> $val["item_link_style"],

					)
				);
			}			
		}
		
		return $this->tpl->blockReplace(
			"Main" , 
			array(
				"items"	=> $base->html->table(
					$this->tpl , 
					"",	
					$items,
					$widget["settings"]
				)

			),
			$this->module->WidgetButtons($widget , $this->tpl),
			$widget 
		);

	}
	
}


?>