Newer
Older
<?php
/**
* @file wcm_base.install
* Install, update and uninstall functions.
*/
/**
* Implements hook_install().
*/
function wcm_base_install() {
// Set up theme
_wcm_base_set_up_theme();
// Set up admin items
_wcm_base_set_up_admin();
// Run development tasks if devel modules lives in sites/all
if (preg_match('/sites\/all/', drupal_get_path('module', 'devel'))) {
_wcm_base_set_up_development();
}
// Run production tasks
else {
_wcm_base_set_up_production();
}
}
/**
* Set the default theme.
*/
function _wcm_base_set_up_theme() {
$enable = array('ocio_1', 'ocio_2', 'ocio_3', 'ocio_4');
$admin = 'ocio_seven';
theme_enable($enable);
variable_set('theme_default', $default);
theme_disable($disable);
// set admin theme
variable_set('admin_theme', $admin);
// set to use admin theme to edit content
variable_set('node_admin_theme', 1);
}
/**
* Set admin items.
*/
function _wcm_base_set_up_admin() {
$features = array(
'ocio_panels_settings',
'ocio_user_config',
'ocio_permissions',
'ocio_workbench',
);
// Revert custom features to override configuration
foreach ($features as $feature) {
features_revert_module($feature);
}
}
/**
* Set up development tasks
*/
function _wcm_base_set_up_development() {
module_enable(array('devel'));
}
/**
* Set up production tasks
*/
function _wcm_base_set_up_production() {
// Page compression on.
variable_set('page_compression', TRUE);
// Aggregate CSS.
variable_set('preprocess_css', TRUE);
// Aggregate JS.
variable_set('preprocess_js', TRUE);
/*
More variables:
// Cache pages for anonymous.
variable_set('cache', 0);
// Enable block caching.
variable_set('block_cache', TRUE);
// Minimum cache time - none.
variable_set('cache_lifetime', 0);
// Cache expiry 15 minutes.
variable_set('page_cache_maximum_age', '900');
*/
// Disable omega development extensions
variable_set('omega_toggle_extension_development', 0);
}