<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
 * Html helper class.
 *
 *
 * @package    GCB
 * @author     Gurkan Caner Birer
 * @version		0.2
 * @copyright  (c) 2007-2009 GCB
 */
class html extends html_Core {

	/**
	 * Create HTML link anchors with language.
	 *
	 * @param   string  URL or URI string
	 * @param   string  link text
	 * @param   array   HTML anchor attributes
	 * @param   string  non-default protocol, eg: https
	 * @param   boolean option to escape the title that is output
	 * @return  string
	 */
	public static function lanchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL, $escape_title = FALSE)
	{
		$value = gcb::lang($title);
		return parent::anchor($uri, $value, $attributes, $protocol, $escape_title);
	}
	/**
	 * Create multilanguage page links.
	 *
	 * @param   string  URL or URI string
	 * @param   string  link text
	 * @param   array   HTML anchor attributes
	 * @param   string  non-default protocol, eg: https
	 * @param   boolean option to escape the title that is output
	 * @return  string
	 */
	public static function panchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL, $escape_title = FALSE)
	{
		$lang = Session::instance()->get("language");
		if($lang != "tr")
			$uri .= "/".$lang;
		$value = gcb::lang($title);
		return parent::anchor($uri, $value, $attributes, $protocol, $escape_title);
	}
}