select_or_other.install in Select (or other) 7.2
Same filename and directory in other branches
Install, update, and uninstall functions for the Select (or other) module.
File
select_or_other.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the Select (or other) module.
*/
/**
* Implements hook_install().
*/
function select_or_other_install() {
// Increase the module weight, so that Select (or other) widget and formatter
// values appear below text default values.
$weight = db_select('system', 's')
->fields('s', array(
'weight',
))
->condition('name', 'text', '=')
->execute()
->fetchField();
db_update('system')
->fields(array(
'weight' => $weight + 1,
))
->condition('type', 'module')
->condition('name', 'select_or_other')
->execute();
}
/**
* Increase the module weight.
*
* @see select_or_other_install()
*/
function select_or_other_update_7201() {
$weight = db_select('system', 's')
->fields('s', array(
'weight',
))
->condition('name', 'text', '=')
->execute()
->fetchField();
db_update('system')
->fields(array(
'weight' => $weight + 1,
))
->condition('type', 'module')
->condition('name', 'select_or_other')
->execute();
}
Functions
Name | Description |
---|---|
select_or_other_install | Implements hook_install(). |
select_or_other_update_7201 | Increase the module weight. |