Now all modules are in core modules folder
This commit is contained in:
parent
5ba1cdfa0b
commit
05b6a91b0c
1907 changed files with 0 additions and 0 deletions
48
modules/search_restrict/search_restrict.install
Normal file
48
modules/search_restrict/search_restrict.install
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
function search_restrict_install() {
|
||||
// Set a low weight so the module is called before node module.
|
||||
db_query("UPDATE {system} SET weight = -10 WHERE name = 'search_restrict'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_uninstall().
|
||||
*/
|
||||
function search_restrict_uninstall() {
|
||||
$types = node_get_types();
|
||||
|
||||
foreach ($types as $type => $type_info) {
|
||||
variable_del('search_restrict_type_'. $type);
|
||||
}
|
||||
|
||||
variable_del('search_restrict_content_type');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove extra variables set by the content type form.
|
||||
*/
|
||||
function search_restrict_update_6001() {
|
||||
$ret = array();
|
||||
$ret[] = update_sql("DELETE FROM {variable} WHERE NAME LIKE 'search_restrict_roles_%'");
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert content type settings to new format.
|
||||
*/
|
||||
function search_restrict_update_6002() {
|
||||
$ret = array();
|
||||
$types = variable_get('search_restrict_content_type', array());
|
||||
|
||||
foreach($types as $type => $roles) {
|
||||
variable_set('search_restrict_type_'. $type, $roles);
|
||||
}
|
||||
|
||||
variable_del('search_restrict_content_type');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
Reference in a new issue