Project

General

Profile

1 238 stefan
<?php
2 1467 Luisehahne
/**
3
 *
4
 * @category        admin
5
 * @package         languages
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link            http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource      $HeadURL$
15
 * @lastmodified    $Date$
16
 * @description
17
 *
18
 */
19 238 stefan
20
// Print admin header
21
require('../../config.php');
22
require_once(WB_PATH.'/framework/class.admin.php');
23
$admin = new admin('Addons', 'languages');
24
25
// Setup template object
26 944 Ruebenwurz
$template = new Template(THEME_PATH.'/templates');
27
$template->set_file('page', 'languages.htt');
28 238 stefan
$template->set_block('page', 'main_block', 'main');
29
30
// Insert values into language list
31
$template->set_block('main_block', 'language_list_block', 'language_list');
32 1435 Luisehahne
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
33 238 stefan
if($result->numRows() > 0) {
34
	while($addon = $result->fetchRow()) {
35
		$template->set_var('VALUE', $addon['directory']);
36
		$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
37
		$template->parse('language_list', 'language_list_block', true);
38
	}
39
}
40
41
// Insert permissions values
42
if($admin->get_permission('languages_install') != true) {
43
	$template->set_var('DISPLAY_INSTALL', 'hide');
44
}
45
if($admin->get_permission('languages_uninstall') != true) {
46
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
47
}
48
if($admin->get_permission('languages_view') != true) {
49
	$template->set_var('DISPLAY_LIST', 'hide');
50
}
51
52
// Insert language headings
53
$template->set_var(array(
54
								'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'],
55
								'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'],
56
								'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
57
								)
58
						);
59 1112 Ruebenwurz
// insert urls
60
$template->set_var(array(
61 1457 Luisehahne
					'ADMIN_URL' => ADMIN_URL,
62
					'WB_URL' => WB_URL,
63
					'THEME_URL' => THEME_URL,
64
					'FTAN' => $admin->getFTAN()
65
				)
66
			);
67 238 stefan
// Insert language text and messages
68
$template->set_var(array(
69 1457 Luisehahne
	'URL_MODULES' => $admin->get_permission('modules') ?
70 928 doc
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
71 1457 Luisehahne
	'URL_ADVANCED' => $admin->get_permission('admintools') ?
72
		'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
73
	'URL_TEMPLATES' => $admin->get_permission('templates') ?
74 928 doc
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $MENU['TEMPLATES'] . '</a>' : '',
75
	'TEXT_INSTALL' => $TEXT['INSTALL'],
76
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
77
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
78 933 doc
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
79 928 doc
	)
80
);
81 238 stefan
82
// Parse template object
83
$template->parse('main', 'main_block', false);
84
$template->pparse('output', 'page');
85
86
// Print admin footer
87
$admin->print_footer();