tinymce.install in TinyMCE 5
Same filename and directory in other branches
File
tinymce.installView source
<?php
/**
* Implementation of hook_install()
*
* This will automatically install the database tables for the TinyMCE module for both the MySQL and PostgreSQL databases.
*
* If you are using another database, you will have to install the tables by hand, using the queries below as a reference.
*
* Note that the curly braces around table names are a drupal-specific feature to allow for automatic database table prefixing,
* and will need to be removed.
*/
function tinymce_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {tinymce_settings} (\n name varchar(128) NOT NULL default '',\n settings text,\n PRIMARY KEY (name)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("CREATE TABLE {tinymce_role} (\n name varchar(128) NOT NULL default '',\n rid tinyint(3) unsigned NOT NULL default '0',\n PRIMARY KEY (name,rid)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {tinymce_settings} (\n name varchar(128) NOT NULL default '',\n settings text,\n PRIMARY KEY (name)\n );");
db_query("CREATE TABLE {tinymce_role} (\n name varchar(128) NOT NULL default '',\n rid smallint NOT NULL default '0',\n PRIMARY KEY (name,rid)\n );");
break;
}
}
function tinymce_update_1() {
return _system_update_utf8(array(
'tinymce_settings',
'tinymce_role',
));
}
/**
* Implementation of hook_uninstall()
*/
function tinymce_uninstall() {
db_query('DROP TABLE {tinymce_settings}');
db_query('DROP TABLE {tinymce_role}');
}
Functions
Name![]() |
Description |
---|---|
tinymce_install | Implementation of hook_install() |
tinymce_uninstall | Implementation of hook_uninstall() |
tinymce_update_1 |