You are here

readonlymode.install in Read only mode 7

Same filename and directory in other branches
  1. 8 readonlymode.install
  2. 6 readonlymode.install

Update hook and uninstaller for the Read Only Mode module

File

readonlymode.install
View source
<?php

/**
 * @file
 * Update hook and uninstaller for the Read Only Mode module
 */

/**
 * Implements hook_install().
 */
function readonlymode_install() {

  // Set our weight so that we execute last, to avoid other modules
  // adding to forms after we clear them out.
  readonlymode_update_7100();
}

/**
 * Implements hook_uninstall().
 */
function readonlymode_uninstall() {
  variable_del('site_readonly');
  variable_del('site_readonly_forms_allowed');
  variable_del('site_readonly_forms_viewonly');
  variable_del('site_readonly_message_form_not_saved');
  variable_del('site_readonly_message');
  variable_del('site_readonly_url');
}

/**
 * Update our weight so that we execute last.
 *
 * This avoids other modules adding to forms after we clear them out.
 */
function readonlymode_update_7100() {
  db_update('system')
    ->fields(array(
    'weight' => 9999,
  ))
    ->condition('type', 'module', '=')
    ->condition('name', 'readonlymode', '=')
    ->execute();
}

Functions

Namesort descending Description
readonlymode_install Implements hook_install().
readonlymode_uninstall Implements hook_uninstall().
readonlymode_update_7100 Update our weight so that we execute last.