<?php

	
    	
	
	class LocationView extends BlogTemplatedView
	{

		var $_blogInfo;
		var $_width;
		var $_height;		
		var $_loc;
		
		function LocationView( $blogInfo, $data = Array())
		{
			if( Request::isXHR())
				$template = "location_map";
			else
				$template = "location";

			$this->BlogTemplatedView( $blogInfo, $template, $data );
		}
		
		function setLocation( $loc )
		{
			$this->_loc = $loc;
		}
				
		function setHeight( $height )
		{
			$this->_height = $height;
		}
		
		function setWidth( $width )
		{
			$this->_width = $width;
		}		

		function render()
		{
			// google API key
			$config =& Config::getConfig();
			$this->setValue( "google_maps_api_key", $config->getValue( "google_maps_api_key" ));
			$this->setValue( 'locale', $this->_blogInfo->getLocale());
			
			// Location object
			$this->setValue( 'loc', $this->_loc );
			
			// width and height
			$this->setValue( 'width', $this->_width );
			$this->setValue( 'height', $this->_height );
		
			return(parent::render());
		}		
	}
?>