Project

General

Profile

« Previous | Next » 

Revision 110

Added by stefan about 19 years ago

Created new table "modules" to allow for faster lookup of which modules are installed. Allows for greater flexibility also.

View differences:

trunk/wb/install/save.php
360 360
	// Search table
361 361
	$search = "DROP TABLE IF EXISTS `".TABLE_PREFIX."search`";
362 362
	$database->query($search);
363
			
364

  
365

  
363
	// Modules table
364
	$modules = "DROP TABLE IF EXISTS `".TABLE_PREFIX."modules`";
365
	$database->query($modules);
366
				
366 367
	// Try installing tables
367 368
	
368 369
	// Pages table
......
492 493
	        . ' ';
493 494
	$database->query($search);
494 495
	
496
	// Modules table
497
	$modules = 'CREATE TABLE `'.TABLE_PREFIX.'modules` ( '
498
	.'`id` INT NOT NULL auto_increment ,'
499
	.'`name` VARCHAR( 255 ) NOT NULL ,'
500
	.'`type` VARCHAR( 255 ) NOT NULL ,'
501
	.'`directory` VARCHAR( 255 ) NOT NULL ,'
502
	.' PRIMARY KEY ( `id` ) ); ';
503
	
504
	$database->query($modules);
505

  
506
	$search = 'CREATE TABLE `'.TABLE_PREFIX.'modules` ( '
507
	        . ' `name` VARCHAR( 255 ) NOT NULL ,'
508
	        . ' `type` VARCHAR( 255 ) NOT NULL ,'
509
	        . ' PRIMARY KEY ( `name` ) )'
510
	        . ' ';
511
	$database->query($search);
512

  
513

  
495 514
	// Insert default data
496 515
	
497 516
	// Admin group
trunk/wb/languages/EN.php
477 477
$MESSAGE['PAGES']['REORDERED'] = 'Page re-ordered successfully';
478 478
$MESSAGE['PAGES']['CANNOT_REORDER'] = 'Error re-ordering page';
479 479
$MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS'] = 'You do not have permissions to modify this page';
480
$MESSAGE['PAGES']['INTRO_NOT_WRITABLE'] = 'Cannot write to file /pages/intro.php (insufficient priviliges)';
480
$MESSAGE['PAGES']['INTRO_NOT_WRITABLE'] = 'Cannot write to file /pages/intro.php (insufficient privileges)';
481 481
$MESSAGE['PAGES']['INTRO_SAVED'] = 'Intro page saved successfully';
482 482
$MESSAGE['PAGES']['LAST_MODIFIED'] = 'Last modification by';
483 483
$MESSAGE['PAGES']['INTRO_LINK'] = 'Click HERE to modify the intro page';
......
493 493
$MESSAGE['GENERIC']['CANNOT_UNINSTALL'] = 'Cannot uninstall';
494 494
$MESSAGE['GENERIC']['CANNOT_UNZIP'] = 'Cannot unzip file';
495 495
$MESSAGE['GENERIC']['INSTALLED'] = 'Installed successfully';
496
$MESSAGE['GENERIC']['INSTALLED'] = 'Upgraded successfully';
496
$MESSAGE['GENERIC']['UPGRADED'] = 'Upgraded successfully';
497 497
$MESSAGE['GENERIC']['UNINSTALLED'] = 'Uninstalled successfully';
498 498
$MESSAGE['GENERIC']['BAD_PERMISSIONS'] = 'Unable to write to the target directory';
499 499
$MESSAGE['GENERIC']['INVALID'] = 'The file you uploaded is invalid';
trunk/wb/admin/modules/install.php
114 114
	}
115 115
}
116 116

  
117

  
118

  
117 119
// Run the modules install // upgrade script if there is one
118 120
if(file_exists(WB_PATH.'/modules/'.$module_directory.'/'.$action.'.php')) {
119 121
	require(WB_PATH.'/modules/'.$module_directory.'/'.$action.'.php');
......
122 124
// Print success message
123 125
if ($action=="install") {
124 126
	$admin->print_success($MESSAGE['GENERIC']['INSTALLED']);
127
	$settings_rows=	"INSERT INTO `".TABLE_PREFIX."modules` VALUES "
128
	." ('', '".$module_name."', '".$module_type."', '".$module_directory."');";
129
	$database->query($settings_rows);
125 130
} else if ($action=="upgrade") {
126 131
	$admin->print_success($MESSAGE['GENERIC']['UPGRADED']);
127 132
}	

Also available in: Unified diff