Project

General

Profile

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 1625 2012-02-29 00:50:57Z Luisehahne $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/languages/details.php $
14
 * @lastmodified    $Date: 2012-02-29 01:50:57 +0100 (Wed, 29 Feb 2012) $
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
// Create new template object
54
$template = new Template(dirname($admin->correct_theme_source('languages_details.htt')));
55
// $template->debug = true;
56
$template->set_file('page', 'languages_details.htt');
57
$template->set_block('page', 'main_block', 'main');
58

    
59
// Insert values
60
require(WB_PATH.'/languages/'.$code.'.php');
61
$template->set_var(array(
62
								'CODE' => $language_code,
63
								'NAME' => $language_name,
64
								'AUTHOR' => $language_author,
65
								'VERSION' => $language_version,
66
								'DESIGNED_FOR' => $language_platform,
67
								'ADMIN_URL' => ADMIN_URL,
68
								'WB_URL' => WB_URL,
69
								'THEME_URL' => THEME_URL
70
								)
71
						);
72

    
73
// Restore language to original code
74
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
75

    
76
// Insert language headings
77
$template->set_var(array(
78
								'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
79
								)
80
						);
81
// Insert language text and messages
82
$template->set_var(array(
83
								'TEXT_CODE' => $TEXT['CODE'],
84
								'TEXT_NAME' => $TEXT['NAME'],
85
								'TEXT_TYPE' => $TEXT['TYPE'],
86
								'TEXT_AUTHOR' => $TEXT['AUTHOR'],
87
								'TEXT_VERSION' => $TEXT['VERSION'],
88
								'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
89
								'TEXT_BACK' => $TEXT['BACK']
90
								)
91
						);
92

    
93
// Parse language object
94
$template->parse('main', 'main_block', false);
95
$template->pparse('output', 'page');
96

    
97
// Print admin footer
98
$admin->print_footer();
(1-1/4)