<?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
*/

include dirname(__FILE__).'/config.php';

Hook::call('bug_tracker_before');

if (!function_exists('bugTrackerGetFilters')) {
	function bugTrackerGetFilters($order=false)
	{
		$filter=Tpl::i()->tpl_vars['filter']->value;
		if ($filter['order']===$order) {
			$filter['direction']=($filter['direction']==='desc')?'asc':'desc';
		} elseif ($order) {
			$filter['order']=$order;
			$filter['direction']='desc';
		}
		foreach ($filter as $key=>$val) {
			if (!$val) unset($filter[$key]);
		}
		return $filter;
	}
}


$main=Factory::create('bug_tracker.main');

$action='main';
if (isset($_GET['action']) && is_callable(array($main, $_GET['action']))) $action=$_GET['action'];
call_user_func(array($main, $action));

Hook::call('bug_tracker_after');
