
The block placement handled by module installation hooks. This patch updates the block placement themes to the default one, so missing utility links and footer blocks will appear after a clean install. Change-Id: Ieede94ac2ef67ff35b681e5b817bec0a38fa6dc8
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
<?php
|
|
/**
|
|
* @file
|
|
* Commons Utility Links install script.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_install().
|
|
*/
|
|
function commons_utility_links_install() {
|
|
cache_clear_all('*', 'cache_block', TRUE);
|
|
$theme = variable_get('theme_default', 'openstack_bootstrap');
|
|
// Place site blocks in the menu_bar and header regions.
|
|
$utility_block = array(
|
|
'module' => 'commons_utility_links',
|
|
'delta' => 'commons_utility_links',
|
|
'theme' => $theme,
|
|
'visibility' => 0,
|
|
'region' => 'header',
|
|
'status' => 1,
|
|
'pages' => '0',
|
|
'cache' => DRUPAL_NO_CACHE,
|
|
'title' => '<none>',
|
|
);
|
|
drupal_write_record('block', $utility_block);
|
|
|
|
db_update('block')
|
|
->fields(array('region' => 'header'))
|
|
->fields(array('cache' => DRUPAL_NO_CACHE))
|
|
->condition('delta', 'commons_utility_links')
|
|
->condition('module', 'commons_utility_links')
|
|
->condition('theme', $theme)
|
|
->execute();
|
|
}
|
|
|
|
/**
|
|
* Remove utility_links block, and enable commons_utility_links, that never caches.
|
|
*/
|
|
function commons_utility_links_update_7301() {
|
|
$theme = variable_get('theme_default', 'openstack_bootstrap');
|
|
db_delete('block')
|
|
->condition('module', 'commons_utility_links')
|
|
->condition('delta', 'utility_links')
|
|
->execute();
|
|
|
|
db_update('block')
|
|
->fields(array(
|
|
'cache' => DRUPAL_NO_CACHE,
|
|
'region' => 'header',
|
|
'status' => 1,
|
|
'title' => '<none>',
|
|
))
|
|
->condition('delta', 'commons_utility_links')
|
|
->condition('module', 'commons_utility_links')
|
|
->condition('theme', $theme)
|
|
->execute();
|
|
cache_clear_all('*', 'cache_block', TRUE);
|
|
}
|