Project

General

Profile

« Previous | Next » 

Revision 8ad37213

Added by Wouter Addink over 11 years ago

Finalized the D7 CDM DataPortal installation profiles.

View differences:

.gitattributes
1009 1009
7.x/modules/cdm_dataportal/js/thickbox/thickbox.js -text
1010 1010
7.x/modules/cdm_dataportal/node_types.php -text
1011 1011
7.x/modules/cdm_dataportal/pom.xml -text
1012
7.x/modules/cdm_dataportal/profile/CDM_DataPortal/CDM_DataPortal.profile -text
1013
7.x/modules/cdm_dataportal/profile/CDM_DataPortal_Testing/CDM_DataPortal_Testing.profile -text
1012
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.info -text
1013
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.install -text
1014
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.profile -text
1015
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.info -text
1016
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.install -text
1017
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.profile -text
1018
7.x/modules/cdm_dataportal/profile/READMe.txt -text
1014 1019
7.x/modules/cdm_dataportal/settings.php -text
1015 1020
7.x/modules/cdm_dataportal/site/apt/configuration.apt -text
1016 1021
7.x/modules/cdm_dataportal/site/apt/download.apt -text
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
}
7.x/modules/cdm_dataportal/profile/CDM_DataPortal_Testing/CDM_DataPortal_Testing.profile
1
<?php
2

  
3
// vim: filetype=php
4

  
5
require_once ("profiles/CDM_DataPortal/CDM_DataPortal.profile");
6

  
7

  
8
/************************************************************
9
*                           MODULES                         *
10
************************************************************/
11
function CDM_DataPortal_Testing_profile_modules() {
12
  return CDM_DataPortal_profile_modules();
13
}
14

  
15
/************************************************************
16
*                           DETAILS                         *
17
************************************************************/
18
function CDM_DataPortal_Testing_profile_details() {
19
  return array (
20
      'name' => 'CDM DataPortal Testing',
21
      'description' => 'CDM DataPortal installation profile for testing purposes ',
22
    );
23
}
24

  
25
function CDM_DataPortal_Testing_profile_final() {
26

  
27
  CDM_DataPortal_profile_final();
28

  
29
/************************************************************
30
*                           BLOCKS                          *
31
************************************************************/
32

  
33
  // Taxon tree
34
  db_query(
35
      "INSERT INTO {blocks} (module,delta,theme,status,weight,region,custom,throttle,visibility,pages,title)
36
      VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s', '%s')",
37
      'cdm_taxontree', 'cdm_tree', 'garland', '1', '-8', 'left', '0', '0', '0', '', ''
38
  );
39
  // Search Taxa
40
  db_query(
41
      "INSERT INTO {blocks} (module,delta,theme,status,weight,region,custom,throttle,visibility,pages,title)
42
      VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s', '%s')",
43
      'cdm_dataportal', '2', 'garland', '1', '-10', 'left', '0', '0', '0', '', ''
44
  );
45

  
46
  return;
47
}
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.info
1
; @comment WA:
2
; In D7 Profiles are treated like modules, so you will see this profile at the end of the list of modules installing.
3
; To avoid confusion with CDM DataPortal module the name of this profile is CDM Portal, not CDM DataPortal.
4
name = CDM Portal
5
description = CDM DataPortal installation profile.
6
version = 7.x-3.0
7
core = 7.x
8

  
9
;Core modules. Note: the taskbar and dashboard Drupal modules are not used in CDM Portals and therefore not enabled.
10
dependencies[] = block
11
dependencies[] = color
12
dependencies[] = comment
13
dependencies[] = contextual
14
dependencies[] = help
15
dependencies[] = image
16
dependencies[] = list
17
dependencies[] = menu
18
dependencies[] = number
19
dependencies[] = options
20
dependencies[] = path
21
dependencies[] = taxonomy
22
dependencies[] = dblog
23
dependencies[] = search
24
dependencies[] = shortcut
25
dependencies[] = overlay
26
dependencies[] = field_ui
27
dependencies[] = file
28
dependencies[] = rdf
29

  
30
;Contributed modules.
31
dependencies[] = admin_menu
32

  
33
;Custom CDM modules.
34
dependencies[] = cdm_api
35
dependencies[] = cdm_taxontree
36
dependencies[] = cdm_dataportal
37
dependencies[] = ext_links
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.install
1
<?php
2
/**
3
 * @file
4
 * Install, update and uninstall functions for CDM_DataPortal install profile.
5
 *
6
 * This profile performs the same actions as the standard profile, but with 
7
 * some customizations for CDM portals.
8
 */
