Project

General

Profile

1 238 stefan
<?php
2 1467 Luisehahne
/**
3
 *
4
 * @category        admin
5
 * @package         languages
6 1529 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1712 Luisehahne
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1467 Luisehahne
 * @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$
13
 * @filesource      $HeadURL$
14
 * @lastmodified    $Date$
15
 * @description
16
 *
17
 */
18 238 stefan
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 1529 Luisehahne
// Setup template object, parse vars to it, then parse it
25
// Create new template object
26 1712 Luisehahne
$template = new Template(dirname($admin->correct_theme_source('languages.htt')),'keep');
27 1529 Luisehahne
// $template->debug = true;
28 944 Ruebenwurz
$template->set_file('page', 'languages.htt');
29 238 stefan
$template->set_block('page', 'main_block', 'main');
30 2098 darkviper
$oLang = Translate::getInstance();
31
$oLang->enableAddon('admin\\languages');
32 238 stefan
33
// Insert values into language list
34
$template->set_block('main_block', 'language_list_block', 'language_list');
35 2098 darkviper
/*-- insert all needed vars from language files ----------------------------------------*/
36
$template->set_var($oLang->getLangArray());
37 1435 Luisehahne
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
38 238 stefan
if($result->numRows() > 0) {
39
	while($addon = $result->fetchRow()) {
40
		$template->set_var('VALUE', $addon['directory']);
41
		$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
42
		$template->parse('language_list', 'language_list_block', true);
43
	}
44
}
45
46
// Insert permissions values
47
if($admin->get_permission('languages_install') != true) {
48
	$template->set_var('DISPLAY_INSTALL', 'hide');
49
}
50
if($admin->get_permission('languages_uninstall') != true) {
51
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
52
}
53
if($admin->get_permission('languages_view') != true) {
54
	$template->set_var('DISPLAY_LIST', 'hide');
55
}
56
57 1112 Ruebenwurz
// insert urls
58
$template->set_var(array(
59 1529 Luisehahne
				'ADMIN_URL' => ADMIN_URL,
60
				'WB_URL' => WB_URL,
61
				'THEME_URL' => THEME_URL,
62
				'FTAN' => $admin->getFTAN()
63
			)
64
		);
65 238 stefan
// Insert language text and messages
66
$template->set_var(array(
67 2098 darkviper
	'URL_ADVANCED' => '<b>'.$oLang->TEXT_ADVANCED.'</b>' ,
68 1457 Luisehahne
	'URL_MODULES' => $admin->get_permission('modules') ?
69 2098 darkviper
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $oLang->MENU_MODULES . '</a>' : '<b>'.$oLang->MENU_MODULES.'</b>',
70 1457 Luisehahne
	'URL_TEMPLATES' => $admin->get_permission('templates') ?
71 2098 darkviper
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $oLang->MENU_TEMPLATES . '</a>' : '<b>'.$oLang->MENU_TEMPLATES.'</b>',
72 1712 Luisehahne
	'HEADING_CHANGE_TEMPLATE_NOTICE' => ''
73 928 doc
	)
74
);
75 238 stefan
76
// Parse template object
77
$template->parse('main', 'main_block', false);
78
$template->pparse('output', 'page');
79 2098 darkviper
$oLang->disableAddon();
80 238 stefan
// Print admin footer
81
$admin->print_footer();