You are here

function uninstall_front_page in Front Page 5

this function uninstalls the front page module

1 string reference to 'uninstall_front_page'
front_page_menu in ./front_page.module
this function sets the necessary paths etc. so drupal knows where to find the front_page

File

./front_page.module, line 166

Code

function uninstall_front_page() {
  $roles = "";
  $roles = user_roles();
  foreach (element_children($roles) as $role) {
    $rolename = $roles[$role];
    variable_del('front_' . $role . '_text');

    // text settings
    variable_del('front_' . $role . '_type');

    // type
    variable_del('front_' . $role . '_redirect');

    //redirect
    variable_del('front_' . $role . '_php');

    // php filter
  }
  variable_del('front_page_breadcrumb', '');

  // home breadcrumb override switch
  variable_del('front_page_breadcrumb_redirect', '');

  // home override redirect
  variable_del('special_notice_time', '');

  // special notice time
  variable_del('special_notice_text', '');

  // special notice text

  //reset some important site variables
  variable_set('site_frontpage', 'node');

  //reset the default front page for the site back to node
  variable_set('uninstall_front_setting', '0');
  drupal_set_message(t('All front page settings have been removed from your database. You may now disable the module below and then delete the front page files from your server.'));
  $module = 'front_page';
  $status = '0';
  module_disable($module);
  db_query("UPDATE {system} SET status = 0 WHERE name = '%s'", $module);
  drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
  drupal_goto('admin/settings/modules');
}