Project

General

Profile

Download (8.36 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2

    
3
// vim: filetype=php
4

    
5
/************************************************************
6
*                           MODULES                         *
7
************************************************************/
8
function CDM_DataPortal_profile_modules() {
9
    return array (
10
        // core modules
11
        'block', 'color', 'comment', 'filter', 'help', 'menu', 'node', 'system', 'taxonomy', 'user', 'watchdog', 'taxonomy',
12
        // admin
13
        'admin_menu',
14
        // requirement for cdm
15
       	'jquery_update',
16
        // CDM modules
17
        'cdm_api', 'cdm_taxontree',
18
        'cdm_dataportal',
19
        'ext_links',
20
       // additional:
21
       //profile_generator' // uncomment to enable
22
      );
23
}
24

    
25
/************************************************************
26
*                           DETAILS                         *
27
************************************************************/
28
function CDM_DataPortal_profile_details() {
29
    return array (
30
        'name' => 'CDM DataPortal',
31
        'description' => 'CDM DataPortal installation profile',
32
      );
33
}
34

    
35
function CDM_DataPortal_profile_final() {
36
/************************************************************
37
*                          VARIABLES                        *
38
************************************************************/
39
    variable_set('anonymous', 'Anonymous');
40
    variable_set('comment_page', 0);
41
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
42
      variable_set('file_directory_temp', 'c:\\windows\\temp');
43
    } else {
44
      variable_set('file_directory_temp', '/tmp');
45
    }
46
    variable_set('filter_html_1', 1);
47
    variable_set('menu_primary_menu', 2);
48
    variable_set('menu_secondary_menu', 2);
49
    variable_set('node_options_forum', array (
50
      0 => 'status',
51
    ));
52
    variable_set('node_options_page', array (
53
      0 => 'status',
54
    ));
55
    variable_set('site_footer', '');
56
    variable_set('site_frontpage', 'node/1');
57
    variable_set('site_mail', '');
58
    variable_set('site_mission', '');
59
    variable_set('site_name', 'CDM Dataportal');
60
    variable_set('site_slogan', '');
61
    system_theme_data();
62
    db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name = '%s'", 'garland');
63
    variable_set('theme_default', 'garland');
64
    variable_set('theme_settings', array (
65
      'toggle_node_info_page' => false,
66
      'toggle_node_info_cdm_media' => false,
67
      'toggle_node_info_cdm_name' => false,
68
      'toggle_node_info_cdm_taxon' => false,
69
      'toggle_node_info_cdm_reference' => false
70
    ));
71
    variable_set('cdm_webservice_debug', 0);
72
    variable_set('cdm_webservice_cache', 0);
73
    variable_set('distribution_sort', 'HIDE_TDWG2');
74

    
75
    variable_set('user_register', '0');
76

    
77

    
78
/************************************************************
79
*                            ROLES                          *
80
************************************************************/
81

    
82
    $role_id['anonymous user'] = 1;
83
    $role_id['authenticated user'] = 2;
84
    $rid = 3;
85
    $role_id['CDM admin'] = $rid;
86
    db_query("INSERT INTO {role} (rid, name) VALUES (%d, '%s')", $rid, 'CDM admin');
87
    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');
88
    $rid = 4;
89
    $role_id['admin'] = $rid;
90
    db_query("INSERT INTO {role} (rid, name) VALUES (%d, '%s')", $rid, 'admin');
91
    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');
92

    
93

    
94
/************************************************************
95
*                            USERS                          *
96
************************************************************/
97
    $user = user_save(new stdClass(), array (
98
        'name' => 'admin',
99
        'mail' => 'admin@dataportal.net',
100
        'mode' => '0',
101
        'sort' => '0',
102
        'threshold' => '0',
103
        'theme' => '',
104
        'signature' => '',
105
        'created' => '1285671981',
106
        'access' => '1285675547',
107
        'login' => '0',
108
        'status' => '1',
109
        'timezone' => '0',
110
        'language' => '',
111
        'picture' => '',
112
        'init' => 'wp5Admin@bgbm.org',
113
        'data' => 'a:0:{}',
114
      ));
115
    db_query("UPDATE {users} SET pass='%s' WHERE uid=%d", '21232f297a57a5a743894a0e4a801fc3', $user->uid);
116
    $user_id['admin'] = $user->uid;
117

    
118
/************************************************************
119
*                   USERS <=> ROLES MAPPING                 *
120
************************************************************/
121

    
122
/************************************************************
123
*                       EXPORTING NODES                     *
124
************************************************************/
125
    // exporting nodes of type: Page
126
    db_query(
127
        "INSERT INTO {node} (nid,vid,type,title,uid,status,created,changed,comment,promote,moderate,sticky)
128
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
129
        '1','1','page','CDM DataPortal','1','1','1285672677','1285673272','0','0','0','0'
130
    );
131
    db_query(
132
        "INSERT INTO {node_revisions} (nid,vid,uid,title,body,teaser,log,timestamp,format)
133
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
134
        '1','1','1','CDM DataPortal','<h3>Welcome to your CDM DataPortal. </h3>
135

    
136
    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.
137

    
138
    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>
139

    
140
    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.
141

    
142
    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'
143
    );
144

    
145
    system_initialize_theme_blocks('garland');
146

    
147
    // set site info
148
    //  * site name
149
    //  * start page
150
    db_query(
151
        "REPLACE INTO {variable} (name, value) VALUES
152
          ('cdm_dataportal_geoservice_display_width', 's:3:\"600\";'),
153
          ('site_frontpage', 's:6:\"node/1\";'),
154
          ('site_name', 's:19:\"EDIT CDM DataPortal\";')
155
        ");
156

    
157
   // FIX node sequences !!!!!
158

    
159
    db_query(
160
        "REPLACE INTO {sequences} (name, id) VALUES
161
        ('{node_nid}', 1),
162
        ('{node_revisions_vid}', 1);
163
        ");
164

    
165
    return;
166
}
    (1-1/1)