Project

General

Profile

1 4 ryan
<?php
2
3 277 stefan
// $Id$
4 4 ryan
5
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8 915 Ruebenwurz
 Copyright (C) 2004-2009, Ryan Djurovich
9 4 ryan
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 1353 FrankH
	$code = '';
32 4 ryan
} else {
33
	$code = $_POST['code'];
34
}
35
36 1353 FrankH
// fix secunia 2010-93-2
37
if (!preg_match('/^[A-Z]{2}$/', $code)) {
38
	header("Location: index.php");
39
	exit(0);
40
}
41
42 4 ryan
// Check if the language exists
43
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
44
	header("Location: index.php");
45 286 stefan
	exit(0);
46 4 ryan
}
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 944 Ruebenwurz
$template = new Template(THEME_PATH.'/templates');
54
$template->set_file('page', 'languages_details.htt');
55 4 ryan
$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 1112 Ruebenwurz
								'DESIGNED_FOR' => $language_platform,
65
								'ADMIN_URL' => ADMIN_URL,
66
								'WB_URL' => WB_URL,
67
								'WB_PATH' => WB_PATH,
68
								'THEME_URL' => THEME_URL
69 4 ryan
								)
70
						);
71
72
// Restore language to original code
73
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
74
75
// Insert language headings
76
$template->set_var(array(
77
								'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
78
								)
79
						);
80
// Insert language text and messages
81
$template->set_var(array(
82
								'TEXT_CODE' => $TEXT['CODE'],
83
								'TEXT_NAME' => $TEXT['NAME'],
84
								'TEXT_TYPE' => $TEXT['TYPE'],
85
								'TEXT_AUTHOR' => $TEXT['AUTHOR'],
86
								'TEXT_VERSION' => $TEXT['VERSION'],
87 277 stefan
								'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
88
								'TEXT_BACK' => $TEXT['BACK']
89 4 ryan
								)
90
						);
91
92
// Parse language object
93
$template->parse('main', 'main_block', false);
94
$template->pparse('output', 'page');
95
96
// Print admin footer
97
$admin->print_footer();
98
99
?>