<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('lang'))
{
	function lang()
	{
		$arglist	= func_get_args();

		if (count($arglist) <= 0)
		{
			return '';
		}

		$CI		=& get_instance();
		$line	= $CI->lang->line($arglist[0]);

		if (!$line) {
			return isset($arglist[1]) ? $arglist[1] : $arglist[0];
		}
		
		unset($arglist[0]);

		if (count($arglist) > 0)
		{
			$line	= vsprintf($line, $arglist);
		}

		return $line;
	}
}
if (!function_exists('mylang')) {
	function mylang($lbl='') {
		global $label;  
   		 return (!empty($label) && !empty($label[$lbl])) ? $label[$lbl] : lang($lbl);
	}
}
if (!function_exists('mytranslang')) {
	function mytranslang($lbl,$var)
	{
		global $label;  
	   	 return (!empty($label) && !empty($label[$lbl])) ? $label[$lbl] : $var;
	}
}
