A few minor fixes and formatting changes
[project/tinymce.git] / tinymce.install
CommitLineData
5d1525ad
KR
1<?php
2// $Id$
3
4/**
5 * Implementation of hook_install()
6 *
7 * This will automatically install the database tables for the TinyMCE module for both the MySQL and PostgreSQL databases.
8 *
9 * If you are using another database, you will have to install the tables by hand, using the queries below as a reference.
10 *
11 * Note that the curly braces around table names are a drupal-specific feature to allow for automatic database table prefixing,
12 * and will need to be removed.
13 */
14
15/**
16 * Implementation of hook_install().
17 */
18function tinymce_install() {
19 // Create tables.
20 drupal_install_schema('tinymce');
0ede69b9
KR
21 // Create default profile
22 db_query("INSERT {tinymce_settings} (name, settings) VALUES ('%s', '%s')", 'default profile', 'a:29:{s:8:"old_name";s:15:"default profile";s:4:"name";s:15:"default profile";s:4:"rids";a:1:{i:2;s:1:"2";}s:7:"default";s:4:"true";s:11:"user_choose";s:4:"true";s:11:"show_toggle";s:4:"true";s:5:"theme";s:8:"advanced";s:8:"language";s:2:"en";s:14:"safari_message";s:5:"false";s:6:"access";s:1:"1";s:12:"access_pages";s:25:"node/*
23user/*
24comment/*";s:7:"buttons";a:16:{s:12:"default-bold";s:1:"1";s:14:"default-italic";s:1:"1";s:17:"default-underline";s:1:"1";s:21:"default-strikethrough";s:1:"1";s:19:"default-justifyleft";s:1:"1";s:21:"default-justifycenter";s:1:"1";s:15:"default-bullist";s:1:"1";s:15:"default-numlist";s:1:"1";s:15:"default-outdent";s:1:"1";s:14:"default-indent";s:1:"1";s:12:"default-link";s:1:"1";s:14:"default-unlink";s:1:"1";s:13:"default-image";s:1:"1";s:12:"imagemanager";s:1:"1";s:15:"paste-pastetext";s:1:"1";s:15:"paste-pasteword";s:1:"1";}s:11:"toolbar_loc";s:3:"top";s:13:"toolbar_align";s:4:"left";s:8:"path_loc";s:4:"none";s:8:"resizing";s:5:"false";s:13:"block_formats";s:31:"p,address,pre,h1,h2,h3,h4,h5,h6";s:11:"verify_html";s:5:"false";s:12:"preformatted";s:5:"false";s:22:"convert_fonts_to_spans";s:4:"true";s:17:"remove_linebreaks";s:4:"true";s:23:"apply_source_formatting";s:4:"true";s:11:"css_setting";s:4:"none";s:8:"css_path";s:0:"";s:11:"css_classes";s:0:"";s:2:"op";s:14:"Update profile";s:13:"form_build_id";s:37:"form-21cb07f003badeede590c7987adde76d";s:10:"form_token";s:32:"3170db026d02269919567e1aa7c3818d";s:7:"form_id";s:26:"tinymce_profile_form_build";}');
5d1525ad
KR
25}
26
27function tinymce_update_1() {
28 return _system_update_utf8(array('tinymce_settings', 'tinymce_role'));
29}
30
31/**
32 * Implementation of hook_uninstall()
33 */
34function tinymce_uninstall() {
35 // Remove tables.
36 drupal_uninstall_schema('tinymce');
37}
38
39/**
40 * Implementation of hook_schema().
41 */
42function tinymce_schema() {
43 $schema['tinymce_settings'] = array(
44 'description' => t('-'),
45 'fields' => array(
46 'name' => array(
47 'type' => 'varchar',
48 'length' => 128,
49 'not null' => TRUE,
50 'default' => '',
51 'description' => t("-")
52 ),
53 'settings' => array(
54 'type' => 'text',
55 'size' => 'normal',
56 'description' => t('-')
57 ),
58 ),
59 'primary key' => array('name'),
60 );
61 $schema['tinymce_role'] = array(
62 'description' => t('-'),
63 'fields' => array(
64 'name' => array(
65 'type' => 'varchar',
66 'length' => 128,
67 'not null' => TRUE,
68 'default' => '',
69 'description' => t("-")
70 ),
71 'rid' => array(
72 'type' => 'int',
73 'size' => 'tiny',
74 'unsigned' => TRUE,
75 'not null' => TRUE,
76 'default' => 0,
77 'description' => t('-')
78 ),
79 ),
80 'primary key' => array('name', 'rid'),
81 );
82
83 return $schema;
84}