<?php
/**
* @package frea-framework
* @subpackage Template
*
* @copyright 2009 frea-framework
* @author Dawid Kraczkowski hide@address.com
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
*/
class Template_Dom_Namespace_Import extends Template_Dom_Namespace
{
public function insertBefore()
{
$currentpath = $this->node->ownerDocument()->getFileInfo();
$path = $currentpath['dirname'];
if($this->node->hasAttribute("file"))
{
$path = $path.DIRECTORY_SEPARATOR.$this->node->getAttribute("file");
if(!is_readable($path))
throw new Template_Exception("File {$path} is not readable, given in file {$currentpath['dirname']}/{$currentpath['basename']} on line {$this->starttagLine} ");
return "<?php Template::import(\"".$path."\");?>";
}
else
{
throw new Template_Dom_Namespace_Exception("Tag ui:import requires file attribute");
}
}
public function insertAfter()
{
}
}