9

  
10
/**
11
 * Implements hook_install().
12
 *
13
 * Perform actions to set up the site for this profile.
14
 *
15
 * @see system_install()
16
 */
17
function CDM_Portal_install() {
18
  variable_set('theme_default', 'garland');
19

  
20
  include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
21
  standard_install();
22
  
23
  // Disable the blocks that were enabled for the dashboard in the standard install.
24
  // In the CDM dataportals we use the admin_menu module instead of taskbar and dashboard.
25
  $query = db_update('block')->fields(array('status' => '0'))
26
  ->condition('region', 'dashboard_main', '=')
27
  ->execute();
28
  $query = db_update('block')->fields(array('status' => '0'))
29
  ->condition('region', 'dashboard_sidebar', '=')
30
  ->execute();  
31

  
32
  // CDM Portal specific settings.
33
    variable_set('anonymous', 'Anonymous');
34
  if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
35
    variable_set('file_temporary_path', 'c:\\windows\\temp');
36
  }
37
  else {
38
    variable_set('file_temporary_path', '/tmp');
39
  }
40

  
41
  // Do not use the line-break filter for the full_html input format.
42
  $full_html_format = array(
43
    'format' => 'full_html',
44
    'name' => 'Full HTML',
45
    'weight' => 1,
46
    'filters' => array(
47
      // URL filter.
48
      'filter_url' => array(
49
        'weight' => 0,
50
        'status' => 1,
51
      ),
52
      // HTML corrector filter.
53
      'filter_htmlcorrector' => array(
54
        'weight' => 10,
55
        'status' => 1,
56
      ),
57
    ),
58
  );
59
  $full_html_format = (object) $full_html_format;
60
  filter_format_save($full_html_format);
61
  
62
  // variable_set('filter_html_1', 1);
63
  // variable_set('menu_primary_menu', 2);
64
  // variable_set('menu_secondary_menu', 2);
65
  variable_set('node_options_forum', array (0 => 'status'));
66
  variable_set('node_options_page', array (0 => 'status'));
67
  // variable_set('site_footer', '');
68
  variable_set('site_frontpage', 'node/1');
69
  variable_set('site_mail', '');
70
  // variable_set('site_mission', '');
71
  variable_set('site_name', 'CDM Dataportal');
72
  variable_set('site_slogan', '');
73
  variable_set('cdm_dataportal_geoservice_display_width', '600');
74
  
75
  // Enable the Garland theme.
76
  db_update('system')
77
  ->fields(array('status' => 1))
78
  ->condition('type', 'theme')
79
  ->condition('name', 'garland')
80
  ->execute();
81

  
82
// a:16:{s:11:"toggle_logo";i:1;s:11:"toggle_name";i:1;s:13:"toggle_slogan";i:0;s:14:"toggle_mission";i:0;s:24:"toggle_node_user_picture";i:0;s:27:"toggle_comment_user_picture";i:0;s:13:"toggle_search";i:1;s:14:"toggle_favicon";i:1;s:12:"default_logo";i:1;s:9:"logo_path";s:0:"";s:11:"logo_upload";s:0:"";s:15:"default_favicon";i:1;s:12:"favicon_path";s:0:"";s:14:"favicon_upload";s:0:"";s:2:"op";s:18:"Save configuration";s:10:"form_token";s:32:"3e11e7c40e73cf4b3e70ae5703d87d72";}
83
  variable_set('theme_settings', array (
84
    'toggle_node_info_page' => FALSE,
85
    'toggle_node_info_cdm_media' => FALSE,
86
    'toggle_node_info_cdm_name' => FALSE,
87
    'toggle_node_info_cdm_taxon' => FALSE,
88
    'toggle_node_info_cdm_reference' => FALSE,
89
  ));
90

  
91
  variable_set('cdm_webservice_debug', 0);
92
  variable_set('cdm_webservice_cache', 0);
93
  variable_set('distribution_sort', 'HIDE_TDWG2');
94

  
95
  variable_set('baselayers', array(
96
    'metacarta_vmap0' => 'metacarta_vmap0',
97
    'PREFERRED' => 'metacarta_vmap0'
98
  ));
99

  
100
  // USER_REGISTER_ADMINISTRATORS_ONLY = 0
