| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: wymeditor.install,v 1.2 2007/03/13 20:16:08 moxide Exp $
|
| 4 |
|
| 5 |
function wymeditor_install() {
|
| 6 |
switch ($GLOBALS['db_type']) {
|
| 7 |
case 'mysql':
|
| 8 |
case 'mysqli':
|
| 9 |
db_query("CREATE TABLE {wymeditor_containers} (
|
| 10 |
cid smallint(5) unsigned NOT NULL auto_increment,
|
| 11 |
description varchar(255) NOT NULL default '',
|
| 12 |
tagname varchar(255) NOT NULL default '',
|
| 13 |
weight tinyint(4) NOT NULL default '0',
|
| 14 |
PRIMARY KEY (cid)
|
| 15 |
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 16 |
|
| 17 |
db_query("CREATE TABLE {wymeditor_classes} (
|
| 18 |
cid smallint(5) unsigned NOT NULL auto_increment,
|
| 19 |
gid tinyint(3) unsigned NOT NULL default '1',
|
| 20 |
name varchar(255) NOT NULL default '',
|
| 21 |
description varchar(255) NOT NULL default '',
|
| 22 |
allowed varchar(255) NOT NULL default '',
|
| 23 |
incompatible varchar(255) NOT NULL default '',
|
| 24 |
compatible varchar(255) NOT NULL default '',
|
| 25 |
weight tinyint(4) NOT NULL default '0',
|
| 26 |
PRIMARY KEY (cid)
|
| 27 |
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 28 |
|
| 29 |
db_query("CREATE TABLE {wymeditor_profiles} (
|
| 30 |
pid tinyint(3) unsigned NOT NULL auto_increment,
|
| 31 |
name varchar(64) NOT NULL default '',
|
| 32 |
settings text NOT NULL,
|
| 33 |
PRIMARY KEY (pid)
|
| 34 |
) /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 35 |
|
| 36 |
// Insert the sample data
|
| 37 |
// Containers
|
| 38 |
db_query("INSERT INTO {wymeditor_containers} VALUES (1, 'Paragraph', 'P', 0);");
|
| 39 |
db_query("INSERT INTO {wymeditor_containers} VALUES (2, 'Heading 1', 'H1', 0);");
|
| 40 |
db_query("INSERT INTO {wymeditor_containers} VALUES (3, 'Heading 2', 'H2', 0);");
|
| 41 |
db_query("INSERT INTO {wymeditor_containers} VALUES (14, 'Heading 3', 'H3', 0);");
|
| 42 |
db_query("INSERT INTO {wymeditor_containers} VALUES (5, 'Heading 4', 'H4', 0);");
|
| 43 |
db_query("INSERT INTO {wymeditor_containers} VALUES (6, 'Heading 5', 'H5', 0);");
|
| 44 |
db_query("INSERT INTO {wymeditor_containers} VALUES (12, 'Heading 6', 'H6', 0);");
|
| 45 |
db_query("INSERT INTO {wymeditor_containers} VALUES (8, 'Preformatted', 'PRE', 0);");
|
| 46 |
db_query("INSERT INTO {wymeditor_containers} VALUES (9, 'Blockquote', 'BLOCKQUOTE', 0);");
|
| 47 |
|
| 48 |
// Classes
|
| 49 |
db_query("INSERT INTO {wymeditor_classes} VALUES (1, 1, 'hidden-note', 'note (hidden)', '*', '*', '', 0);");
|
| 50 |
db_query("INSERT INTO {wymeditor_classes} VALUES (2, 1, 'date', 'Date', 'P', '*', '', 0);");
|
| 51 |
db_query("INSERT INTO {wymeditor_classes} VALUES (3, 1, 'important', 'Important', 'P', '', '*', 0);");
|
| 52 |
db_query("INSERT INTO {wymeditor_classes} VALUES (4, 1, 'block', 'Side Block', 'P', '', 'important', 0);");
|
| 53 |
db_query("INSERT INTO {wymeditor_classes} VALUES (8, 1, 'border', 'Border', 'IMG', '', '*', 0);");
|
| 54 |
break;
|
| 55 |
case 'pgsql':
|
| 56 |
// TODO : Add pgsql support
|
| 57 |
|
| 58 |
break;
|
| 59 |
}
|
| 60 |
}
|
| 61 |
function wymeditor_update_1() {
|
| 62 |
$ret = array();
|
| 63 |
$ret[] = update_sql("ALTER TABLE {wymeditor_profiles} MODIFY settings text");
|
| 64 |
return $ret;
|
| 65 |
}
|
| 66 |
?>
|