1
|
<?php
|
2
|
|
3
|
// $Id: index.php 1035 2009-07-06 22:34:35Z Ruebenwurzel $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2009, Ryan Djurovich
|
9
|
|
10
|
Website Baker is free software; you can redistribute it and/or modify
|
11
|
it under the terms of the GNU General Public License as published by
|
12
|
the Free Software Foundation; either version 2 of the License, or
|
13
|
(at your option) any later version.
|
14
|
|
15
|
Website Baker is distributed in the hope that it will be useful,
|
16
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
GNU General Public License for more details.
|
19
|
|
20
|
You should have received a copy of the GNU General Public License
|
21
|
along with Website Baker; if not, write to the Free Software
|
22
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23
|
|
24
|
*/
|
25
|
|
26
|
// Print admin header
|
27
|
require('../../config.php');
|
28
|
require_once(WB_PATH.'/framework/class.admin.php');
|
29
|
$admin = new admin('Addons', 'languages');
|
30
|
|
31
|
// Setup template object
|
32
|
$template = new Template(THEME_PATH.'/templates');
|
33
|
$template->set_file('page', 'languages.htt');
|
34
|
$template->set_block('page', 'main_block', 'main');
|
35
|
|
36
|
// Insert values into language list
|
37
|
$template->set_block('main_block', 'language_list_block', 'language_list');
|
38
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
|
39
|
if($result->numRows() > 0) {
|
40
|
while($addon = $result->fetchRow()) {
|
41
|
$template->set_var('VALUE', $addon['directory']);
|
42
|
$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
|
43
|
$template->parse('language_list', 'language_list_block', true);
|
44
|
}
|
45
|
}
|
46
|
|
47
|
// Insert permissions values
|
48
|
if($admin->get_permission('languages_install') != true) {
|
49
|
$template->set_var('DISPLAY_INSTALL', 'hide');
|
50
|
}
|
51
|
if($admin->get_permission('languages_uninstall') != true) {
|
52
|
$template->set_var('DISPLAY_UNINSTALL', 'hide');
|
53
|
}
|
54
|
if($admin->get_permission('languages_view') != true) {
|
55
|
$template->set_var('DISPLAY_LIST', 'hide');
|
56
|
}
|
57
|
|
58
|
// Insert language headings
|
59
|
$template->set_var(array(
|
60
|
'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'],
|
61
|
'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'],
|
62
|
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
|
63
|
)
|
64
|
);
|
65
|
// Insert language text and messages
|
66
|
$template->set_var(array(
|
67
|
'URL_MODULES' => $admin->get_permission('modules') ?
|
68
|
'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
|
69
|
'URL_ADVANCED' => $admin->get_permission('admintools') ?
|
70
|
'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
|
71
|
'URL_TEMPLATES' => $admin->get_permission('templates') ?
|
72
|
'<a href="' . ADMIN_URL . '/templates/index.php">' . $MENU['TEMPLATES'] . '</a>' : '',
|
73
|
'TEXT_INSTALL' => $TEXT['INSTALL'],
|
74
|
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
|
75
|
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
|
76
|
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
|
77
|
)
|
78
|
);
|
79
|
|
80
|
// Parse template object
|
81
|
$template->parse('main', 'main_block', false);
|
82
|
$template->pparse('output', 'page');
|
83
|
|
84
|
// Print admin footer
|
85
|
$admin->print_footer();
|
86
|
|
87
|
?>
|