You are here

function homebox_uninstall in Homebox 6

Same name and namespace in other branches
  1. 6.3 homebox.install \homebox_uninstall()
  2. 6.2 homebox.install \homebox_uninstall()
  3. 7.3 homebox.install \homebox_uninstall()
  4. 7.2 homebox.install \homebox_uninstall()

Implementation of hook_uninstall().

File

./homebox.install, line 57
The install file for Home box allows the module to install (and uninstall) itself. This is required as this module uses its own table.

Code

function homebox_uninstall() {

  // Remove variables
  foreach (homebox_pages() as $page) {

    // Remove url_alias records for homebox
    db_query("DELETE FROM {url_alias} WHERE src = 'homebox/%d'", $page->pid);

    // Settings
    variable_del('homebox_column_count_' . $page->pid);
    variable_del('homebox_users_use_colors_' . $page->pid);
    variable_del('homebox_cache_enabled_' . $page->pid);

    // Colors
    for ($i = 0; $i < HOMEBOX_NUMBER_OF_COLOURS; $i++) {
      variable_del('homebox_color_' . $page->pid . '_' . $i);
    }
  }

  // Remove schema
  drupal_uninstall_schema('homebox');
}