mirror of
https://github.com/moodle/moodle.git
synced 2025-02-24 03:53:49 +01:00
Integrated with Moodle: - Install automatically. - Update course->blockinfo for each course at installation time. - Modified course creation to insert into blockinfo field. - Modified restore to insert into blockinfo field. - Admin options (hide, show, delete, config) from admin page. - Lang strings inserted (en only). - Database support to mysql and postgresql (not tested!!). Moodle, backup and block versions updated to 2004041800. Tested with mysql: Install fresh and upgrade from previous. section_activities block renamed to social_activities and created its own lang file to support name "Social Activities". This can be changed at any time. TODO: ===== Support it really in backup/restore. ???? Enjoy!! Ciao :-)
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?PHP //$Id$
|
|
//
|
|
// This file keeps track of upgrades to Moodle's
|
|
// blocks system.
|
|
//
|
|
// Sometimes, changes between versions involve
|
|
// alterations to database structures and other
|
|
// major things that may break installations.
|
|
//
|
|
// The upgrade function in this file will attempt
|
|
// to perform all the necessary actions to upgrade
|
|
// your older installtion to the current version.
|
|
//
|
|
// If there's something it cannot do itself, it
|
|
// will tell you what you need to do.
|
|
//
|
|
// Versions are defined by backup_version.php
|
|
//
|
|
// This file is tailored to MySQL
|
|
|
|
function blocks_upgrade($oldversion=0) {
|
|
|
|
global $CFG;
|
|
|
|
$result = true;
|
|
|
|
if ($oldversion < 2004041000 and $result) {
|
|
$result = execute_sql("CREATE TABLE `{$CFG->prefix}blocks` (
|
|
`id` int(10) unsigned NOT NULL auto_increment,
|
|
`name` varchar(40) NOT NULL default '',
|
|
`version` int(10) NOT NULL default '0',
|
|
`cron` int(10) unsigned NOT NULL default '0',
|
|
`lastcron` int(10) unsigned NOT NULL default '0',
|
|
`visible` tinyint(1) NOT NULL default '1',
|
|
PRIMARY KEY (`id`)
|
|
)
|
|
COMMENT = 'To register and update all the available blocks'");
|
|
}
|
|
|
|
//Finally, return result
|
|
return $result;
|
|
}
|
|
?>
|