Project

General

Profile

« Previous | Next » 

Revision 1cd45695

Added by Andreas Kohlbecker over 13 years ago

fixing #2188 : Improve default settings in install profile

View differences:

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
        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 generated automatically on 28th Sep 2010 02:05pm',
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
    variable_set('file_directory_temp', 'c:\\windows\\temp');
48
    variable_set('filter_html_1', 1);
49
    variable_set('menu_primary_menu', 2);
50
    variable_set('menu_secondary_menu', 2);
51
    variable_set('node_options_forum', array (
52
      0 => 'status',
53
    ));
54
    variable_set('node_options_page', array (
55
      0 => 'status',
56
    ));
57
    variable_set('site_footer', '');
58
    variable_set('site_frontpage', 'node/1');
59
    variable_set('site_mail', '');
60
    variable_set('site_mission', '');
61
    variable_set('site_name', 'CDM Dataportal');
62
    variable_set('site_slogan', '');
63
    system_theme_data();
64
    db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name = '%s'", 'garland');
65
    variable_set('theme_default', 'garland');
66
    variable_set('theme_settings', array (
67
      'toggle_node_info_page' => false,
68
      'toggle_node_info_cdm_media' => false,
69
      'toggle_node_info_cdm_name' => false,
70
      'toggle_node_info_cdm_taxon' => false,
71
      'toggle_node_info_cdm_reference' => false
72
    ));
73
    variable_set('cdm_webservice_debug', 0);
74
    variable_set('cdm_webservice_cache', 0);
75
    variable_set('distribution_sort', 'HIDE_TDWG2');
76
    
77

  
78
/************************************************************
79
*                            ROLES                          *
80
************************************************************/
81
    $role_id['anonymous user'] = 1;
82
    $role_id['authenticated user'] = 2;
83

  
84
/************************************************************
85
*                            USERS                          *
86
************************************************************/
87
    $user = user_save(new stdClass(), array (
88
        'name' => 'admin',
89
        'mail' => 'admin@dataportal.net',
90
        'mode' => '0',
91
        'sort' => '0',
92
        'threshold' => '0',
93
        'theme' => '',
94
        'signature' => '',
95
        'created' => '1285671981',
96
        'access' => '1285675547',
97
        'login' => '0',
98
        'status' => '1',
99
        'timezone' => '0',
100
        'language' => '',
101
        'picture' => '',
102
        'init' => 'wp5Admin@bgbm.org',
103
        'data' => 'a:0:{}',
104
      ));
105
    db_query("UPDATE {users} SET pass='%s' WHERE uid=%d", '21232f297a57a5a743894a0e4a801fc3', $user->uid);
106
    $user_id['admin'] = $user->uid;
107

  
108
/************************************************************
109
*                   USERS <=> ROLES MAPPING                 *
110
************************************************************/
111

  
112
/************************************************************
113
*                       EXPORTING NODES                     *
114
************************************************************/
115
    // exporting nodes of type: Page
116
    db_query(
117
        "INSERT INTO {node} (nid,vid,type,title,uid,status,created,changed,comment,promote,moderate,sticky)
118
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
119
        '1','1','page','CDM DataPortal','1','1','1285672677','1285673272','0','0','0','0'
120
    );
121
    db_query(
122
        "INSERT INTO {node_revisions} (nid,vid,uid,title,body,teaser,log,timestamp,format)
123
        VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
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 generated automatically on 28th Sep 2010 02:05pm',
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
    //TODO fix for linux and mac os-x
48
    variable_set('file_directory_temp', 'c:\\windows\\temp');
49
    variable_set('filter_html_1', 1);
50
    variable_set('menu_primary_menu', 2);
51
    variable_set('menu_secondary_menu', 2);
52
    variable_set('node_options_forum', array (
53
      0 => 'status',
54
    ));
55
    variable_set('node_options_page', array (
56
      0 => 'status',
57
    ));
58
    variable_set('site_footer', '');
59
    variable_set('site_frontpage', 'node/1');
60
    variable_set('site_mail', '');
61
    variable_set('site_mission', '');
62
    variable_set('site_name', 'CDM Dataportal');
63
    variable_set('site_slogan', '');
64
    system_theme_data();
65
    db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name = '%s'", 'garland');
66
    variable_set('theme_default', 'garland');
67
    variable_set('theme_settings', array (
68
      'toggle_node_info_page' => false,
69
      'toggle_node_info_cdm_media' => false,
70
      'toggle_node_info_cdm_name' => false,
71
      'toggle_node_info_cdm_taxon' => false,
72
      'toggle_node_info_cdm_reference' => false
73
    ));
74
    variable_set('cdm_webservice_debug', 0);
75
    variable_set('cdm_webservice_cache', 0);
76
    variable_set('distribution_sort', 'HIDE_TDWG2');
77
    
78
    variable_set('user_register', '0');
79
    
80

  
81
/************************************************************
82
*                            ROLES                          *
83
************************************************************/
84

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

  
96

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

  
121
/************************************************************
122
*                   USERS <=> ROLES MAPPING                 *
123
************************************************************/
124

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

  
135
    system_initialize_theme_blocks('garland');
136
    
137
    // set site info
138
    //  * site name
139
    //  * start page
140
    db_query(
141
        "REPLACE INTO {variable} (name, value) VALUES
142
          ('cdm_dataportal_geoservice_display_width', 's:3:\"600\";'),
143
          ('site_frontpage', 's:6:\"node/1\";'),
144
          ('site_name', 's:9:\"TDWG 2010\";')
145
        ");
146
        
147
   // FIX node sequences !!!!!
148
   
149
    db_query(
150
        "REPLACE INTO {sequences} (name, id) VALUES
151
        ('{node_nid}', 1),
152
        ('{node_revisions_vid}', 1);
153
        ");
154
	
155
    return;
156
}
157

  
158
?>
145
    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'
146
    );
147

  
148
    system_initialize_theme_blocks('garland');
149
    
150
    // set site info
151
    //  * site name
152
    //  * start page
153
    db_query(
154
        "REPLACE INTO {variable} (name, value) VALUES
155
          ('cdm_dataportal_geoservice_display_width', 's:3:\"600\";'),
156
          ('site_frontpage', 's:6:\"node/1\";'),
157
          ('site_name', 's:19:\"EDIT CDM DataPortal\";')
158
        ");
159
        
160
   // FIX node sequences !!!!!
161
   
162
    db_query(
163
        "REPLACE INTO {sequences} (name, id) VALUES
164
        ('{node_nid}', 1),
165
        ('{node_revisions_vid}', 1);
166
        ");
167
  
168
    return;
169
}
170

  
171
?>

Also available in: Unified diff