You are here

revisioning.install in Revisioning 6.3

Install and uninstall hooks for Revisioning module.

File

revisioning.install
View source
<?php

/**
 * @file
 * Install and uninstall hooks for Revisioning module.
 */

/**
 * Implementation of hook_install().
 */
function revisioning_install() {

  // Panels override fix, see http://drupal.org/node/519924.
  variable_set('page_manager_override_anyway', TRUE);
}

/**
 * Implementation of hook_update_N().
 */
function revisioning_update_6307() {
  $ret = array();

  // Panels override fix, see http://drupal.org/node/519924.
  variable_set('page_manager_override_anyway', TRUE);
  return $ret;
}

/**
 * Implementation of hook_update_N().
 *
 * Alteration of Workflow form is realised through Workflow Extensions module,
 * removing the need to change weights.
 * In fact change of weight is related to the trouble described in [#482126],
 * comment #9,
 */
function revisioning_update_6313() {
  $ret = array();
  $ret[] = update_sql("UPDATE {system} SET weight = 0 WHERE name = 'revisioning'");
  return $ret;
}

/**
 * Implementation of hook_uninstall().
 */
function revisioning_uninstall() {

  // Delete all revisioning_* variables at once
  db_query("DELETE FROM {variable} WHERE name LIKE 'revisioning_%%'");
  variable_del('page_manager_override_anyway');

  // see above
  foreach (node_get_types() as $type) {

    // Maybe revisioning_auto_publish_<type> and new_revisions_<type>
    // should be used in array, like 'revision_moderation' below?
    variable_del('new_revisions_' . $type->type);

    // Remove 'revision_moderation' from all node_options_<content_type> variables
    $variable_name = 'node_options_' . $type->type;
    if ($node_options = variable_get($variable_name, NULL)) {
      $node_options = array_diff($node_options, array(
        'revision_moderation',
      ));
      variable_set($variable_name, $node_options);
    }
  }
}

Functions

Namesort descending Description
revisioning_install Implementation of hook_install().
revisioning_uninstall Implementation of hook_uninstall().
revisioning_update_6307 Implementation of hook_update_N().
revisioning_update_6313 Implementation of hook_update_N().