Project

General

Profile

« Previous | Next » 

Revision 1457

Added by Dietmar almost 13 years ago

Preparing 2.8.2 stable, last tests

View differences:

index.php
1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         admintools
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
 *
17
 */
18

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

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

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

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

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

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

  
61
$admin->print_footer();
62

  
63
?>
1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         admintools
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
 *
17
 */
18

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

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

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

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

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

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

  
61
$admin->print_footer();
64 62

  

Also available in: Unified diff