mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Wiki module, copied from contrib/wiki.
I've left out stuff that didn't seem necessary ... including a lot of the Wiki plugins which were quote large... I'm not sure if this is currently working ... I'm about to try it out.
This commit is contained in:
parent
fdd1eee7e6
commit
39fcb981b8
55 changed files with 16941 additions and 0 deletions
44
mod/wiki/db/mysql.php
Normal file
44
mod/wiki/db/mysql.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?PHP
|
||||
|
||||
function wiki_upgrade($oldversion) {
|
||||
/// This function does anything necessary to upgrade
|
||||
/// older versions to match current functionality
|
||||
|
||||
global $CFG;
|
||||
|
||||
if ($oldversion < 2004040200) {
|
||||
execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` DROP `allowstudentstowiki`');
|
||||
}
|
||||
|
||||
if ($oldversion < 2004040700) {
|
||||
execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` CHANGE `ewikiallowsafehtml` `htmlmode` TINYINT( 4 ) DEFAULT \'0\' NOT NULL');
|
||||
}
|
||||
|
||||
if ($oldversion < 2004042100) {
|
||||
execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `pagename` VARCHAR( 255 ) AFTER `summary`');
|
||||
execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki_entries` CHANGE `name` `pagename` VARCHAR( 255 ) NOT NULL');
|
||||
if ($wikis = get_records('wiki')) {
|
||||
foreach ($wikis as $wiki) {
|
||||
if (empty($wiki->pagename)) {
|
||||
set_field('wiki', 'pagename', $wiki->name, 'id', $wiki->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2004053100) {
|
||||
execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` CHANGE `initialcontent` `initialcontent` VARCHAR( 255 ) DEFAULT NULL');
|
||||
// Remove obsolete 'initialcontent' values.
|
||||
if ($wikis = get_records('wiki')) {
|
||||
foreach ($wikis as $wiki) {
|
||||
if (!empty($wiki->initialcontent)) {
|
||||
set_field('wiki', 'initialcontent', null, 'id', $wiki->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
54
mod/wiki/db/mysql.sql
Normal file
54
mod/wiki/db/mysql.sql
Normal file
|
@ -0,0 +1,54 @@
|
|||
# This file contains a complete database schema for all the
|
||||
# tables used by this module, written in SQL
|
||||
|
||||
# It may also contain INSERT statements for particular data
|
||||
# that may be used, especially new entries in the table log_display
|
||||
|
||||
|
||||
CREATE TABLE `prefix_wiki` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`course` int(10) unsigned NOT NULL default '0',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`summary` text NOT NULL,
|
||||
`pagename` varchar(255) default NULL,
|
||||
`wtype` enum('teacher','group','student') NOT NULL default 'group',
|
||||
`ewikiprinttitle` tinyint(4) NOT NULL default '1',
|
||||
`htmlmode` tinyint(4) NOT NULL default '0',
|
||||
`ewikiacceptbinary` tinyint(4) NOT NULL default '0',
|
||||
`initialcontent` varchar(255) default NULL,
|
||||
`timemodified` int(10) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM COMMENT='Main wiki table';
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Table structure for table `mdl_wiki_entries`
|
||||
#
|
||||
|
||||
CREATE TABLE `prefix_wiki_entries` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`wikiid` int(10) NOT NULL default '0',
|
||||
`course` int(10) NOT NULL default '0',
|
||||
`groupid` int(10) NOT NULL default '0',
|
||||
`userid` int(10) NOT NULL default '0',
|
||||
`pagename` varchar(255) NOT NULL default '',
|
||||
`timemodified` int(10) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=MyISAM COMMENT='Holds entries for each wiki start instance.';
|
||||
|
||||
|
||||
CREATE TABLE `prefix_wiki_pages` (
|
||||
`pagename` VARCHAR(160) NOT NULL,
|
||||
`version` INTEGER UNSIGNED NOT NULL DEFAULT 0,
|
||||
`flags` INTEGER UNSIGNED DEFAULT 0,
|
||||
`content` MEDIUMTEXT,
|
||||
`author` VARCHAR(100) DEFAULT 'ewiki',
|
||||
`created` INTEGER UNSIGNED DEFAULT 0,
|
||||
`lastmodified` INTEGER UNSIGNED DEFAULT 0,
|
||||
`refs` MEDIUMTEXT,
|
||||
`meta` MEDIUMTEXT,
|
||||
`hits` INTEGER UNSIGNED DEFAULT 0,
|
||||
`wiki` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY id (pagename, version, wiki)
|
||||
) TYPE=MyISAM COMMENT='Holds the Wiki-Pages';
|
Loading…
Add table
Add a link
Reference in a new issue