You are here

function node_revision_delete_update_7200 in Node Revision Delete 7.3

Same name and namespace in other branches
  1. 7.2 node_revision_delete.install \node_revision_delete_update_7200()

Sets max amount of revisions per content type.

File

./node_revision_delete.install, line 50
Install, update and uninstall functions for the Node Revision Delete module.

Code

function node_revision_delete_update_7200() {

  // If content types were selected, set the global max to each of them.
  $content_types = variable_get('node_revision_delete_content_type', '');
  if (!empty($content_types)) {
    $content_types = explode(',', $content_types);
    $max = variable_get('node_revision_delete_number');
    if ($max) {
      foreach ($content_types as $type) {
        variable_set('node_revision_delete_track_' . $type, 1);
        variable_set('node_revision_delete_number_' . $type, $max);
      }
    }
  }
  variable_del('node_revision_delete_number');
  variable_del('node_revision_delete_content_type');
}