Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         languages
6
 * @author          WebsiteBaker Project
7
 * @copyright       Ryan Djurovich
8
 * @copyright       WebsiteBaker Org. e.V.
9
 * @link            http://websitebaker.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.3
12
 * @requirements    PHP 5.3.6 and higher
13
 * @version         $Id: details.php 2 2017-07-02 15:14:29Z Manuela $
14
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/branches/main/admin/languages/details.php $
15
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
16
 * @description
17
 *
18
 */
19

    
20
// Include config file and admin class file
21
if ( !defined( 'WB_PATH' ) ){ require( dirname(dirname((__DIR__))).'/config.php' ); }
22
if ( !class_exists('admin', false) ) { require(WB_PATH.'/framework/class.admin.php'); }
23

    
24
$admin = new admin('Addons', 'languages_view', false);
25

    
26
$js_back = ADMIN_URL.'/languages/index.php';
27

    
28
if (!$admin->checkFTAN()){
29
    $admin->print_header();
30
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back );
31
}
32
// After check print the header
33
$admin->print_header();
34
/*
35
// Get language name
36
if(!isset($_POST['code']) OR $_POST['code'] == "") {
37
    $code = '';
38
    $admin->print_error( $MESSAGE['GENERIC_FORGOT_OPTIONS'], $js_back );
39
} else {
40
    $code = preg_replace('/[^a-z0-9_-]/i', "", $_POST['code']);  // fix secunia 2010-92-2
41
}
42
*/
43

    
44
// Get module name
45
    $code = '';
46
    if (!isset($_POST['code']) || $_POST['code'] == false) {
47
        $iAddonId = 0;
48
        $admin->print_error( $MESSAGE['GENERIC_FORGOT_OPTIONS'], $js_back );
49
    } else {
50
        $iAddonId = $admin->checkIDKEY('code',0);
51
    }
52
    if ($iAddonId == 0){
53
        $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back );
54
    }
55

    
56
// Get module directory
57
    $sqlAddons = 'SELECT `directory` FROM `'.TABLE_PREFIX.'addons` '
58
               . 'WHERE `addon_id`='.(int)$iAddonId.' '
59
               . ''.'';
60
    if ($code = $database->get_one($sqlAddons)) {
61
        // fix secunia 2010-93-2
62
        if (!preg_match('/^[A-Z]{2}$/', $code) && $code!='' ) {
63
            $admin->print_error( $MESSAGE['GENERIC_ERROR_OPENING_FILE'], $js_back );
64
        }
65
    }
66

    
67
// Check if the language exists
68
if(!file_exists(WB_PATH.'/languages/'.$code.'.php')) {
69
    $admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED'], $js_back );
70
}
71

    
72
// Setup template object, parse vars to it, then parse it
73
// Create new template object
74
$template = new Template(dirname($admin->correct_theme_source('languages_details.htt')));
75
// $template->debug = true;
76
$template->set_file('page', 'languages_details.htt');
77
$template->set_block('page', 'main_block', 'main');
78

    
79
// Insert values
80
require(WB_PATH.'/languages/'.$code.'.php');
81
$template->set_var(array(
82
                                'CODE' => $language_code,
83
                                'NAME' => $language_name,
84
                                'AUTHOR' => $language_author,
85
                                'VERSION' => $language_version,
86
                                'DESIGNED_FOR' => $language_platform,
87
                                'ADMIN_URL' => ADMIN_URL,
88
                                'WB_URL' => WB_URL,
89
                                'THEME_URL' => THEME_URL
90
                                )
91
                        );
92

    
93
// Restore language to original code
94
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
95

    
96
// Insert language headings
97
$template->set_var(array(
98
                                'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
99
                                )
100
                        );
101
// Insert language text and messages
102
$template->set_var(array(
103
                                'TEXT_CODE' => $TEXT['CODE'],
104
                                'TEXT_NAME' => $TEXT['NAME'],
105
                                'TEXT_TYPE' => $TEXT['TYPE'],
106
                                'TEXT_AUTHOR' => $TEXT['AUTHOR'],
107
                                'TEXT_VERSION' => $TEXT['VERSION'],
108
                                'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
109
                                'TEXT_BACK' => $TEXT['BACK']
110
                                )
111
                        );
112

    
113
// Parse language object
114
$template->parse('main', 'main_block', false);
115
$template->pparse('output', 'page');
116

    
117
// Print admin footer
118
$admin->print_footer();
(1-1/4)