Location: PHPKode > scripts > UI Template > ui-template/frea/Template/Dom/Node.php
<?php 
/**
 * UI Dom node class
 *
 * @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
 */
abstract class Template_Dom_Node
{
	//node types
	const UIELEMENT_NODE = 0;
	const ATTRIBUTE_NODE = 1;
	const DOCTYPE_NODE = 2;
	const COMMENT_NODE = 3;
	const TEXT_NODE = 4;
	const XMLDEC = 6;
	const DOCUMENT_NODE = 5;
	
	/**
	 * name of the node
	 *
	 * @var string
	 */
	public $nodeName;
	/**
	 * type of node
	 *
	 * @var int
	 */
	public $nodeType;
	/**
	 * parent node 
	 *
	 * @var Template_Dom_Node
	 */
	protected $parentNode;
	/**
	 * owner document
	 *
	 * @var Template_Dom_Node_Document
	 */
	protected $ownerDocument;
	
	/**
	 * namespacetag
	 *
	 * @var Template_Dom_Namespace
	 */
	public $namespacetag;
	
	/**
	 * disable node from documentwalker
	 *
	 * @var boolean
	 */
	public $disabled;
	
	public $parsedContents;
	/**
	 * return parent node
	 *
	 * @return Template_Dom_Node
	 */
	public function parentNode()
	{
		return $this->parentNode;
	}
	/**
	 * return owner document
	 *
	 * @return Template_Dom_Node_Document
	 */
	public function ownerDocument()
	{
		if($this->ownerDocument)
		{
			return $this->ownerDocument;
		}
		elseif($this->parentNode)
		{
			return $this->parentNode->ownerDocument();
		}
	}
	/**
	 * return node name
	 *
	 * @return string
	 */
	public function nodeName()
	{
		return $this->nodeName;
	}
	/**
	 * sets parent node for current node
	 *
	 * @param Template_Dom_Node $node
	 */
	protected function setParent(Template_Dom_Node &$node)
	{
		$this->parentNode = $node;
	}
	public function onClose(Template_Dom_Parser $parser,Template_Dom_Node $node,$starttagLine=0,$endtagLine=0)
	{
		$clsName = "Template_Dom_Namespace_".ucfirst(str_replace("-","",$node->nodeName()));
		
		if(class_exists($clsName))
		{

				$this->namespacetag = new $clsName($this,$starttagLine,$endtagLine);
				$this->namespacetag->init();
			
		}
		else 
			throw new Template_Dom_Namespace_Exception("Wrong namespace tag {$node->nodeName()} in file {$parser->fileName} on {$parser->cLine} line");
		
	}
	/**
	 * disable node from documentwalker
	 *
	 * @param boolean $disable
	 */
	public function disable($disable = true)
	{
		$this->disabled = $disable;
	}
	public function  nodeType()
	{
		return $this->nodeType;
	}
}
Return current item: UI Template