bootstrap_languages.install in Bootstrap Languages 7
Same filename and directory in other branches
Install, update, and uninstall functions for the bootstrap_languages module.
File
bootstrap_languages.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the bootstrap_languages module.
*/
/**
* Implements hook_install().
*/
function bootstrap_languages_install() {
$block_default_settings = array(
'show_all' => 1,
'btn_type' => 'btn-default',
);
variable_set('bootstrap_languages_block_settings', $block_default_settings);
}
/**
* Implements hook_install().
*/
function bootstrap_languages_uninstall() {
variable_del('bootstrap_languages_block_settings');
}
/**
* Implements hook_requirements().
*/
function bootstrap_languages_requirements($phase) {
$t = get_t();
$requirements = array();
$url = 'https://github.com/usrz/bootstrap-languages';
switch ($phase) {
case 'runtime':
$bootstrap_languages_library = libraries_load('bootstrap-languages');
if (!$bootstrap_languages_library['loaded']) {
$requirements['bootstrap_languages'] = array(
'title' => $t('Bootstrap languages library'),
'value' => $t('Not installed'),
'description' => $t('The bootstrap languages library could not be loaded. Please install <a href="@url" target="_blank">Bootstrap languages library</a>.', array(
'@url' => $url,
)),
'severity' => REQUIREMENT_ERROR,
);
}
break;
}
return $requirements;
}
Functions
Name | Description |
---|---|
bootstrap_languages_install | Implements hook_install(). |
bootstrap_languages_requirements | Implements hook_requirements(). |
bootstrap_languages_uninstall | Implements hook_install(). |