function patron_uninstall in Library 6
Same name and namespace in other branches
- 5.2 patron/patron.install \patron_uninstall()
- 6.2 patron/patron.install \patron_uninstall()
Implementation of hook_uninstall().
File
- patron/
patron.install, line 80 - @author Jess Straatmann patron.install Install and uninstall all required databases. Also do incremental database updates.
Code
function patron_uninstall() {
variable_del('patron_is_user');
variable_del('patron_use_barcodes');
variable_del('patron_autocreate');
$result = db_query("SELECT nid FROM {node} WHERE type = 'patron'");
if ($result) {
while ($row = db_fetch_object($result)) {
set_time_limit(5);
node_delete($row->nid);
}
}
drupal_uninstall_schema('patron');
// Clear the cache tables.
cache_clear_all(null, 'cache');
cache_clear_all(null, 'cache_filter');
cache_clear_all(null, 'cache_menu');
cache_clear_all(null, 'cache_page');
drupal_set_message(t('Library patron module successfully uninstalled'));
}