author | cavaliet@caf4f556-3d62-0410-8435-a86758001935 |
Fri, 21 Aug 2009 16:26:26 +0000 | |
branch | drupal |
changeset 74 | 0ff3ba646492 |
permissions | -rw-r--r-- |
74
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
1 |
<?php |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
2 |
// $Id: fckeditor.install,v 1.2.2.25 2009/02/16 11:58:52 wwalc Exp $ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
3 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
4 |
/* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
5 |
* FCKeditor - The text editor for Internet - http://www.fckeditor.net |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
6 |
* Copyright (C) 2003-2008 Frederico Caldeira Knabben |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
7 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
8 |
* == BEGIN LICENSE == |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
9 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
10 |
* Licensed under the terms of any of the following licenses at your |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
11 |
* choice: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
12 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
13 |
* - GNU General Public License Version 2 or later (the "GPL") |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
14 |
* http://www.gnu.org/licenses/gpl.html |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
15 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
16 |
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
17 |
* http://www.gnu.org/licenses/lgpl.html |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
18 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
19 |
* - Mozilla Public License Version 1.1 or later (the "MPL") |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
20 |
* http://www.mozilla.org/MPL/MPL-1.1.html |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
21 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
22 |
* == END LICENSE == |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
23 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
24 |
* @file |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
25 |
* Implementation of hook_install() |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
26 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
27 |
* This will automatically install the database tables for the FCKeditor module for both the MySQL and PostgreSQL databases. |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
28 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
29 |
* If you are using another database, you will have to install the tables by hand, using the queries below as a reference. |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
30 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
31 |
* Note that the curly braces around table names are a drupal-specific feature to allow for automatic database table prefixing, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
32 |
* and will need to be removed. |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
33 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
34 |
*/ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
35 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
36 |
function fckeditor_install() { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
37 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
38 |
drupal_install_schema('fckeditor'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
39 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
40 |
//create two default roles based on previous settings |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
41 |
db_query("INSERT INTO {fckeditor_role} (name, rid) VALUES ('%s', %d)", |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
42 |
"Default", defined('DRUPAL_ANONYMOUS_RID') ? DRUPAL_ANONYMOUS_RID : 1); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
43 |
db_query("INSERT INTO {fckeditor_role} (name, rid) VALUES ('%s', %d)", |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
44 |
"Advanced", defined('DRUPAL_AUTHENTICATED_RID') ? DRUPAL_AUTHENTICATED_RID : 2); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
45 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
46 |
//insert settings for default role |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
47 |
$arr = array(); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
48 |
$arr['allow_user_conf'] = "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
49 |
$arr['min_rows'] = variable_get('fckeditor_minimum_rows', 1); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
50 |
$arr['excl_mode'] = variable_get('fckeditor_exclude_toggle', 0); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
51 |
$arr['filebrowser'] = 'none'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
52 |
$arr['quickupload'] = 'f'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
53 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
54 |
//appearance |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
55 |
$arr['default'] = "t"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
56 |
$arr['show_toggle'] = "t"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
57 |
$arr['popup'] = variable_get('fckeditor_popup', 0) ? "t" : "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
58 |
$arr['skin'] = "default"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
59 |
$arr['toolbar'] = variable_get('fckeditor_default_toolbar', 'DrupalBasic'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
60 |
$arr['expand'] = variable_get('fckeditor_toolbar_start_expanded', 1) ? "t" : "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
61 |
$arr['width'] = variable_get("fckeditor_width", "100%"); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
62 |
$arr['lang'] = "en"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
63 |
$arr['auto_lang'] = "t"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
64 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
65 |
//output |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
66 |
$arr['enter_mode'] = "p"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
67 |
$arr['shift_enter_mode'] = "br"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
68 |
$arr['font_format'] = 'p;div;pre;address;h1;h2;h3;h4;h5;h6'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
69 |
$arr['format_source'] = "t"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
70 |
$arr['format_output'] = "t"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
71 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
72 |
//security |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
73 |
$arr['ss'] = "2"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
74 |
$arr['filters']['filter/0'] = 1; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
75 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
76 |
//css |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
77 |
$arr['css_mode'] = "theme"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
78 |
$arr['css_path'] = variable_get("fckeditor_stylesheet", ""); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
79 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
80 |
//upload |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
81 |
//get permissions here like in _update_role_permissions |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
82 |
$arr['upload_basic'] = variable_get("fckeditor_upload_basic", 0) ? "t" : "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
83 |
$arr['upload_advanced'] = variable_get('fckeditor_upload_advanced', 0) ? "t" : "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
84 |
$arr['user_choose'] = "f"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
85 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
86 |
db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", "Default", serialize($arr)); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
87 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
88 |
//insert settings for advanced role |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
89 |
$arr['toolbar'] = variable_get('fckeditor_advanced_toolbar', 'DrupalFiltered'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
90 |
db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", "Advanced", serialize($arr)); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
91 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
92 |
$arr = array(); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
93 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
94 |
//exclude by default some known textareas where HTML is not expected |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
95 |
//edit-recipients //contact module |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
96 |
//edit-reply //contact module |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
97 |
//edit-description //taxonomy module |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
98 |
//edit-synonyms //taxonomy module |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
99 |
//edit-img-assist-textareas //img assist module |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
100 |
$arr['excl_mode'] = 0; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
101 |
$arr['excl_fields'] = variable_get("fckeditor_exclude", |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
102 |
"edit-user-mail-welcome-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
103 |
"edit-user-mail-admin-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
104 |
"edit-user-mail-approval-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
105 |
"edit-user-mail-pass-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
106 |
"edit-user-mail-register-admin-created-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
107 |
"edit-user-mail-register-no-approval-required-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
108 |
"edit-user-mail-register-pending-approval-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
109 |
"edit-user-mail-password-reset-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
110 |
"edit-user-mail-status-activated-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
111 |
"edit-user-mail-status-blocked-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
112 |
"edit-user-mail-status-deleted-body\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
113 |
"edit-pages\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
114 |
"edit-pathauto-ignore-words\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
115 |
"edit-recipients\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
116 |
"edit-reply\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
117 |
"edit-description\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
118 |
"edit-synonyms\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
119 |
"edit-img-assist-textareas\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
120 |
"edit-img-assist-paths\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
121 |
"edit-nodewords-description\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
122 |
"edit-relatedlinks-fieldset-relatedlinks\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
123 |
"edit-allowed-values-php\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
124 |
"edit-allowed-values\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
125 |
"edit-update-notify-emails\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
126 |
"edit-googleanalytics-pages\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
127 |
"edit-googleanalytics-codesnippet-before\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
128 |
"edit-googleanalytics-codesnippet-after\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
129 |
"edit-piwik-pages\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
130 |
"edit-piwik-codesnippet\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
131 |
"edit-feedburner-useragents\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
132 |
"edit-webform-*\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
133 |
"edit-target\n" |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
134 |
); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
135 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
136 |
$arr['excl_paths'] = "admin/*/logintoboggan\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
137 |
"admin/settings/actions/configure/*\n"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
138 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
139 |
//force by default simple toolbar on selected textareas |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
140 |
$arr['simple_incl_mode'] = 1; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
141 |
$arr['simple_incl_fields'] = |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
142 |
"edit-signature\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
143 |
"edit-site-mission\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
144 |
"edit-site-footer\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
145 |
"edit-site-offline-message\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
146 |
"edit-page-help\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
147 |
"edit-user-registration-help\n". |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
148 |
"edit-user-picture-guidelines\n"; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
149 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
150 |
db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", "FCKeditor Global Profile", serialize($arr)); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
151 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
152 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
153 |
/** |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
154 |
* Implementation of hook_schema(). |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
155 |
*/ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
156 |
function fckeditor_schema() { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
157 |
$schema['fckeditor_settings'] = array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
158 |
'description' => 'Stores FCKeditor profile settings', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
159 |
'fields' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
160 |
'name' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
161 |
'type' => 'varchar', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
162 |
'not null' => TRUE, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
163 |
'default' => '', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
164 |
'length' => 128, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
165 |
'description' => 'Name of the FCKeditor profile', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
166 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
167 |
'settings' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
168 |
'type' => 'text', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
169 |
'description' => 'Profile settings', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
170 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
171 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
172 |
'primary key' => array('name'), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
173 |
); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
174 |
$schema['fckeditor_role'] = array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
175 |
'description' => 'Stores FCKeditor profile assignments', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
176 |
'fields' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
177 |
'name' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
178 |
'type' => 'varchar', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
179 |
'not null' => TRUE, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
180 |
'default' => '', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
181 |
'length' => 128, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
182 |
'description' => 'Name of the FCKeditor role', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
183 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
184 |
'rid' => array( |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
185 |
'type' => 'int', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
186 |
'not null' => TRUE, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
187 |
'default' => 0, |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
188 |
'description' => 'Drupal role id', |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
189 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
190 |
), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
191 |
'primary key' => array('name', 'rid'), |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
192 |
); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
193 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
194 |
return $schema; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
195 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
196 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
197 |
/** |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
198 |
* Update from 6.x-1.0 to 6.x-1.1 |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
199 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
200 |
*/ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
201 |
function fckeditor_update_6110() { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
202 |
$ret = array(); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
203 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
204 |
$result = db_query('SELECT * FROM {fckeditor_settings}'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
205 |
$global_profile_found = FALSE; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
206 |
while ($data = db_fetch_object($result)) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
207 |
if ($data->name == "FCKeditor Global Profile") { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
208 |
$global_profile_found = TRUE; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
209 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
210 |
if ($data->settings) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
211 |
$settings = unserialize($data->settings); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
212 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
213 |
if (isset($settings['excl_mode'], $settings['excl_list']) && !empty($settings['excl_list'])) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
214 |
switch ($settings['excl_mode']) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
215 |
case 0: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
216 |
// normal exclusion based on the id |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
217 |
$settings['excl_fields'] = $settings['excl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
218 |
$settings['excl_mode'] = 0; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
219 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
220 |
case 1: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
221 |
//normal inclusion based on the id |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
222 |
$settings['excl_fields'] = $settings['excl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
223 |
$settings['excl_mode'] = 1; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
224 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
225 |
case 2: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
226 |
//path exclusion |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
227 |
$settings['excl_paths'] = $settings['excl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
228 |
$settings['excl_mode'] = 0; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
229 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
230 |
case 3: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
231 |
//path inclusion |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
232 |
$settings['excl_paths'] = $settings['excl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
233 |
$settings['excl_mode'] = 1; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
234 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
235 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
236 |
unset($settings['excl_list']); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
237 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
238 |
if (isset($settings['simple_incl_mode'], $settings['simple_incl_list']) && !empty($settings['simple_incl_list'])) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
239 |
switch ($settings['simple_incl_mode']) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
240 |
case 1: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
241 |
//normal inclusion based on the id |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
242 |
$settings['simple_incl_fields'] = $settings['simple_incl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
243 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
244 |
case 3: |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
245 |
//path inclusion |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
246 |
$settings['simple_incl_paths'] = $settings['simple_incl_list']; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
247 |
break; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
248 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
249 |
unset($settings['simple_incl_mode']); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
250 |
unset($settings['simple_incl_list']); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
251 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
252 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
253 |
db_query("UPDATE {fckeditor_settings} SET settings='%s' WHERE name='%s'", serialize($settings), $data->name); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
254 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
255 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
256 |
if (!$global_profile_found) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
257 |
db_query("INSERT INTO {fckeditor_settings} (name, settings) VALUES ('%s', '%s')", "FCKeditor Global Profile", serialize(array())); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
258 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
259 |
return $ret; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
260 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
261 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
262 |
/** |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
263 |
* Update from 6.x-1.2 to 6.x-1.3 |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
264 |
* |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
265 |
*/ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
266 |
function fckeditor_update_6130() { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
267 |
$ret = array(); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
268 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
269 |
$result = db_query("SELECT * FROM {fckeditor_settings} WHERE name <> 'FCKeditor Global Profile'"); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
270 |
$hasimce = module_exists('imce'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
271 |
while (($data = db_fetch_object($result))) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
272 |
if ($data->settings) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
273 |
$settings = unserialize($data->settings); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
274 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
275 |
// Rewrite imce, upload_basic and upload_advanced settings to filebrowser and quickupload |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
276 |
$imce = ($hasimce && isset($settings['imce']) && $settings['imce'] == 't'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
277 |
$upload_basic = (isset($settings['upload_basic']) && $settings['upload_basic'] == 't'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
278 |
$upload_advanced = (isset($settings['upload_advanced']) && $settings['upload_advanced'] == 't'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
279 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
280 |
if ($imce) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
281 |
$settings['filebrowser'] = 'imce'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
282 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
283 |
elseif ($upload_advanced) { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
284 |
$settings['filebrowser'] = 'builtin'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
285 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
286 |
else { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
287 |
$settings['filebrowser'] = 'none'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
288 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
289 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
290 |
$settings['quickupload'] = $upload_basic ? 't' : 'f'; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
291 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
292 |
unset($settings['imce'], $settings['upload_basic'], $settings['upload_advanced']); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
293 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
294 |
// unfortunately, update_sql is not an option, as serialize($settings) will contain curly braces which will |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
295 |
// be replaced. update_sql does not support arguments like db_query() does. |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
296 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
297 |
db_query("UPDATE {fckeditor_settings} SET settings='%s' WHERE name='%s'", serialize($settings), $data->name); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
298 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
299 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
300 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
301 |
return $ret; |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
302 |
} |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
303 |
|
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
304 |
/** |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
305 |
* Implementation of hook_uninstall() |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
306 |
*/ |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
307 |
function fckeditor_uninstall() { |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
308 |
drupal_uninstall_schema('fckeditor'); |
0ff3ba646492
Create branch for drupal with first commit from local working copy
cavaliet@caf4f556-3d62-0410-8435-a86758001935
parents:
diff
changeset
|
309 |
} |