101
  // USER_REGISTER_VISITORS = 1
102
  // USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 2
103
  variable_set('user_register', USER_REGISTER_ADMINISTRATORS_ONLY);
104

  
105
  // Create a role for CDM administrator.
106
  $admin_role = new stdClass();
107
  $admin_role->name = 'CDM admin';
108
  $admin_role->weight = 3;
109
  user_role_save($admin_role);
110

  
111
  // Make sure these permissions are present, e.g. that the modules defining these permissions are installed.
112
  // This because user_role_grant_permissions() will create the permission in the role_permision table if it does not
113
  // exist, and for that it needs to find a module that defines the permission (there is a module column in this table).
114
  $permissions = array(
115
    // Roles same as in D5 portals.
116
    'access administration menu',
117
    'administer blocks',
118
    'administer cdm_dataportal',
119
    'cdm_dataportal view notes',
120
    // @comment WA: Devel and IMCE modules are not required modules in this profile.
121
    // 'access devel information',
122
    // 'access imce',
123
    // 'administer imce',
124
    'administer menu',
125
    'access content',
126
    'administer content types',
127
    'administer nodes',
128
    'create page content',
129
    'edit own page content',
130
    'view revisions',
131
    'access administration pages',
132
    'administer site configuration',
133
    'administer users',
134

  
135
    // Roles as in D5 but with different name.
136
    'edit any page content',
137
    'edit any article content',
138
    'create article content',
139
    'edit own article content',
140
    'administer themes',
141

  
142
    // New roles for D7.
143
    'access content overview',
144
    'access site in maintenance mode',
145
    'bypass node access',
146
    'view the administration theme',
147
    // 'use text format 3',
148
  );
149
  user_role_grant_permissions($admin_role->rid, $permissions);
150

  
151
  /*
152
  // Create a portal admin user (uid = 1).
153
  $user = user_save(new stdClass(), array(
154
    'name' => 'admin',
155
    'mail' => 'admin@dataportal.net',
156
    'status' => '1',
157
    'init' => 'wp5Admin@bgbm.org',
158
    'pass' => 'admin',
159
  ));
160
*/
161
  // Assign user 1 the "CDM admin" role.
162
  db_insert('users_roles')
163
  ->fields(array('uid' => 1, 'rid' => $admin_role->rid))
164
  ->execute();
165

  
166
  // Create a first node page.
167
  $node = new stdClass();
168
  $node->uid = 1;
169
  $node->type = 'page';
170

  
171
  // Sets some defaults.
172
  node_object_prepare($node);
173

  
174
  $node->status = 1;
175
  $node->language = LANGUAGE_NONE;
176
  
177
  // Promoted to front page.
178
  $node->promote = 0;
179
  
180
  // Comments on.
181
  $node->comment = 1;
182
  $node->title = 'CDM DataPortal';
183
  // Format to use = full html.
184
  $node->body[$node->language][0]['format'] = 'full_html';
185
  $node->body[$node->language][0]['value'] = sprintf(
186
    '<h3>Welcome to your CDM DataPortal. </h3>
187
    This data portal makes full use of the Common Data Model (CDM),
188
    a central component of the Internet Platform for Cybertaxonomy being
189
    developed by EDIT workpackage 5. All taxon pages are created as dynamic
190
    web pages from the underlying database.
191
    In order to finish the setup of your DataPortal please visit the %s.
192
    The CDM Dataportal provides several Drupal Blocks (<i>taxon search</i>,
193
    <i>classification browser</i>, <i>external links</i>,
194
    <i>print this page</i>) which you may want to activate in the
195
    %s.',
196
    l('CDM Dataportal settings','admin/config/cdm_dataportal'),
197
    l('Blocks Settings', 'admin/structure/block')
198
  );
199
  node_save($node);
