Revision 86b65fa0
Added by Andreas Kohlbecker almost 11 years ago
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.install | ||
---|---|---|
74 | 74 |
'zen_rebuild_registry' => 0, |
75 | 75 |
)); |
76 | 76 |
|
77 |
|
|
78 |
/**************************************** |
|
79 |
* Blocks |
|
80 |
****************************************/ |
|
81 |
|
|
82 |
// >>> admin/structure/block |
|
83 |
// Disable the blocks that were enabled for the dashboard in the standard install. |
|
84 |
// In the CDM dataportals we use the admin_menu module instead of taskbar and dashboard. |
|
85 |
$query = db_update('block')->fields(array('status' => '0')) |
|
86 |
->condition('region', 'dashboard_main', '=') |
|
87 |
->execute(); |
|
88 |
$query = db_update('block')->fields(array('status' => '0')) |
|
89 |
->condition('region', 'dashboard_sidebar', '=') |
|
90 |
->execute(); |
|
91 |
|
|
92 |
// disable "Search form" block for all themes |
|
93 |
$query = db_update('block')->fields(array('status' => '0')) |
|
94 |
->condition( |
|
95 |
db_and() |
|
96 |
->condition('module', 'search', '=') |
|
97 |
->condition('delta', 'form', '=') |
|
98 |
) |
|
99 |
->execute(); |
|
100 |
|
|
101 |
// disable the "Powered by Drupal" block for all themes |
|
102 |
$query = db_update('block')->fields(array('status' => '0')) |
|
103 |
->condition( |
|
104 |
db_and() |
|
105 |
->condition('module', 'system', '=') |
|
106 |
->condition('delta', 'powered-by', '=') |
|
107 |
) |
|
108 |
->execute(); |
|
109 |
|
|
110 |
// enable "CDM Search Taxa" block for all themes |
|
111 |
$new_blocks = array( |
|
112 |
array( |
|
113 |
'module' => 'cdm_dataportal', |
|
114 |
'delta' => '2', |
|
115 |
'theme' => $default_theme, |
|
116 |
'status' => 1, |
|
117 |
'weight' => -11, |
|
118 |
'region' => 'sidebar_first', |
|
119 |
'pages' => '', |
|
120 |
'cache' => -1, |
|
121 |
), |
|
122 |
); |
|
123 |
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); |
|
124 |
foreach ($new_blocks as $block) { |
|
125 |
$query->values($block); |
|
126 |
} |
|
127 |
$query->execute(); |
|
128 |
|
|
129 |
|
|
130 | 77 |
/**************************************** |
131 | 78 |
* Reconfigure Drupal core modules |
132 | 79 |
****************************************/ |
... | ... | |
282 | 229 |
->execute(); |
283 | 230 |
|
284 | 231 |
/**************************************** |
285 |
* Create the front page
|
|
232 |
* Blocks
|
|
286 | 233 |
****************************************/ |
234 |
|
|
235 |
// >>> admin/structure/block |
|
236 |
// Disable the blocks that were enabled for the dashboard in the standard install. |
|
237 |
// In the CDM dataportals we use the admin_menu module instead of taskbar and dashboard. |
|
238 |
$query = db_update('block')->fields(array('status' => '0')) |
|
239 |
->condition('region', 'dashboard_main', '=') |
|
240 |
->execute(); |
|
241 |
$query = db_update('block')->fields(array('status' => '0')) |
|
242 |
->condition('region', 'dashboard_sidebar', '=') |
|
243 |
->execute(); |
|
244 |
|
|
245 |
// disable "Search form" block for all themes |
|
246 |
$query = db_update('block')->fields(array('status' => '0')) |
|
247 |
->condition( |
|
248 |
db_and() |
|
249 |
->condition('module', 'search', '=') |
|
250 |
->condition('delta', 'form', '=') |
|
251 |
) |
|
252 |
->execute(); |
|
253 |
|
|
254 |
// disable the "Powered by Drupal" block for all themes |
|
255 |
$query = db_update('block')->fields(array('status' => '0')) |
|
256 |
->condition( |
|
257 |
db_and() |
|
258 |
->condition('module', 'system', '=') |
|
259 |
->condition('delta', 'powered-by', '=') |
|
260 |
) |
|
261 |
->execute(); |
|
262 |
|
|
263 |
$new_blocks = array( |
|
264 |
// enable "CDM Search Taxa" block for all themes |
|
265 |
array( |
|
266 |
'block' => array( |
|
267 |
'module' => 'cdm_dataportal', |
|
268 |
'delta' => '2', |
|
269 |
'theme' => $default_theme, |
|
270 |
'status' => 1, |
|
271 |
'weight' => -11, |
|
272 |
'region' => 'sidebar_first', |
|
273 |
'pages' => '', |
|
274 |
'cache' => -1, |
|
275 |
) |
|
276 |
), |
|
277 |
// CDM web service debug block |
|
278 |
array( |
|
279 |
'block' => array( |
|
280 |
'module' => 'cdm_api', |
|
281 |
'delta' => 'cdm_ws_debug', |
|
282 |
'theme' => $default_theme, |
|
283 |
'status' => 1, |
|
284 |
'weight' => -50, |
|
285 |
'region' => 'sidebar_first', |
|
286 |
'pages' => '', |
|
287 |
'cache' => -1, |
|
288 |
), |
|
289 |
'block_role' => array( |
|
290 |
'module' => 'cdm_api', |
|
291 |
'delta' => 'cdm_ws_debug', |
|
292 |
'rid' => $admin_role->rid |
|
293 |
) |
|
294 |
) |
|
295 |
); |
|
296 |
$block_insert = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); |
|
297 |
$block_role_insert = db_insert('block_role')->fields(array('module', 'delta', 'rid')); |
|
298 |
foreach ($new_blocks as $block) { |
|
299 |
$block_insert->values($block['block']); |
|
300 |
if(isset($block['block_role'])){ |
|
301 |
$block_role_insert->values($block['block_role']); |
|
302 |
} |
|
303 |
} |
|
304 |
$block_insert->execute(); |
|
305 |
$block_role_insert->execute(); |
|
306 |
|
|
307 |
/**************************************** |
|
308 |
* Create the front page |
|
309 |
****************************************/ |
|
287 | 310 |
$node = new stdClass(); |
288 | 311 |
$node->uid = 1; |
289 | 312 |
$node->type = 'page'; |
Also available in: Unified diff
module update and some bugfixes for #3316 (dataportal debug box as table and as block)