function panels_mini_uninstall in Panels 5.2
Same name and namespace in other branches
- 6.3 panels_mini/panels_mini.install \panels_mini_uninstall()
- 6.2 panels_mini/panels_mini.install \panels_mini_uninstall()
- 7.3 panels_mini/panels_mini.install \panels_mini_uninstall()
Implementation of hook_uninstall().
File
- panels_mini/
panels_mini.install, line 51
Code
function panels_mini_uninstall() {
$result = db_query("SELECT * FROM {panels_mini} ORDER BY title");
$panels_exists = db_table_exists('panels_display');
while ($panel_mini = db_fetch_object($result)) {
// Delete all associated displays.
if (!function_exists('panels_delete_display')) {
require_once drupal_get_path('module', 'panels') . '/panels.module';
}
if ($panels_exists) {
panels_delete_display($panel_mini->did);
}
// Delete all configured blocks.
db_query("DELETE FROM {blocks} WHERE module = 'panels_mini' AND delta = %d", $panel_mini->pid);
}
// Finally, delete all mini panels.
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_query("DROP TABLE {panels_mini}");
db_query("DROP SEQUENCE {panels_mini}_pid_seq");
break;
case 'mysql':
case 'mysqli':
db_query("DROP TABLE IF EXISTS {panels_mini}");
break;
}
}