<?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 ModuleTools
{
	protected static function _assign($key, $var=null)
	{
		if (is_array($key)) Tpl::i()->assign($key);
		else Tpl::i()->assign($key, $var);
	}
	
	protected static function _setTpl($tpl='', $strict=false)
	{
		if ($tpl && !$strict) $tpl.=".tpl";
		if ($tpl) LabCMS::i()->setModuleTemplate($tpl);
		else LabCMS::i()->setModuleTemplate('');
	}
	
	protected static function _debug($var, $module=null, $color=null, $tip=null)
	{
		if (!$module) $module=LabCMS::i()->getModuleName();
		Debug_HackerConsole_Main::out($v, $module, $color, $tip);
	}
	
	protected static function _error($msg, $lang=false)
	{
		LabCMS::i()->error($msg, $lang);
	}
}