<?php
ini_set('display_errors','1');
error_reporting (E_ALL);
session_start();
setlocale (LC_ALL, 'de_DE');
header('Content-Type: text/html; charset=utf-8');
include('backend.php');

if (empty($module)) $module = 'login';

if (isset($_SESSION['backend'][$session_name]) && $_SESSION['backend'][$session_name]){	
	preg_match("/(.*)_modules/i", $module, $modules_key);
	preg_match("/(.*)_options/i", $module, $options_key);
	preg_match("/(.*)_labels/i", $module, $labels_module_key);

	if (isset($modules_key[1])) {
		include('modules_filter.php');
	} else if (isset($options_key[1])) {
		include('options.php');
	} else if (isset($backend_module) && isset($labels_module_key[1]) && is_file('modules/'.$backend_module.'/'.$labels_module_key[1].'_labels_filter.php')) {
		include('modules/'.$backend_module.'/'.$labels_module_key[1].'_labels_filter.php');
	} else if (isset($labels_module_key[1]) && is_file('labels_filter.php')) {
		include('labels_filter.php');
	} else if (isset($backend_module) && is_file('modules/'.$backend_module.'/'.$module.'_filter.php')) {
		include('modules/'.$backend_module.'/'.$module.'_filter.php');
	}
}
?>