200

  
201
 }
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.profile
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_Portal_form_install_configure_form_alter(&$form, $form_state) {
13
  // Pre-populate the form.
14
  $form['site_information']['site_name']['#default_value'] = st('EDIT CDM DataPortal');
15
  $form['site_information']['site_mail']['#default_value'] = 'admin@dataportal.net';
16
  $form['admin_account']['account']['name']['#default_value'] = 'admin';
17
  $form['admin_account']['account']['mail']['#default_value'] = 'wp5Admin@bgbm.org';
18

  
19
  // @Comment WA: enable if default password is required (drupal password_confirm field does not allow default value).
20
  // $form['admin_account']['account']['pass']['#type'] = 'textfield';
21
  // $form['admin_account']['account']['pass']['#title'] = st('Password');
22
  // $form['admin_account']['account']['pass']['#default_value'] = 'admin';
23
  $form['server_settings']['site_default_country']['#default_value'] = 'DE';
24
}
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.info
1
name = CDM Portal Testing
2
description = CDM DataPortal installation profile for testing purposes.
3
version = 7.x-3.0
4
core = 7.x
5

  
6
;Core modules. Note: the taskbar and dashboard Drupal modules are not used in CDM Portals and therefore not enabled.
7
dependencies[] = block
8
dependencies[] = color
9
dependencies[] = comment
10
dependencies[] = contextual
11
dependencies[] = help
12
dependencies[] = image
13
dependencies[] = list
14
dependencies[] = menu
15
dependencies[] = number
16
dependencies[] = options
17
dependencies[] = path
18
dependencies[] = taxonomy
19
dependencies[] = dblog
20
dependencies[] = search
21
dependencies[] = shortcut
22
dependencies[] = overlay
23
dependencies[] = field_ui
24
dependencies[] = file
25
dependencies[] = rdf
26

  
27
;Contributed modules.
28
dependencies[] = admin_menu
29

  
30
;Custom CDM modules.
31
dependencies[] = cdm_api
32
dependencies[] = cdm_taxontree
33
dependencies[] = cdm_dataportal
34
dependencies[] = ext_links
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.install
1
<?php
2
/**
3
 * @file
4
 * Install, update and uninstall functions for CDM_DataPortal install profile.
5
 *
6
 * This profile performs the same actions as the CDM_Portal profile, but with 
7
 * some extra blocks enabled for testing.
8
 */
9

  
10
/**
11
 * Implements hook_install().
12
 *
13
 * Perform actions to set up the site for this profile.
14
 *
15
 * @see system_install()
16
 */
17
function CDM_Portal_Testing_install() {
18
  include_once DRUPAL_ROOT . '/profiles/CDM_Portal/CDM_Portal.install';
19
  CDM_Portal_install();
20

  
21
  $default_theme = 'garland';
22
  // Enable Taxontree and Search Taxa blocks.
23
  $blocks = array(
24
    array(
25
      'module' => 'cdm_taxontree',
26
      'delta' => 'cdm_tree',
27
      'theme' => $default_theme,
28
      'status' => 1,
29
      'weight' => -8,
30
      'region' => 'sidebar_first',
31
      'pages' => '',
32
      'cache' => -1,
33
    ),
34
    array(
35
      'module' => 'cdm_dataportal',
36
      'delta' => '2',
37
      'theme' => $default_theme,
38
      'status' => 1,
39
      'weight' => -10,
40
      'region' => 'sidebar_first',
41
      'pages' => '',
42
      'cache' => -1,
43
  ));
44
  $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
45
  foreach ($blocks as $block) {
46
    $query->values($block);
47
  }
48
  $query->execute();
49

  
50
}
7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/CDM_Portal_Testing.profile
1
<?php
2
/**
3
 * @file
4
 * Enables modules and site configuration for a CDM portal installation for testing.
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_Portal_Testing_form_install_configure_form_alter(&$form, $form_state) {
13
  // Pre-populate the form.
14
  $form['site_information']['site_name']['#default_value'] = st('EDIT CDM DataPortal');
15
  $form['site_information']['site_mail']['#default_value'] = 'admin@dataportal.net';
16
  $form['admin_account']['account']['name']['#default_value'] = 'admin';
17
  $form['admin_account']['account']['mail']['#default_value'] = 'wp5Admin@bgbm.org';
18

  
19
  // @Comment WA: enable if default password is required (drupal password_confirm field does not allow default value).
20
  // $form['admin_account']['account']['pass']['#type'] = 'textfield';
21
  // $form['admin_account']['account']['pass']['#title'] = st('Password');
22
  // $form['admin_account']['account']['pass']['#default_value'] = 'admin';
23
  $form['server_settings']['site_default_country']['#default_value'] = 'DE';
24
}
7.x/modules/cdm_dataportal/profile/READMe.txt
1
This directory contains CDM DataPortal installation profiles. 
2
To use, you have to copy them to your /Drupal7/profiles directory first.
3
After that, follow the normal installation procedure for Drupal and choose the
4
CDM DataPortal installation profile you want to use.

Also available in: Unified diff