-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·65 lines (59 loc) · 1.89 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require_once 'init.php';
$theme = $ini['general']['theme'];
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
$public = in_array($class, $ini['permission']['public_classes']);
// AdiantiCoreApplication::setRouter(array('AdiantiRouteTranslator', 'translate'));
new TSession;
ApplicationTranslator::setLanguage( TSession::getValue('user_language'), true );
if ( TSession::getValue('logged') )
{
if (isset($_REQUEST['template']) AND $_REQUEST['template'] == 'iframe')
{
$content = file_get_contents("app/templates/{$theme}/iframe.html");
}
else
{
$content = file_get_contents("app/templates/{$theme}/layout.html");
$menu = AdiantiMenuBuilder::parse('menu.xml', $theme);
$content = str_replace('{MENU}', $menu, $content);
}
}
else
{
if (isset($ini['general']['public_view']) && $ini['general']['public_view'] == '1')
{
$content = file_get_contents("app/templates/{$theme}/public.html");
$menu = AdiantiMenuBuilder::parse('menu-public.xml', $theme);
$content = str_replace('{MENU}', $menu, $content);
}
else
{
$content = file_get_contents("app/templates/{$theme}/login.html");
}
}
$content = ApplicationTranslator::translateTemplate($content);
$content = AdiantiTemplateParser::parse($content);
echo $content;
if (TSession::getValue('logged') OR $public)
{
if ($class)
{
$method = isset($_REQUEST['method']) ? $_REQUEST['method'] : NULL;
AdiantiCoreApplication::loadPage($class, $method, $_REQUEST);
}
}
else
{
if (isset($ini['general']['public_view']) && $ini['general']['public_view'] == '1')
{
if (!empty($ini['general']['public_entry']))
{
AdiantiCoreApplication::loadPage($ini['general']['public_entry'], '', $_REQUEST);
}
}
else
{
AdiantiCoreApplication::loadPage('LoginForm', '', $_REQUEST);
}
}