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: index.php 2 2017-07-02 15:14:29Z Manuela $
14
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/trunk/admin/languages/index.php $
15
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
16
 * @description
17
 *
18
 */
19

    
20
// Print admin header
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
$admin = new admin('Addons', 'languages');
24

    
25
// Setup template object, parse vars to it, then parse it
26
// Create new template object
27
$template = new Template(dirname($admin->correct_theme_source('languages.htt')));
28
// $template->debug = true;
29
$template->set_file('page', 'languages.htt');
30
$template->set_block('page', 'main_block', 'main');
31

    
32
// Insert values into language list
33
    $template->set_block('main_block', 'language_detail_block', 'language_detail');
34
    $template->set_block('language_detail_block', 'language_detail_select_block', 'language_detail_select');
35
    $template->set_block('main_block', 'language_uninstall_block', 'language_uninstall');
36
    $template->set_block('language_uninstall_block', 'language_uninstall_select_block', 'language_uninstall_select');
37
    $sql  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` '
38
          . 'WHERE `type` =\'language\''
39
          . 'ORDER BY `directory`';
40
    if($oAddons = $database->query($sql)) {
41
        while($aAddon = $oAddons->fetchRow(MYSQLI_ASSOC)){
42
            if( !$admin->get_permission( $aAddon['directory'], 'language' )) { continue; }
43
            $aAddonIdKey = $admin->getIDKEY($aAddon['addon_id']);
44
            $template->set_var('VALUE', $aAddonIdKey);
45
            $template->set_var('NAME', $aAddon['name'].' ('.$aAddon['directory'].')');
46
            $template->parse('language_detail_select', 'language_detail_select_block', true);
47
        }
48
        $oAddons->rewind();
49
        while($aAddon = $oAddons->fetchRow(MYSQLI_ASSOC)) {
50
            if( !$admin->get_permission( $aAddon['directory'], 'language' )) { continue; }
51
            $aAddonIdKey = $admin->getIDKEY($aAddon['addon_id']);
52
            $template->set_var('VALUE', $aAddonIdKey);
53
            $template->set_var('NAME', $aAddon['name'].' ('.$aAddon['directory'].')');
54
            $template->parse('language_uninstall_select', 'language_uninstall_select_block', true);
55
        }
56
    }
57

    
58
// Insert permissions values
59
$template->set_block('main_block', 'language_install_block', 'language_install');
60
if($admin->get_permission('languages_install') != true) {
61
    $template->set_var('DISPLAY_INSTALL', '');
62
    $template->set_block('language_install', '');
63
} else {
64
    $template->parse('language_install', 'language_install_block', true);
65
}
66
if($admin->get_permission('languages_uninstall') != true) {
67
    $template->set_var('DISPLAY_UNINSTALL', '');
68
    $template->set_block('language_uninstall', '');
69
} else {
70
    $template->parse('language_uninstall', 'language_uninstall_block', true);
71
}
72
if($admin->get_permission('languages_view') != true) {
73
    $template->set_var('DISPLAY_LIST', '');
74
    $template->set_block('language_detail', '');
75
} else {
76
    $template->parse('language_detail', 'language_detail_block', true);
77
}
78

    
79
$template->set_block('main_block', 'addon_template_block', 'addon_template');
80
if($admin->get_permission('templates_view') != true) {
81
    $template->set_block ('addon_template', '');
82
} else {
83
    $template->parse('addon_template', 'addon_template_block', true);
84
}
85

    
86
$template->set_block('main_block', 'addon_module_block', 'addon_module');
87
if($admin->get_permission('modules_view') != true) {
88
    $template->set_block ('addon_module', '');
89
} else {
90
    $template->parse('addon_module', 'addon_module_block', true);
91
}
92

    
93
$template->set_block('main_block', 'addon_language_block', 'addon_language');
94
if($admin->get_permission('admintools') != true) {
95
    $template->set_block ('addon_language', '');
96
} else {
97
    $template->parse('addon_language', 'addon_language_block', true);
98
}
99

    
100
// Insert language headings
101
$template->set_var(array(
102
                'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'],
103
                'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'],
104
                'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
105
            )
106
        );
107
// insert urls
108
$template->set_var(array(
109
                'ADMIN_URL' => ADMIN_URL,
110
                'WB_URL' => WB_URL,
111
                'THEME_URL' => THEME_URL,
112
                'FTAN' => $admin->getFTAN()
113
            )
114
        );
115
// Insert language text and messages
116
$template->set_var(array(
117
    'URL_MODULES' => $admin->get_permission('modules') ? ADMIN_URL . '/modules/index.php' : '#',
118
    'URL_TEMPLATES' => $admin->get_permission('templates') ? ADMIN_URL . '/templates/index.php' : '#',
119
    'URL_ADVANCED' => '&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',
120
    'MENU_MODULES' => $admin->get_permission('modules') ? $MENU['MODULES'] : '&#160;&#160;&#160;',
121
    'MENU_TEMPLATES' => $admin->get_permission('templates') ? $MENU['TEMPLATES'] : '&#160;&#160;&#160;',
122
    'TEXT_INSTALL' => $TEXT['INSTALL'],
123
    'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
124
    'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
125
    'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
126
    )
127
);
128

    
129
// Parse template object
130
$template->parse('main', 'main_block', false);
131
$template->pparse('output', 'page');
132

    
133
// Print admin footer
134
$admin->print_footer();
(2-2/4)