bear_necessities.install in Bear 7
Same filename and directory in other branches
Install, update and uninstall functions for bear_necessities module.
File
modules/bear_necessities/bear_necessities.installView source
<?php
/**
* @file
* Install, update and uninstall functions for bear_necessities module.
*/
/**
* Implements hook_install().
*/
function bear_necessities_install() {
db_update('system')
->fields(array(
'weight' => 100,
))
->condition('name', 'bear_necessities')
->execute();
// Set default date formats to American style
variable_set("date_format_long", "l, F j, Y - g:ia");
variable_set("date_format_medium", "F j, Y - g:ia");
variable_set("date_format_short", "m/d/Y - g:ia");
// Add a Home link to the main menu.
$item = array(
'link_path' => '<front>',
'link_title' => 'Home',
'menu_name' => 'main-menu',
);
menu_link_save($item);
// Add database entry for our custom menu block.
// This is a bit hacky since block module will do this anyway
// but for now it's the best way to set the region on install.
$block = array(
'module' => 'menu_block',
'delta' => 'bear_necessities-1',
'theme' => 'bear_coat',
'region' => 'navigation',
'status' => 1,
'pages' => '',
);
drupal_write_record('block', $block);
}
Functions
Name | Description |
---|---|
bear_necessities_install | Implements hook_install(). |