-
Notifications
You must be signed in to change notification settings - Fork 3
/
stanford_wysiwyg.install
41 lines (35 loc) · 1.13 KB
/
stanford_wysiwyg.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
*/
/**
* Update content editor and filtered html profiles to use new easy setting.
*/
function stanford_wysiwyg_update_7200() {
$content_editor = wysiwyg_get_profile("content_editor_text_format");
$filtered = wysiwyg_get_profile("filtered_html");
// Check to see that content editor is using easy.
if ($content_editor && $content_editor->settings['css_setting'] !== "easy") {
$content_editor->settings['css_setting'] = "easy";
stanford_wysiwyg_update_save_profile($content_editor);
}
// Check to see that filtered editor is using easy.
if ($filtered && $filtered->settings['css_setting'] !== "easy") {
$filtered->settings['css_setting'] = "easy";
stanford_wysiwyg_update_save_profile($filtered);
}
}
/**
* Saves the given wysiwyg profile.
* @param object $profile A wysiwyg profile.
*/
function stanford_wysiwyg_update_save_profile($profile) {
db_merge('wysiwyg')
->key(array('format' => $profile->format))
->fields(array(
'editor' => $profile->editor,
'settings' => serialize($profile->settings),
))
->execute();
wysiwyg_profile_cache_clear();
}