Project

General

Profile

« Previous | Next » 

Revision 4e698c80

Added by Wouter Addink over 11 years ago

  • ID 4e698c80b8d423e6f70fa10edabc0aa7b2ba3ef5
  • Parent 3e3a571c

Migrated D7 install profile, not yet working!

View differences:

7.x/modules/cdm_dataportal/profile/CDM_DataPortal/CDM_DataPortal.profile
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); // = COMMENT_NODE_DISABLED
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
 *                   NODE TYPES                             *
124
 ************************************************************/
125

  
126

  
127
      // Insert default user-defined node types into the database.
128
      $types = array(
129
        array(
130
            'type' => 'page',
131
            'name' => st('Page'),
132
            'module' => 'node',
133
            'description' => st('If you want to add a static page, like a contact page or an about page, use a page.'),
134
            'custom' => TRUE,
135
            'modified' => TRUE,
136
            'locked' => FALSE,
137
        ),
138
        array(
139
            'type' => 'story',
140
            'name' => st('Story'),
141
            'module' => 'node',
142
            'description' => st('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles.'),
143
            'custom' => TRUE,
144
            'modified' => TRUE,
145
            'locked' => FALSE,
146
        ),
147
      );
148

  
149
      foreach ($types as $type) {
150
        $type = (object) _node_type_set_defaults($type);
151
        node_type_save($type);
152
      }
153

  
154

  
155
/************************************************************
156
 *                       NODES                              *
157
 ************************************************************/
158
    // exporting nodes of type: Page
159
    db_query(
160
        "INSERT INTO {node} (nid,vid,type,title,uid,status,created,changed,comment,promote,moderate,sticky)
161
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
162
        '1','1','page','CDM DataPortal','1','1','1285672677','1285673272','0','0','0','0'
163
    );
164
    db_query(
165
        "INSERT INTO {node_revisions} (nid,vid,uid,title,body,teaser,log,timestamp,format)
166
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
167
        '1','1','1','CDM DataPortal','<h3>Welcome to your CDM DataPortal. </h3>
168

  
169
    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.
170

  
171
    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>
172

  
173
    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.
174

  
175
    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'
176
    );
177

  
178
    system_initialize_theme_blocks('garland');
179

  
180
    // set site info
181
    //  * site name
182
    //  * start page
183
    db_query(
184
        "REPLACE INTO {variable} (name, value) VALUES
185
          ('cdm_dataportal_geoservice_display_width', 's:3:\"600\";'),
186
          ('site_frontpage', 's:6:\"node/1\";'),
187
          ('site_name', 's:19:\"EDIT CDM DataPortal\";')
188
        ");
189

  
190
   // FIX node sequences !!!!!
191

  
192
    db_query(
193
        "REPLACE INTO {sequences} (name, id) VALUES
194
        ('{node_nid}', 1),
195
        ('{node_revisions_vid}', 1);
196
        ");
197

  
198
    return;
199
}
1
<?php
2
/**
3
 * @file
4
 * Enables modules and site configuration for a CDM portal installation.
5
 */
6

  
7
/**
8
 * Implements hook_form_FORM_ID_alter() for install_configure_form().
9
 *
10
 * Allows the profile to alter the site configuration form.
11
 */
12
function CDM_DataPortal_form_install_configure_form_alter(&$form, $form_state) {
13
  // Pre-populate the site name.
14
  $form['site_information']['site_name']['#default_value'] = st('EDIT CDM DataPortal');
15
}

Also available in: Unified diff