You are here

readonlymode.install in Read only mode 8

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

Install and update hooks for the Read Only Mode module.

File

readonlymode.install
View source
<?php

/**
 * @file
 * Install and update hooks for the Read Only Mode module.
 */

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

  // Set the module weight to run as last.
  module_set_weight('readonlymode', 9999);
}

/**
 * Move the Read Only Mode settings from variable to config.
 *
 * @ingroup config_upgrade
 */
function readonlymode_update_8001() {
  update_variables_to_config('readonlymode.settings', [
    'site_readonly' => 'enabled',
    'site_readonly_url' => 'url',
    'site_readonly_message' => 'messages.default',
    'site_readonly_forms_allowed' => 'forms.additional.edit',
    'site_readonly_forms_viewonly' => 'forms.additional.view',
  ]);
}

Functions

Namesort descending Description
readonlymode_install Implements hook_install().
readonlymode_update_8001 Move the Read Only Mode settings from variable to config.