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


class CWidgetsWidgetPageTitle extends CWidget {

	/**
	* description
	*
	* @var type
	*
	* @access type
	*/
	var $meta = array(
		"type"	=> "1",
		"name"	=> "Page Title",
		"module"	=> array(
			"name"	=> "",
			"id"	=> "",
			"type"	=> "",
		)
	);

	

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function Render($widget) {

		$set = array(
			"set_title_align"			=> "set_title_align",
			"set_subtitle_align"		=> "set_subtitle_align",
			"set_title_valign"			=> "set_title_valign",
			"set_subtitle_valign"		=> "set_subtitle_valign",

			"set_title_size"			=> "set_title_size",
			"set_title_size_lg"			=> "set_title_size_lg",
			"set_title_size_md"			=> "set_title_size_md",
			"set_title_size_sm"			=> "set_title_size_sm",
			"set_title_size_xs"			=> "set_title_size_xs",

			"set_subtitle_size"			=> "set_subtitle_size",
			"set_subtitle_size_lg"		=> "set_subtitle_size_lg",
			"set_subtitle_size_md"		=> "set_subtitle_size_md",
			"set_subtitle_size_sm"		=> "set_subtitle_size_sm",
			"set_subtitle_size_xs"		=> "set_subtitle_size_xs",

			"set_pt_css"				=> "set_pt_css",
			"set_pt_css_title"			=> "set_pt_css_title",
			"set_pt_css_subtitle"		=> "set_pt_css_subtitle",

			"set_pt_path_align"		=> "set_pt_path_align",

		);
		//prepare settings

		foreach ($set as $key => $val) {
			if (!$widget["settings"][$key]) {
				$set[$key] = $this->module->vars->data[$val];
			} else {
				$set[$key] = $widget["settings"][$key];
			}
		}

		return $this->tpl->blockReplace(
			"Main" , 
			array(
				"title"		=> $widget["settings"]["lang_title"],
				"subtitle"	=> $widget["settings"]["lang_title"] ? 
					$this->tpl->BlockReplace(
						"Subtitle",
						array(
							"header"	=> $widget["settings"]["lang_title"]
						)
					)  : "",

				"module_id"	=> $widget["mod_id"] ? $widget["mod_id"]  : $widget["module_code"] ,
			),
			$set
		);
	}
	
}


?>