Removing translation directories
[project/tinymce.git] / tinymce.install
1 <?php
2
3 /**
4 * Implementation of hook_install()
5 *
6 * This will automatically install the database tables for the TinyMCE module for both the MySQL and PostgreSQL databases.
7 *
8 * If you are using another database, you will have to install the tables by hand, using the queries below as a reference.
9 *
10 * Note that the curly braces around table names are a drupal-specific feature to allow for automatic database table prefixing,
11 * and will need to be removed.
12 */
13 function tinymce_install() {
14 switch ($GLOBALS['db_type']) {
15 case 'mysql':
16 case 'mysqli':
17 db_query("CREATE TABLE {tinymce_settings} (
18 name varchar(128) NOT NULL default '',
19 settings text,
20 PRIMARY KEY (name)
21 ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
22
23 db_query("CREATE TABLE {tinymce_role} (
24 name varchar(128) NOT NULL default '',
25 rid tinyint(3) unsigned NOT NULL default '0',
26 PRIMARY KEY (name,rid)
27 ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
28 break;
29
30 case 'pgsql':
31 db_query("CREATE TABLE {tinymce_settings} (
32 name varchar(128) NOT NULL default '',
33 settings text,
34 PRIMARY KEY (name)
35 );");
36
37 db_query("CREATE TABLE {tinymce_role} (
38 name varchar(128) NOT NULL default '',
39 rid smallint NOT NULL default '0',
40 PRIMARY KEY (name,rid)
41 );");
42 break;
43 }
44 }
45
46 function tinymce_update_1() {
47 return _system_update_utf8(array('tinymce_settings', 'tinymce_role'));
48 }
49
50 /**
51 * Implementation of hook_uninstall()
52 */
53 function tinymce_uninstall() {
54 db_query('DROP TABLE {tinymce_settings}');
55 db_query('DROP TABLE {tinymce_role}');
56 }