Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         admintools
6
 * @author          WB-Project, Werner v.d. Decken
7
 * @copyright       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 1520 2011-11-09 00:12:37Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/admintools/index.php $
14
 * @lastmodified    $Date: 2011-11-09 01:12:37 +0100 (Wed, 09 Nov 2011) $
15
 *
16
 */
17

    
18
require('../../config.php');
19
require_once(WB_PATH.'/framework/class.admin.php');
20
$admin = new admin('admintools', 'admintools');
21

    
22
// Include the WB functions file
23
require_once(WB_PATH.'/framework/functions.php');
24

    
25
// Create new template object
26
$template = new Template(THEME_PATH.'/templates');
27
$template->set_file('page', 'admintools.htt');
28
$template->set_block('page', 'main_block', 'main');
29

    
30
// Insert required template variables
31
$template->set_var('ADMIN_URL', ADMIN_URL);
32
$template->set_var('THEME_URL', THEME_URL);
33
$template->set_var('HEADING_ADMINISTRATION_TOOLS', $HEADING['ADMINISTRATION_TOOLS']);
34

    
35
// Insert tools into tool list
36
$template->set_block('main_block', 'tool_list_block', 'tool_list');
37
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' order by name");
38
if($results->numRows() > 0) {
39
	while($tool = $results->fetchRow()) {
40
		$template->set_var('TOOL_NAME', $tool['name']);
41
		$template->set_var('TOOL_DIR', $tool['directory']);
42
		// check if a module description exists for the displayed backend language
43
		$tool_description = false;
44
		if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
45
			// read contents of the module language file into string
46
			$data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php');
47
			$tool_description = get_variable_content('module_description', $data, true, false);
48
		}		
49
		$template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description);
50
		$template->parse('tool_list', 'tool_list_block', true);
51
	}
52
} else {
53
	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);	
54
}
55

    
56
// Parse template objects output
57
$template->parse('main', 'main_block', false);
58
$template->pparse('output', 'page');
59

    
60
$admin->print_footer();
(1-1/2)