custom_search_blocks.install in Custom Search 7
Same filename and directory in other branches
Install, update, and uninstall functions for the custom search module.
File
modules/custom_search_blocks/custom_search_blocks.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the custom search module.
*/
/**
* Implements hook_install().
*/
function custom_search_blocks_install() {
db_update('system')
->fields(array(
'weight' => 99,
))
->condition('name', 'custom_search_blocks')
->execute();
}
/**
* Implements hook_uninstall().
*/
function custom_search_blocks_uninstall() {
db_delete('variable')
->condition('name', 'custom_search_blocks_%', 'LIKE')
->execute();
}
/**
* Change module weight.
*/
function custom_search_blocks_update_7100() {
db_update('system')
->fields(array(
'weight' => 99,
))
->condition('name', 'custom_search_blocks')
->execute();
}
function custom_search_blocks_update_7101() {
$blocks = variable_get('custom_search_blocks_number', 1);
for ($delta = 1; $delta <= $blocks; $delta++) {
variable_set('custom_search_blocks_' . $delta . '_submit_text', variable_get('custom_search_submit_text', CUSTOM_SEARCH_SUBMIT_TEXT_DEFAULT));
variable_set('custom_search_blocks_' . $delta . '_image_path', variable_get('custom_search_image_path', ''));
variable_set('custom_search_blocks_' . $delta . '_criteria_or_display', variable_get('custom_search_criteria_or_display', FALSE));
variable_set('custom_search_blocks_' . $delta . '_criteria_or_label', variable_get('custom_search_criteria_or_label', CUSTOM_SEARCH_CRITERIA_OR_LABEL_DEFAULT));
variable_set('custom_search_blocks_' . $delta . '_criteria_phrase_display', variable_get('custom_search_criteria_phrase_display', FALSE));
variable_set('custom_search_blocks_' . $delta . '_criteria_phrase_label', variable_get('custom_search_criteria_phrase_label', CUSTOM_SEARCH_CRITERIA_PHRASE_LABEL_DEFAULT));
variable_set('custom_search_blocks_' . $delta . '_criteria_negative_display', variable_get('custom_search_criteria_negative_display', FALSE));
variable_set('custom_search_blocks_' . $delta . '_criteria_negative_label', variable_get('custom_search_criteria_negative_label', CUSTOM_SEARCH_CRITERIA_NEGATIVE_LABEL_DEFAULT));
}
}
Functions
Name | Description |
---|---|
custom_search_blocks_install | Implements hook_install(). |
custom_search_blocks_uninstall | Implements hook_uninstall(). |
custom_search_blocks_update_7100 | Change module weight. |
custom_search_blocks_update_7101 |