groups/modules/commons/commons_misc/commons_misc.install
Marton Kiss 8ac59801be Refactor commons build process
Update commons modules to release 7.12, and move the codebase under
modules/commons instead of constant fetching from remote repository.
The commons.make file removed so it is not required to rebuild
groups distribution.

Change-Id: I3be393ba1af34427e2915b18ab1ad718fd4e54db
2014-05-28 15:58:33 +02:00

68 lines
1.7 KiB
Plaintext

<?php
/**
* @file
* Update hooks for commons_misc related functions.
*/
/**
* Implements hook_install().
*/
function commons_misc_install() {
// While the administrator role will be created by Features, it will not be
// available yet when hook_install() is run, so we need to test for and create
// it here.
if (!$role = user_role_load_by_name('administrator')) {
$role = new stdClass();
$role->name = 'administrator';
$role->weight = 10;
user_role_save($role);
}
// Grant user 1 the 'administrator' role.
user_multiple_role_edit(array(1), 'add_role', $role->rid);
// Set the 'administrator' role as the 'administrator role'.
variable_set('user_admin_role', $role->rid);
}
/**
* Enable legacy IE settings for Commons Origins.
*/
function commons_misc_update_7000() {
// Pull the existing settings for Commons Origins so that any changes by the
// user are preserved.
$settings = variable_get('theme_commons_origins_settings', array());
// Prevent IE from falling into compatibility mode.
$settings['chrome_edge'] = 1;
// Enable cleartype in IE.
$settings['clear_type'] = 1;
// Save the new Commons Origins settings.
variable_set('theme_commons_origins_settings', $settings);
}
/**
* Assign the administrator role a larger weight.
*/
function commons_misc_update_7001() {
$revert = array(
'commons_misc' => array('user_role'),
);
features_revert($revert);
return array();
}
/**
* Configure navbar to use the source version of Modernizr since it isn't
* currently possible to include a minified version of the library.
*/
function commons_misc_update_7002() {
$revert = array(
'commons_misc' => array('variable'),
);
features_revert($revert);
return array();
}