Project

General

Profile

« Previous | Next » 

Revision 934

Added by doc almost 16 years ago

Added option to invoke module install.php from backend (for modules uploaded via FTP)

View differences:

index.php
44 44
	}
45 45
}
46 46

  
47
// Insert modules which includes a install.php file to install list
48
$template->set_block('main_block', 'install_list_block', 'install_list');
49
$module_files = glob(WB_PATH . '/modules/*');
50
foreach ($module_files as $index => $path) {
51
	if (is_dir($path) && file_exists($path . '/install.php')) {
52
		$template->set_var('VALUE', basename($path));
53
		$template->set_var('NAME', basename($path));
54
		$template->parse('install_list', 'install_list_block', true);
55
	} else {
56
		unset($module_files[$index]);
57
	}
58
}
59

  
47 60
// Insert permissions values
48 61
if($admin->get_permission('modules_install') != true) {
49 62
	$template->set_var('DISPLAY_INSTALL', 'hide');
......
54 67
if($admin->get_permission('modules_view') != true) {
55 68
	$template->set_var('DISPLAY_LIST', 'hide');
56 69
}
70
// only show if at least one module folder contains a install.php file and permissions to admin section exists
71
if(count($module_files) == 0 || !isset($_GET['advanced']) || $admin->get_permission('admintools') != true) {
72
	$template->set_var('DISPLAY_MANUAL_INSTALL', 'hide');
73
}
57 74

  
58 75
// Insert language headings
59 76
$template->set_var(array(
60 77
								'HEADING_INSTALL_MODULE' => $HEADING['INSTALL_MODULE'],
61 78
								'HEADING_UNINSTALL_MODULE' => $HEADING['UNINSTALL_MODULE'],
62
								'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
79
								'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS'],
80
								'HEADING_MANUAL_MODULE_INSTALLATION' => $HEADING['MANUAL_MODULE_INSTALLATION']
63 81
								)
64 82
						);
65 83
// Insert language text and messages
......
68 86
		'<a href="' . ADMIN_URL . '/templates/index.php">' . $MENU['TEMPLATES'] . '</a>' : '',
69 87
	'URL_LANGUAGES' => $admin->get_permission('languages') ? 
70 88
		'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '',
89
	'URL_ADVANCED' => $admin->get_permission('admintools') ? 
90
		'<a href="' . ADMIN_URL . '/modules/index.php?advanced">' . $TEXT['ADVANCED'] . '</a>' : '',
71 91
	'TEXT_INSTALL' => $TEXT['INSTALL'],
72 92
	'TEXT_UNINSTALL' => $TEXT['UNINSTALL'],
73 93
	'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'],
74
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT']
94
	'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
95
	'TEXT_MANUAL_INSTALLATION' => $MESSAGE['ADDON']['MANUAL_INSTALLATION'],
96
	'TEXT_MANUAL_INSTALLATION_WARNING' => $MESSAGE['ADDON']['MANUAL_INSTALLATION_WARNING'],
97
	'TEXT_RELOAD' => $TEXT['RELOAD']
75 98
	)
76 99
);
77 100

  

Also available in: Unified diff