1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category admin
|
5
|
* @package languages
|
6
|
* @author Ryan Djurovich, WebsiteBaker Project
|
7
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: details.php 1529 2011-11-25 05:03:32Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/languages/details.php $
|
14
|
* @lastmodified $Date: 2011-11-25 06:03:32 +0100 (Fri, 25 Nov 2011) $
|
15
|
* @description
|
16
|
*
|
17
|
*/
|
18
|
|
19
|
// Include the config code
|
20
|
require('../../config.php');
|
21
|
|
22
|
// Print admin header
|
23
|
require_once(WB_PATH.'/framework/class.admin.php');
|
24
|
$admin = new admin('Addons', 'languages_view', false);
|
25
|
if( !$admin->checkFTAN() )
|
26
|
{
|
27
|
$admin->print_header();
|
28
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
29
|
}
|
30
|
// After check print the header
|
31
|
$admin->print_header();
|
32
|
|
33
|
// Get language name
|
34
|
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
35
|
$code = '';
|
36
|
} else {
|
37
|
$code = $_POST['code'];
|
38
|
}
|
39
|
|
40
|
// fix secunia 2010-93-2
|
41
|
if (!preg_match('/^[A-Z]{2}$/', $code)) {
|
42
|
header("Location: index.php");
|
43
|
exit(0);
|
44
|
}
|
45
|
|
46
|
// Check if the language exists
|
47
|
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
|
48
|
header("Location: index.php");
|
49
|
exit(0);
|
50
|
}
|
51
|
|
52
|
// Setup template object, parse vars to it, then parse it
|
53
|
$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('languages_details.htt'));
|
54
|
// Create new template object
|
55
|
$template = new Template($ThemePath);
|
56
|
// $template->debug = true;
|
57
|
$template->set_file('page', 'languages_details.htt');
|
58
|
$template->set_block('page', 'main_block', 'main');
|
59
|
|
60
|
// Insert values
|
61
|
require(WB_PATH.'/languages/'.$code.'.php');
|
62
|
$template->set_var(array(
|
63
|
'CODE' => $language_code,
|
64
|
'NAME' => $language_name,
|
65
|
'AUTHOR' => $language_author,
|
66
|
'VERSION' => $language_version,
|
67
|
'DESIGNED_FOR' => $language_platform,
|
68
|
'ADMIN_URL' => ADMIN_URL,
|
69
|
'WB_URL' => WB_URL,
|
70
|
'THEME_URL' => THEME_URL
|
71
|
)
|
72
|
);
|
73
|
|
74
|
// Restore language to original code
|
75
|
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
|
76
|
|
77
|
// Insert language headings
|
78
|
$template->set_var(array(
|
79
|
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
|
80
|
)
|
81
|
);
|
82
|
// Insert language text and messages
|
83
|
$template->set_var(array(
|
84
|
'TEXT_CODE' => $TEXT['CODE'],
|
85
|
'TEXT_NAME' => $TEXT['NAME'],
|
86
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
87
|
'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
88
|
'TEXT_VERSION' => $TEXT['VERSION'],
|
89
|
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
90
|
'TEXT_BACK' => $TEXT['BACK']
|
91
|
)
|
92
|
);
|
93
|
|
94
|
// Parse language object
|
95
|
$template->parse('main', 'main_block', false);
|
96
|
$template->pparse('output', 'page');
|
97
|
|
98
|
// Print admin footer
|
99
|
$admin->print_footer();
|