Project

General

Profile

1 536 doc
<?php
2
3 548 Ruebenwurz
// $Id$
4 536 doc
5
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8 915 Ruebenwurz
 Copyright (C) 2004-2009, Ryan Djurovich
9 536 doc
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
require('../../config.php');
27
require_once(WB_PATH.'/framework/class.admin.php');
28
$admin = new admin('admintools', 'admintools');
29
30
// Include the WB functions file
31
require_once(WB_PATH.'/framework/functions.php');
32
33
// Create new template object
34 944 Ruebenwurz
$template = new Template(THEME_PATH.'/templates');
35
$template->set_file('page', 'admintools.htt');
36 536 doc
$template->set_block('page', 'main_block', 'main');
37
38
// Insert required template variables
39
$template->set_var('ADMIN_URL', ADMIN_URL);
40 944 Ruebenwurz
$template->set_var('THEME_URL', THEME_URL);
41 536 doc
$template->set_var('HEADING_ADMINISTRATION_TOOLS', $HEADING['ADMINISTRATION_TOOLS']);
42
43
// Insert tools into tool list
44
$template->set_block('main_block', 'tool_list_block', 'tool_list');
45 887 aldus
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' order by name");
46 536 doc
if($results->numRows() > 0) {
47
	while($tool = $results->fetchRow()) {
48
		$template->set_var('TOOL_NAME', $tool['name']);
49
		$template->set_var('TOOL_DIR', $tool['directory']);
50 587 doc
		// check if a module description exists for the displayed backend language
51
		$tool_description = false;
52
		if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
53
			// read contents of the module language file into string
54
			$data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php');
55
			$tool_description = get_variable_content('module_description', $data, true, false);
56
		}
57
		$template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description);
58 536 doc
		$template->parse('tool_list', 'tool_list_block', true);
59
	}
60
} else {
61
	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);
62
}
63
64
// Parse template objects output
65
$template->parse('main', 'main_block', false);
66
$template->pparse('output', 'page');
67
68
$admin->print_footer();
69
70
?>