<?php
/*
 * @package Sj K2 Filter
 * @version 1.1.0
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @copyright (c) 2016 YouTech Company. All Rights Reserved.
 * @author YouTech Company http://www.smartaddons.com
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

function SJK2FilterBuildRoute(&$query){
	$segments = array();
	
	if (isset($query['view'])) {
		if($query['view'] != 'itemlist') {
			$segments[] = $query['view'];
		}
		unset($query['view']);
	}
	return $segments;
}

function SJK2FilterParseRoute($segments) {
	$vars = array();
	if(count($segments)) {
		switch($segments[0]) {
			case 'itemlist':
				$vars['view'] = 'itemlist';
				break;
			case 'cron':
				$vars['view'] = 'cron';
				break;

		}
	} else {
		$vars['view'] = 'itemlist';
	}
	return $vars;
}