Project

General

Profile

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 1625 2012-02-29 00:50:57Z Luisehahne $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/languages/index.php $
14
 * @lastmodified    $Date: 2012-02-29 01:50:57 +0100 (Wed, 29 Feb 2012) $
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
// Create new template object
26
$template = new Template(dirname($admin->correct_theme_source('languages.htt')));
27
// $template->debug = true;
28
$template->set_file('page', 'languages.htt');
29
$template->set_block('page', 'main_block', 'main');
30

    
31
// Insert values into language list
32
$template->set_block('main_block', 'language_list_block', 'language_list');
33
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
34
if($result->numRows() > 0) {
35
	while($addon = $result->fetchRow()) {
36
		$template->set_var('VALUE', $addon['directory']);
37
		$template->set_var('NAME', $addon['name'].' ('.$addon['directory'].')');
38
		$template->parse('language_list', 'language_list_block', true);
39
	}
40
}
41

    
42
// Insert permissions values
43
if($admin->get_permission('languages_install') != true) {
44
	$template->set_var('DISPLAY_INSTALL', 'hide');
45
}
46
if($admin->get_permission('languages_uninstall') != true) {
47
	$template->set_var('DISPLAY_UNINSTALL', 'hide');
48
}
49
if($admin->get_permission('languages_view') != true) {
50
	$template->set_var('DISPLAY_LIST', 'hide');
51
}
52

    
53
// Insert language headings
54
$template->set_var(array(
55
				'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'],
56
				'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'],
57
				'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS']
58
			)
59
		);
60
// insert urls
61
$template->set_var(array(
62
				'ADMIN_URL' => ADMIN_URL,
63
				'WB_URL' => WB_URL,
64
				'THEME_URL' => THEME_URL,
65
				'FTAN' => $admin->getFTAN()
66
			)
67
		);
68
// Insert language text and messages
69
$template->set_var(array(
70
	'URL_MODULES' => $admin->get_permission('modules') ?
71
		'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
72
	'URL_ADVANCED' => '&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',
73
	'URL_TEMPLATES' => $admin->get_permission('templates') ?
74
		'<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
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
79
	)
80
);
81

    
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();
(2-2/4)