<?php

class XCube_BlockProcedure
{
	function XCube_BlockProcedure()
	{
	}
	
	function execute(&$controller,&$user)
	{
	}
	
	function getId()
	{
	}
	
	function enableCached()
	{
		return true;
	}
	
	/**
	 * Return cache time
	 * @return int
	 */
	function getCacheTime()
	{
		return 0;
	}

	function getTitle()
	{
	}
	
	function getEntryIndex()
	{
	}
	
	function getWeight()
	{
	}
	
	function getTemplateName()
	{
	}

	function hasResult()
	{
	}

	function &getResult()
	{
	}
}

class XCube_LegacyAdaptBlockProcedure extends XCube_BlockProcedure
{
	/**
	 * @access private
	 */
	var $mAdapteeBlockObject;

	var $mResultData;

	function XCube_LegacyAdaptBlockProcedure(&$blockObject)
	{
		$this->mAdapteeBlockObject=&$blockObject;
	}

	function execute(&$controller,&$user)
	{
		$this->mResultData=&$this->mAdapteeBlockObject->buildBlock();
	}
	
	function getId()
	{
		return $this->mAdapteeBlockObject->getVar('bid');
	}
	
	function enableCached()
	{
		return true;
	}
	
	/**
	 * Return cache time
	 * @return int
	 */
	function getCacheTime()
	{
		return $this->mAdapteeBlockObject->getVar('bcachetime');
	}

	function getTitle()
	{
		return $this->mAdapteeBlockObject->getVar('title');
	}
	
	function getEntryIndex()
	{
		return $this->mAdapteeBlockObject->getVar('side');
	}
	
	function getWeight()
	{
		return $this->mAdapteeBlockObject->getVar('weight');
	}
	
	function getTemplateName()
	{
		return $this->mAdapteeBlockObject->getVar('template');
	}
	
	function hasResult()
	{
		return !empty($this->mResultData);
	}
	
	function &getResult()
	{
		return $this->mResultData;
	}
}

?>