<?php

// require_once 'tpl.inc';

class Template_IfDef extends Template
{
	
	function get_vartag_value($vartag)
	{
		$split = explode('|', $vartag, 3);
		
		if (parent::get_vartag_value($split[0])=='{{'.$split[0].'}}')
			return $split[2];
		
		return parent::process(deconvert_tag_chars($split[1]), MAX_DEPTH);
	}
	
	function get_info()
	{
		return array("info"=>"make conditional vartags. <notpl>{{IfDef:%vartag%|%show if defined%|%else%}}</notpl>: if %vartag% is not set, %else% will be displayed", "version"=>"1.2");
	}
}

?>