<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

class Url
{
	private static $classname;
	public static function parse()
	{
		self::_setClass();
		return call_user_func(array(self::$classname, 'parse'));
	}
	
	public static function create($params, $action, $type, $href, $redirect, $token)
	{
		return call_user_func_array(
			array(self::$classname, 'create'), array($params, $action, $type, $href, $redirect, $token)
		);
	}
	
	public static function filter($url)
	{
		return call_user_func(array(self::$classname, 'filter'), $url);
	}
	
	private static function _setClass()
	{
		self::$classname='Url_'.config::get('core.url_type');
		if (!class_exists(self::$classname, false)) {
			include_once LAB_PATH_KERNEL.'/classes/Url/'.config::get('core.url_type').'.php';
		}
		
	}
}