-
Notifications
You must be signed in to change notification settings - Fork 1
/
monograph.install
193 lines (172 loc) · 5.87 KB
/
monograph.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
/*
@TODO for (type)project (field)downloads we need a files/downloads directory created
@TODO generate needs looking at for collections (it fails badly)
@TODO if we're in a subprofile we could create the correct terms
@TODO remove author and date meta from project content type (Display author and date information.)
@TODO look at pathauto configuration
*/
function monograph_install() {
include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
standard_install();
// Set some variables
$acme_settings = array(
'image_jpeg_quality' => '90',
);
foreach ($acme_settings as $v_name => $v_value) {
variable_set($v_name, $v_value);
}
date_default_timezone_set("Australia/Sydney");
// make the downloads directory as devel generate can't
drupal_mkdir("public://downloads");
_monograph_dummy_content();
// install some modules to make the following work
// $result = module_enable(array("shortcuts", "media", "monograph_projects", "monograph_media"));
// _monograph_configure_wysiwyg();
// moved to features
// _monograph_configure_shortcuts();
// disable comments - we can't disable it in .info as that causes standard_install to fail
// module_disable(array("comments"));
// Enable the admin theme.
/*
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'seven')
->execute();
variable_set('admin_theme', 'seven');
variable_set('node_admin_theme', '1');
*/
// Any themes without keys here will get numeric keys and so will be enabled,
// but not placed into variables.
/*
$enable = array(
'theme_default' => 'bartik',
'admin_theme' => 'seven',
);
theme_enable($enable);
foreach ($enable as $var => $theme) {
if (!is_numeric($var)) {
variable_set($var, $theme);
}
}
*/
// disbale the default theme
// theme_disable(array('bartik'));
}
function _monograph_dummy_content() {
// create project_types
// create properties
// create projects
}
// moved to features
function _monograph_configure_shortcuts() {
$set = shortcut_set_load(st('Default'));
$set->links[] = array('link_path' => 'admin/content/file', 'link_title' => st('Media library'));
$set->links[] = array('link_path' => 'node/add/project', 'link_title' => st('Add project'));
shortcut_set_save($set);
}
function _monograph_configure_wysiwyg() {
//WYSIWYG Setup
foreach (array('filtered_html','full_html') as $f) {
$wysiwyg_setting = array (
'default' => 1,
'user_choose' => 0,
'show_toggle' => 1,
'theme' => 'advanced',
'language' => 'en',
'wysiwyg_buttons' => array (
'default' => array (
'Bold' => 1,
'Italic' => 1,
'Underline' => 0,
'Strike' => 0,
'JustifyLeft' => 0,
'JustifyCenter' => 0,
'JustifyRight' => 0,
'JustifyBlock' => 0,
'BulletedList' => 0,
'NumberedList' => 0,
'Outdent' => 0,
'Indent' => 0,
'Undo' => 0,
'Redo' => 0,
'Link' => 1,
'Unlink' => 1,
'Anchor' => 0,
'Image' => 0,
'TextColor' => 0,
'BGColor' => 0,
'Superscript' => 0,
'Subscript' => 0,
'Blockquote' => 1,
'Source' => 0,
'HorizontalRule' => 0,
'Cut' => 0,
'Copy' => 0,
'Paste' => 0,
'PasteText' => 0,
'PasteFromWord' => 0,
'ShowBlocks' => 1,
'RemoveFormat' => 0,
'SpecialChar' => 1,
'About' => 0,
'Format' => 0,
'Font' => 0,
'FontSize' => 0,
'Styles' => 0,
'Table' => 0,
'Find' => 0,
'Replace' => 0,
'SelectAll' => 0,
'Flash' => 0,
'Smiley' => 0,
'Maximize' => 0, // doesn't work with admin toolbar
'SpellChecker' => 0,
'Scayt' => 0,
),
'drupal' => array (
'media' => 1,
'break' => 0,
),
),
'toolbar_loc' => 'top',
'toolbar_align' => 'left',
'path_loc' => 'bottom',
'resizing' => 1,
'verify_html' => 1,
'preformatted' => 0,
'convert_fonts_to_spans' => 1,
'remove_linebreaks' => 1,
'apply_source_formatting' => 0,
'paste_auto_cleanup_on_paste' => 0,
// 'block_formats' => 'p,address,pre,h2,h3,h4,h5,h6,div',
'block_formats' => 'p,h3,h4',
'css_setting' => 'theme',
'css_path' => '',
'css_classes' => '',
'buttons' => array (
'default' => array (
'Bold' => 1,
'Italic' => 1,
'Link' => 1,
'Unlink' => 1,
'Blockquote' => 1,
'SpecialChar' => 1,
'Maximize' => 0, // doesn't work with admin toolbar
'ShowBlocks' => 1,
),
'drupal' => array (
'media' => 0,
),
),
);
db_merge('wysiwyg')
->key(array('format' => $f))
->fields(array(
'editor' => 'ckeditor',
'settings' => serialize($wysiwyg_setting),
))
->execute();
}
}