<?
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     function.url2.php
 * Type:     function
 * Name:     link
 * Purpose:  zwraca sformatowany url na potrzeby naszamedycyna.pl
 * -------------------------------------------------------------
 */
function smarty_function_source($params, &$smarty)
{
	$sourceObj = $params['obj'];
	$ret = null;
	if(is_object($sourceObj))
	{
		if($sourceObj->GetName())
		{
			$ret .= '';
		}
		if($sourceObj->GetLink())
		{
			$ret .= '<a href="' . $sourceObj->GetLink() . '" title="' .  $sourceObj->GetName() . '">';
		}
		if($sourceObj->getLogo())
		{
			$ret .= '<img border="0" alt="' .  $sourceObj->GetName() . '" src="' . $sourceObj->GetFullUrl() . '" />';
		}
		else
			$ret .= $sourceObj->getName();
			
		if($sourceObj->GetLink())
		{
			$ret .= '</a>';
		}
		if($sourceObj->GetName())
		{
			$ret .= '';
		}
	}

    return $ret;
}
?>