<?php
ini_set('default_charset','utf-8');
include('../core/core.php');




ini_set("display_errors" ,true);


/**
 * Autoloader klas
 *
 * @param unknown_type $className
 */
spl_autoload_register(function ($className) {
	//echo $className;
	Core::LoadClass($className);
});
Core::Init(PageType::ADMIN);

//$logger = LoggerManager::getLogger(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : __FILE__);
Core::LoadSmarty();
session_start();
$scripts = array();

Registry::Set('javascript', $scripts);

Router::AddRoute('addStructure','Structure/Add', array('controller'=>'StructureController', 'method'=>'Add', 'push' => array('paramStr' => true), 'config'=>array('actionSet'=>array())));
Router::AddRoute('editStructure','Structure/Edit/id/:id', array('controller'=>'StructureController', 'method'=>'Edit', 'push' => array('paramStr' => true), 'config'=>array('actionSet'=>array())));
Router::AddRoute('copyStructure','Structure/Copy/id/:id', array('controller'=>'StructureController', 'method'=>'Copy', 'push' => array('paramStr' => true), 'config'=>array('actionSet'=>array())));
Router::AddRoute('customerEditpl', 'customer/gallery/pl', array('controller'=>'StructureController', 'method'=>'Edit', 'push' => array('id' => 18, 'lang' => 'pl'), 'config'=>array('actionSet'=>array())));
Router::AddRoute('customerEditen', 'customer/gallery/en', array('controller'=>'StructureController', 'method'=>'Edit', 'push' => array('id' => 52, 'lang' => 'en'), 'config'=>array('actionSet'=>array())));
Router::AddRoute('customerEditru', 'customer/gallery/ru', array('controller'=>'StructureController', 'method'=>'Edit', 'push' => array('id' => 30, 'lang' => 'ru'), 'config'=>array('actionSet'=>array())));
Router::AddRoute('customerEditde', 'customer/gallery/de', array('controller'=>'StructureController', 'method'=>'Edit', 'push' => array('id' => 40, 'lang' => 'de'), 'config'=>array('actionSet'=>array())));
//Router::AddRoute('HomeSite','HomeSite', array('controller'=>'SimpleArticle_Index', 'method'=>'Edit', 'push' => array('idArticle' => 3 , 'paramStr' => true), 'config'=>array('actionSet'=>array())));
//Router::AddRoute('SaveStructure','Structure/Save', array('controller'=>'StructureController', 'method'=>'Save', 'push' => array('paramStr' => true), 'config'=>array('actionSet'=>array(array('module'=>'SimpleArticle', 'controller'=>'SimpleArticle_IndexController', 'method'=>'EditStructureAction')))));
//Router::AddRoute('indexStructure','Structure', array('controller'=>'StructureController', 'method'=>'Index', 'push' => array()));



Router::$controllerMethodSeek = false;
Router::$popParamUnpaired = false;
Router::$reverseRoute = true;
Router::$parseLang = false;

if (SessionProxy::GetValue('lang')) {
	Router::$curLang=SessionProxy::GetValue('lang');
	//Utils::ArrayDisplay(Router::$curLang);
	//Router::$curLang = $param['lang'];
}
//Utils::ArrayDisplay($_SESSION);

$front = new FrontController();

$front->SetTitleDelimiter(' - ');
$front->AddTitle('MF.CMS');
$front->AddTitle('Administracja');

$front->FlipTitle();

$front->Dispatch();

Core::Garbage();
?>
