1
|
<?php
|
2
|
|
3
|
// $Id: details.php 1441 2011-04-09 23:04:22Z Luisehahne $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2009, Ryan Djurovich
|
9
|
|
10
|
Website Baker is free software; you can redistribute it and/or modify
|
11
|
it under the terms of the GNU General Public License as published by
|
12
|
the Free Software Foundation; either version 2 of the License, or
|
13
|
(at your option) any later version.
|
14
|
|
15
|
Website Baker is distributed in the hope that it will be useful,
|
16
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
GNU General Public License for more details.
|
19
|
|
20
|
You should have received a copy of the GNU General Public License
|
21
|
along with Website Baker; if not, write to the Free Software
|
22
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23
|
|
24
|
*/
|
25
|
|
26
|
// Include the config code
|
27
|
require('../../config.php');
|
28
|
|
29
|
// Get language name
|
30
|
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
31
|
$code = '';
|
32
|
} else {
|
33
|
$code = $_POST['code'];
|
34
|
}
|
35
|
|
36
|
// fix secunia 2010-93-2
|
37
|
if (!preg_match('/^[A-Z]{2}$/', $code)) {
|
38
|
header("Location: index.php");
|
39
|
exit(0);
|
40
|
}
|
41
|
|
42
|
// Check if the language exists
|
43
|
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
|
44
|
header("Location: index.php");
|
45
|
exit(0);
|
46
|
}
|
47
|
|
48
|
// Print admin header
|
49
|
require_once(WB_PATH.'/framework/class.admin.php');
|
50
|
$admin = new admin('Addons', 'languages_view');
|
51
|
|
52
|
// Setup language object
|
53
|
$template = new Template(THEME_PATH.'/templates');
|
54
|
$template->set_file('page', 'languages_details.htt');
|
55
|
$template->set_block('page', 'main_block', 'main');
|
56
|
|
57
|
// Insert values
|
58
|
require(WB_PATH.'/languages/'.$code.'.php');
|
59
|
$template->set_var(array(
|
60
|
'CODE' => $language_code,
|
61
|
'NAME' => $language_name,
|
62
|
'AUTHOR' => $language_author,
|
63
|
'VERSION' => $language_version,
|
64
|
'DESIGNED_FOR' => $language_platform,
|
65
|
'ADMIN_URL' => ADMIN_URL,
|
66
|
'WB_URL' => WB_URL,
|
67
|
'THEME_URL' => THEME_URL
|
68
|
)
|
69
|
);
|
70
|
|
71
|
// Restore language to original code
|
72
|
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
|
73
|
|
74
|
// Insert language headings
|
75
|
$template->set_var(array(
|
76
|
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
|
77
|
)
|
78
|
);
|
79
|
// Insert language text and messages
|
80
|
$template->set_var(array(
|
81
|
'TEXT_CODE' => $TEXT['CODE'],
|
82
|
'TEXT_NAME' => $TEXT['NAME'],
|
83
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
84
|
'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
85
|
'TEXT_VERSION' => $TEXT['VERSION'],
|
86
|
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
87
|
'TEXT_BACK' => $TEXT['BACK']
|
88
|
)
|
89
|
);
|
90
|
|
91
|
// Parse language object
|
92
|
$template->parse('main', 'main_block', false);
|
93
|
$template->pparse('output', 'page');
|
94
|
|
95
|
// Print admin footer
|
96
|
$admin->print_footer();
|
97
|
|
98
|
?>
|