<?php
class LanguageController extends Zend_Controller_Action
{
    public function switchAction()
    {
    	$referer = '/';
    	if (isset($_SERVER['HTTP_REFERER'])) {
    		$referer = $_SERVER['HTTP_REFERER'];
    	}
    	
    	$lang = $this->_getParam('lang', 'cs');
    	
    	if ($lang != 'cs' && $lang != 'en') $lang = 'cs';
    	
    	
    	$language = new Zend_Session_Namespace('language');
    	$language->lang = $lang;
    	
    	$this->_redirect($referer);
    }  
}