1
|
<?php
|
2
|
|
3
|
// vim: filetype=php
|
4
|
|
5
|
/************************************************************
|
6
|
* MODULES *
|
7
|
************************************************************/
|
8
|
function CDM_DataPortal_profile_modules() {
|
9
|
return array (
|
10
|
0 => 'admin_menu',
|
11
|
1 => 'block',
|
12
|
2 => 'cdm_api',
|
13
|
3 => 'jquery_update',
|
14
|
4 => 'taxonomy',
|
15
|
5 => 'color',
|
16
|
6 => 'comment',
|
17
|
7 => 'cdm_taxontree',
|
18
|
8 => 'filter',
|
19
|
9 => 'help',
|
20
|
10 => 'cdm_dataportal',
|
21
|
11 => 'menu',
|
22
|
12 => 'node',
|
23
|
13 => 'profile_generator',
|
24
|
14 => 'system',
|
25
|
15 => 'ext_links',
|
26
|
16 => 'user',
|
27
|
17 => 'watchdog',
|
28
|
);
|
29
|
}
|
30
|
|
31
|
/************************************************************
|
32
|
* DETAILS *
|
33
|
************************************************************/
|
34
|
function CDM_DataPortal_profile_details() {
|
35
|
return array (
|
36
|
'name' => 'CDM DataPortal',
|
37
|
'description' => 'CDM DataPortal installation profile',
|
38
|
);
|
39
|
}
|
40
|
|
41
|
function CDM_DataPortal_profile_final() {
|
42
|
/************************************************************
|
43
|
* VARIABLES *
|
44
|
************************************************************/
|
45
|
variable_set('anonymous', 'Anonymous');
|
46
|
variable_set('comment_page', 0);
|
47
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
48
|
variable_set('file_directory_temp', 'c:\\windows\\temp');
|
49
|
} else {
|
50
|
variable_set('file_directory_temp', '/tmp');
|
51
|
}
|
52
|
variable_set('filter_html_1', 1);
|
53
|
variable_set('menu_primary_menu', 2);
|
54
|
variable_set('menu_secondary_menu', 2);
|
55
|
variable_set('node_options_forum', array (
|
56
|
0 => 'status',
|
57
|
));
|
58
|
variable_set('node_options_page', array (
|
59
|
0 => 'status',
|
60
|
));
|
61
|
variable_set('site_footer', '');
|
62
|
variable_set('site_frontpage', 'node/1');
|
63
|
variable_set('site_mail', '');
|
64
|
variable_set('site_mission', '');
|
65
|
variable_set('site_name', 'CDM Dataportal');
|
66
|
variable_set('site_slogan', '');
|
67
|
system_theme_data();
|
68
|
db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name = '%s'", 'garland');
|
69
|
variable_set('theme_default', 'garland');
|
70
|
variable_set('theme_settings', array (
|
71
|
'toggle_node_info_page' => false,
|
72
|
'toggle_node_info_cdm_media' => false,
|
73
|
'toggle_node_info_cdm_name' => false,
|
74
|
'toggle_node_info_cdm_taxon' => false,
|
75
|
'toggle_node_info_cdm_reference' => false
|
76
|
));
|
77
|
variable_set('cdm_webservice_debug', 0);
|
78
|
variable_set('cdm_webservice_cache', 0);
|
79
|
variable_set('distribution_sort', 'HIDE_TDWG2');
|
80
|
|
81
|
variable_set('user_register', '0');
|
82
|
|
83
|
|
84
|
/************************************************************
|
85
|
* ROLES *
|
86
|
************************************************************/
|
87
|
|
88
|
$role_id['anonymous user'] = 1;
|
89
|
$role_id['authenticated user'] = 2;
|
90
|
$rid = 3;
|
91
|
$role_id['CDM admin'] = $rid;
|
92
|
db_query("INSERT INTO {role} (rid, name) VALUES (%d, '%s')", $rid, 'CDM admin');
|
93
|
db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $rid, 'access administration menu, administer blocks, administer cdm_dataportal, cdm_dataportal view notes, access devel information, access imce, administer imce, administer menu, access content, administer content types, administer nodes, create page content, create story content, edit own page content, edit own story content, edit page content, edit story content, view revisions, access administration pages, administer site configuration, select different theme, administer users');
|
94
|
$rid = 4;
|
95
|
$role_id['admin'] = $rid;
|
96
|
db_query("INSERT INTO {role} (rid, name) VALUES (%d, '%s')", $rid, 'admin');
|
97
|
db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $rid, 'access administration menu, display drupal links, administer blocks, use PHP for block visibility, administer cdm_dataportal, cdm_dataportal view notes, access comments, administer comments, post comments, post comments without approval, access devel information, execute php code, switch users, administer filters, access imce, administer imce, administer menu, access content, administer content types, administer nodes, create page content, create story content, edit own page content, edit own story content, edit page content, edit story content, revert revisions, view revisions, access administration pages, administer site configuration, select different theme, administer taxonomy, access user profiles, administer access control, administer users, change own username');
|
98
|
|
99
|
|
100
|
/************************************************************
|
101
|
* USERS *
|
102
|
************************************************************/
|
103
|
$user = user_save(new stdClass(), array (
|
104
|
'name' => 'admin',
|
105
|
'mail' => 'admin@dataportal.net',
|
106
|
'mode' => '0',
|
107
|
'sort' => '0',
|
108
|
'threshold' => '0',
|
109
|
'theme' => '',
|
110
|
'signature' => '',
|
111
|
'created' => '1285671981',
|
112
|
'access' => '1285675547',
|
113
|
'login' => '0',
|
114
|
'status' => '1',
|
115
|
'timezone' => '0',
|
116
|
'language' => '',
|
117
|
'picture' => '',
|
118
|
'init' => 'wp5Admin@bgbm.org',
|
119
|
'data' => 'a:0:{}',
|
120
|
));
|
121
|
db_query("UPDATE {users} SET pass='%s' WHERE uid=%d", '21232f297a57a5a743894a0e4a801fc3', $user->uid);
|
122
|
$user_id['admin'] = $user->uid;
|
123
|
|
124
|
/************************************************************
|
125
|
* USERS <=> ROLES MAPPING *
|
126
|
************************************************************/
|
127
|
|
128
|
/************************************************************
|
129
|
* EXPORTING NODES *
|
130
|
************************************************************/
|
131
|
// exporting nodes of type: Page
|
132
|
db_query(
|
133
|
"INSERT INTO {node} (nid,vid,type,title,uid,status,created,changed,comment,promote,moderate,sticky)
|
134
|
VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
|
135
|
'1','1','page','CDM DataPortal','1','1','1285672677','1285673272','0','0','0','0'
|
136
|
);
|
137
|
db_query(
|
138
|
"INSERT INTO {node_revisions} (nid,vid,uid,title,body,teaser,log,timestamp,format)
|
139
|
VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
|
140
|
'1','1','1','CDM DataPortal','<h3>Welcome to your CDM DataPortal. </h3>
|
141
|
|
142
|
This data portal makes full use of the Common Data Model (CDM), a central component of the Internet Platform for Cybertaxonomy being developed by EDIT workpackage 5. All taxon pages are created as dynamic web pages from the underlying database.
|
143
|
|
144
|
In order to finish the setup of your DataPortal please visit the <?php print(l(\'CDM Dataportal settings\', \'admin/settings/cdm_dataportal\')); ?>. The CDM Dataportal provides several Drupal Blocks (<i>taxon search</i>, <i>classification browser</i>, <i>external links</i>, <i>print this page</i>) which you may want to activate in the <?php print(l(\'Blocks Settings\', \'admin/build/block\')); ?>','<h3>Welcome to your CDM DataPortal. </h3>
|
145
|
|
146
|
This data portal makes full use of the Common Data Model (CDM), a central component of the Internet Platform for Cybertaxonomy being developed by EDIT workpackage 5. All taxon pages are created as dynamic web pages from the underlying database.
|
147
|
|
148
|
In order to finish the setup of your DataPortal please visit the <?php print(l(\'CDM Dataportal settings\', \'admin/settings/cdm_dataportal\')); ?>. The CDM Dataportal provides several Drupal Blocks (<i>taxon search</i>, <i>classification browser</i>, <i>external links</i>, <i>print this page</i>) which you may want to activate in the <?php print(l(\'Blocks Settings\', \'admin/build/block\')); ?>','','1285673272','2'
|
149
|
);
|
150
|
|
151
|
system_initialize_theme_blocks('garland');
|
152
|
|
153
|
// set site info
|
154
|
// * site name
|
155
|
// * start page
|
156
|
db_query(
|
157
|
"REPLACE INTO {variable} (name, value) VALUES
|
158
|
('cdm_dataportal_geoservice_display_width', 's:3:\"600\";'),
|
159
|
('site_frontpage', 's:6:\"node/1\";'),
|
160
|
('site_name', 's:19:\"EDIT CDM DataPortal\";')
|
161
|
");
|
162
|
|
163
|
// FIX node sequences !!!!!
|
164
|
|
165
|
db_query(
|
166
|
"REPLACE INTO {sequences} (name, id) VALUES
|
167
|
('{node_nid}', 1),
|
168
|
('{node_revisions_vid}', 1);
|
169
|
");
|
170
|
|
171
|
return;
|
172
|
}
|
173
|
|
174
|
?>
|