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: index.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/index.php $
|
14
|
* @lastmodified $Date: 2011-11-25 06:03:32 +0100 (Fri, 25 Nov 2011) $
|
15
|
* @description
|
16
|
*
|
17
|
*/
|
18
|
|
19
|
// Print admin header
|
20
|
require('../../config.php');
|
21
|
require_once(WB_PATH.'/framework/class.admin.php');
|
22
|
$admin = new admin('Addons', 'languages');
|
23
|
|
24
|
// Setup template object, parse vars to it, then parse it
|
25
|
$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('languages.htt'));
|
26
|
// Create new template object
|
27
|
$template = new Template($ThemePath);
|
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_list_block', 'language_list');
|
34
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
|
35
|
if($result->numRows() > 0) {
|
36
|
while($addon = $result->fetchRow()) {
|
37
|
$template->set_var('VALUE', $addon['directory']);
|
38
|
$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
|
39
|
$template->parse('language_list', 'language_list_block', true);
|
40
|
}
|
41
|
}
|
42
|
|
43
|
// Insert permissions values
|
44
|
if($admin->get_permission('languages_install') != true) {
|
45
|
$template->set_var('DISPLAY_INSTALL', 'hide');
|
46
|
}
|
47
|
if($admin->get_permission('languages_uninstall') != true) {
|
48
|
$template->set_var('DISPLAY_UNINSTALL', 'hide');
|
49
|
}
|
50
|
if($admin->get_permission('languages_view') != true) {
|
51
|
$template->set_var('DISPLAY_LIST', 'hide');
|
52
|
}
|
53
|
|
54
|
// Insert language headings
|
55
|
$template->set_var(array(
|
56
|
'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'],
|
57
|
'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'],
|
58
|
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
|
59
|
)
|
60
|
);
|
61
|
// insert urls
|
62
|
$template->set_var(array(
|
63
|
'ADMIN_URL' => ADMIN_URL,
|
64
|
'WB_URL' => WB_URL,
|
65
|
'THEME_URL' => THEME_URL,
|
66
|
'FTAN' => $admin->getFTAN()
|
67
|
)
|
68
|
);
|
69
|
// Insert language text and messages
|
70
|
$template->set_var(array(
|
71
|
'URL_MODULES' => $admin->get_permission('modules') ?
|
72
|
'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
|
73
|
'URL_ADVANCED' => '          ',
|
74
|
'URL_TEMPLATES' => $admin->get_permission('templates') ?
|
75
|
'<a href="' . ADMIN_URL . '/templates/index.php">' . $MENU['TEMPLATES'] . '</a>' : '',
|
76
|
'TEXT_INSTALL' => $TEXT['INSTALL'],
|
77
|
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
|
78
|
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
|
79
|
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
|
80
|
)
|
81
|
);
|
82
|
|
83
|
// Parse template object
|
84
|
$template->parse('main', 'main_block', false);
|
85
|
$template->pparse('output', 'page');
|
86
|
|
87
|
// Print admin footer
|
88
|
$admin->print_footer();
|