function multichoice_uninstall in Quiz 6.6
Same name and namespace in other branches
- 8.6 question_types/quiz_multichoice/quiz_multichoice.install \multichoice_uninstall()
- 8.4 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 8.5 question_types/quiz_multichoice/quiz_multichoice.install \multichoice_uninstall()
- 5.2 multichoice.install \multichoice_uninstall()
- 6.2 multichoice.install \multichoice_uninstall()
- 6.3 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 6.4 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 6.5 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 7.6 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 7 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 7.4 question_types/multichoice/multichoice.install \multichoice_uninstall()
- 7.5 question_types/multichoice/multichoice.install \multichoice_uninstall()
Implementation of hook_uninstall()
File
- question_types/
multichoice/ multichoice.install, line 121 - Multichoice Install (a quiz question type)
Code
function multichoice_uninstall() {
drupal_uninstall_schema('multichoice');
// Delete from nodes and node_revisions.
/*
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query('DELETE FROM {node}, {node_revisions}, {quiz_node_question_properties} USING {node} LEFT JOIN {node_revisions} USING (nid) LEFT JOIN {quiz_node_question_properties} USING (nid) WHERE type IN ("multichoice")');
break;
case 'pgsql':
db_query("DELETE FROM {quiz_node_question_properties} WHERE nid IN (SELECT nid FROM {node} WHERE type IN ('multichoice'))");
db_query("DELETE FROM {node_revisions} WHERE nid IN (SELECT nid FROM {node} WHERE type IN ('multichoice'))");
db_query("DELETE FROM {node} WHERE type IN ('multichoice')");
break;
}
*/
// Truncate the cache so users don't run into any unexpected errors.
cache_clear_all('variables', 'cache');
// Inform the user that uninstall was sucessful.
drupal_set_message(t("The Multichoice module has been uninstalled. Multichoice nodes may still exist, but they will not function properly."));
}