This repository has been archived by the owner on May 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
/
menu.php
136 lines (120 loc) · 3.72 KB
/
menu.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
if (!@ob_start("ob_gzhandler")) @ob_start();
include_once ('./inc/header.php');
include ('./inc/template.php');
$lang_old=$config['language'];
$config_refresh='';
// define template
$tpl=new MSDTemplate();
$tpl->set_filenames(array(
'header' => 'tpl/menu/header.tpl',
'footer' => 'tpl/menu/footer.tpl',
'content' => 'tpl/menu/content.tpl'));
$tpl->assign_vars(array(
'MSD_VERSION' => MSD_VERSION,
'CONFIG_HOMEPAGE' => $config['homepage'],
'CONFIG_THEME' => $config['theme']));
if (isset($_POST['selected_config'])||isset($_GET['config']))
{
if (isset($_POST['selected_config'])) $new_config=$_POST['selected_config'];
// Configuration was switched in content frame?
if (isset($_GET['config'])) $new_config=$_GET['config'];
// restore the last active menuitem
if (is_readable($config['paths']['config'].$new_config.'.php'))
{
clearstatcache();
unset($databases);
$databases=array();
if (read_config($new_config))
{
$config['config_file']=$new_config;
$_SESSION['config_file']=$new_config; //$config['config_file'];
$config_refresh='
<script language="JavaScript" type="text/javascript">
if (parent.MySQL_Dumper_content.location.href.indexOf("config_overview.php")!=-1)
{
var selected_div=parent.MySQL_Dumper_content.document.getElementById("sel").value;
}
else selected_div=\'\';
parent.MySQL_Dumper_content.location.href=\'config_overview.php?config='.urlencode($new_config).'&sel=\'+selected_div</script>';
}
if (isset($_GET['config'])) $config_refresh=''; //Neu-Aufruf bei Uebergabe aus Content-Bereich verhindern
}
}
echo MSDHeader(1);
echo headline('',0);
if ($config_refresh>'')
{
$tpl->assign_block_vars('CONFIG_REFRESH_TRUE',array());
$tpl->assign_var('CONFIG_REFRESH',$config_refresh);
}
// changed language
if ($config['language']!=$lang_old)
{
$tpl->assign_block_vars('CHANGED_LANGUAGE',array());
}
if (isset($_GET['action']))
{
if ($_GET['action']=='dbrefresh')
{
// remember the name of the selected database
$old_dbname=isset($databases['Name'][$databases['db_selected_index']]) ? $databases['Name'][$databases['db_selected_index']] : '';
SetDefault();
// select old database if it still is there
SelectDB($old_dbname);
$tpl->assign_block_vars('DB_REFRESH',array());
}
}
if (isset($_POST['dbindex']))
{
$dbindex=intval($_POST['dbindex']);
$databases['db_selected_index']=$dbindex;
$databases['db_actual']=$databases['Name'][$dbindex];
SelectDB($dbindex);
WriteParams(0);
$tpl->assign_block_vars('DB_REFRESH',array());
}
else
$dbindex=0;
if (isset($_GET['dbindex']))
{
$dbindex=intval($_GET['dbindex']);
$databases['db_selected_index']=$dbindex;
$databases['db_actual']=$databases['Name'][$dbindex];
SelectDB($dbindex);
WriteParams(0);
}
if (isset($databases['Name'])&&count($databases['Name'])>0)
{
$tpl->assign_block_vars('MAINTENANCE',array());
$tpl->assign_vars(array(
'DB_ACTUAL' => $databases['db_actual'],
'DB_SELECTED_INDEX' => $databases['db_selected_index']));
}
$tpl->assign_var('GET_FILELIST',get_config_filelist());
if (isset($databases['Name'])&&count($databases['Name'])>0)
{
$tpl->assign_block_vars('DB_LIST',array());
$datenbanken=count($databases['Name']);
for ($i=0; $i<$datenbanken; $i++)
{
$selected=($i==$databases['db_selected_index']) ? ' selected' : '';
$tpl->assign_block_vars('DB_LIST.DB_ROW',array(
'ID' => $i,
'NAME' => $databases['Name'][$i],
'SELECTED' => $selected));
}
}
else
$tpl->assign_block_vars('NO_DB_FOUND',array());
$tpl->assign_var('PIC_CACHE',PicCache());
if (!isset($databases['Name'])||count($databases['Name'])<1)
{
$tpl->assign_block_vars('DB_NAME_TRUE',array());
}
else
$tpl->assign_block_vars('DB_NAME_FALSE',array());
$tpl->pparse('header');
$tpl->pparse('content');
$tpl->pparse('footer');
ob_end_flush();