1 |
4
|
ryan
|
<?php
|
2 |
1467
|
Luisehahne
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category admin
|
5 |
|
|
* @package languages
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
|
|
* @copyright 2004-2009, Ryan Djurovich
|
8 |
|
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
9 |
|
|
* @link http://www.websitebaker2.org/
|
10 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
11 |
|
|
* @platform WebsiteBaker 2.8.x
|
12 |
|
|
* @requirements PHP 5.2.2 and higher
|
13 |
|
|
* @version $Id$
|
14 |
|
|
* @filesource $HeadURL$
|
15 |
|
|
* @lastmodified $Date$
|
16 |
|
|
* @description
|
17 |
|
|
*
|
18 |
|
|
*/
|
19 |
4
|
ryan
|
|
20 |
|
|
// Include the config code
|
21 |
|
|
require('../../config.php');
|
22 |
|
|
|
23 |
1457
|
Luisehahne
|
// Print admin header
|
24 |
|
|
require_once(WB_PATH.'/framework/class.admin.php');
|
25 |
|
|
$admin = new admin('Addons', 'languages_view', false);
|
26 |
|
|
if( !$admin->checkFTAN() )
|
27 |
|
|
{
|
28 |
1467
|
Luisehahne
|
$admin->print_header();
|
29 |
1457
|
Luisehahne
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
|
30 |
|
|
}
|
31 |
|
|
// After check print the header
|
32 |
|
|
$admin->print_header();
|
33 |
|
|
|
34 |
4
|
ryan
|
// Get language name
|
35 |
|
|
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
36 |
1353
|
FrankH
|
$code = '';
|
37 |
4
|
ryan
|
} else {
|
38 |
|
|
$code = $_POST['code'];
|
39 |
|
|
}
|
40 |
|
|
|
41 |
1353
|
FrankH
|
// fix secunia 2010-93-2
|
42 |
|
|
if (!preg_match('/^[A-Z]{2}$/', $code)) {
|
43 |
|
|
header("Location: index.php");
|
44 |
|
|
exit(0);
|
45 |
|
|
}
|
46 |
|
|
|
47 |
4
|
ryan
|
// Check if the language exists
|
48 |
|
|
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
|
49 |
|
|
header("Location: index.php");
|
50 |
286
|
stefan
|
exit(0);
|
51 |
4
|
ryan
|
}
|
52 |
|
|
|
53 |
|
|
// Setup language object
|
54 |
944
|
Ruebenwurz
|
$template = new Template(THEME_PATH.'/templates');
|
55 |
|
|
$template->set_file('page', 'languages_details.htt');
|
56 |
4
|
ryan
|
$template->set_block('page', 'main_block', 'main');
|
57 |
|
|
|
58 |
|
|
// Insert values
|
59 |
|
|
require(WB_PATH.'/languages/'.$code.'.php');
|
60 |
|
|
$template->set_var(array(
|
61 |
|
|
'CODE' => $language_code,
|
62 |
|
|
'NAME' => $language_name,
|
63 |
|
|
'AUTHOR' => $language_author,
|
64 |
|
|
'VERSION' => $language_version,
|
65 |
1112
|
Ruebenwurz
|
'DESIGNED_FOR' => $language_platform,
|
66 |
|
|
'ADMIN_URL' => ADMIN_URL,
|
67 |
|
|
'WB_URL' => WB_URL,
|
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();
|