Project

General

Profile

« Previous | Next » 

Revision 1812

Added by Dietmar almost 12 years ago

  1. fixed always show "no modul rights" in admintools

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
10 Nov-2012 Build 1812 Dietmar Woellbrink (Luisehahne)
17
# fixed always show "no modul rights" in admintools
16 18
09 Nov-2012 Build 1811 Dietmar Woellbrink (Luisehahne)
17 19
! forgot to upload class.wb.php
18 20
09 Nov-2012 Build 1810 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/skel/themes/htt/admintools.htt
13 13
				{NO_CONTENT}
14 14
			</li>
15 15
		<!-- END tool_list_block -->
16
			{TOOL_LIST}
16
			<li>{TOOL_LIST}</li>
17 17
		</ul>
18 18
	</div>
19 19
<!-- END main_block -->
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1811');
54
if(!defined('REVISION')) define('REVISION', '1812');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/admintools/index.php
15 15
 *
16 16
 */
17 17

  
18
require('../../config.php');
19
require_once(WB_PATH.'/framework/class.admin.php');
18
if(!defined('WB_URL'))
19
{
20
    $config_file = realpath('../../config.php');
21
    if(file_exists($config_file) && !defined('WB_URL'))
22
    {
23
    	require($config_file);
24
    }
25
}
26
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
20 27
$admin = new admin('admintools', 'admintools');
21 28

  
22 29
// Include the WB functions file
......
37 44
// Insert tools into tool list
38 45
$template->set_block('main_block', 'tool_list_block', 'tool_list');
39 46
$template->set_var('TOOL_NAME', '');
40
$template->set_var('tool_list', $TEXT['NONE'].' '.$TEXT['MODULE_PERMISSIONS']);
47
$template->set_var('tool_list', '');
41 48
$template->set_var('TOOL_DIR', '');
42 49
$template->set_var('TOOL_DESCRIPTION', '');
43 50
$template->set_var('NO_CONTENT', '');
44

  
45 51
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool' order by name");
52
$bHasToolRights = false;
46 53
if($results->numRows() > 0) {
47
	while( $tool = $results->fetchRow() ) {
48

  
54
	while( $tool = $results->fetchRow(MYSQL_ASSOC) ) {
55
        $bHasToolRights = false;
49 56
		if( $admin->get_permission($tool['directory'],'module' ) )
50 57
		{
51
			$template->set_var('TOOL_NAME', $tool['name']);
58
            $bHasToolRights = true;
59
		$template->set_var('TOOL_NAME', $tool['name']);
52 60
			$template->set_var('TOOL_DIR', $tool['directory']);
53
// /icons/admintools.png
54
		// check if a module description exists for the displayed backend language
61
	// check if a module description exists for the displayed backend language
55 62
			$tool_description = false;
56 63
			if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) {
57 64
				// read contents of the module language file into string
......
69 76
		}
70 77
	}
71 78

  
72
} else {
73
	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);
74 79
}
75 80

  
76
$template->set_var('TOOL_LIST', '<li>&nbsp;</li>');
81
$template->set_var('TOOL_LIST', ($bHasToolRights==false) ? $TEXT['NONE'].' '.$TEXT['MODULE_PERMISSIONS'] : '&nbsp;');
82

  
83
//template->set_var('TOOL_LIST', '<li>&nbsp;</li>');
77 84
// Parse template objects output
78 85
$template->parse('main', 'main_block', false);
79 86
$template->pparse('output', 'page');

Also available in: Unified diff