You are here

function _node_revision_delete_save_content_type_config in Node Revision Delete 7.3

Save the content type config variable.

Parameters

string $content_type: Content type machine name.

int $minimum_revisions_to_keep: Minimum number of revisions to keep.

int $minimum_age_to_delete: Minimum age in months of revision to delete.

int $when_to_delete: Number of inactivity months to wait for delete a revision.

1 call to _node_revision_delete_save_content_type_config()
_node_revision_delete_form_node_type_submit in ./node_revision_delete.module
Custom submit handler to save the configuration variables.

File

./node_revision_delete.helpers.inc, line 20
Helper functions.

Code

function _node_revision_delete_save_content_type_config($content_type, $minimum_revisions_to_keep, $minimum_age_to_delete, $when_to_delete) {

  // Getting the variables with the content types configuration.
  $node_revision_delete_track = variable_get('node_revision_delete_track');

  // Creating the content type info.
  $content_type_info = array(
    'minimum_revisions_to_keep' => $minimum_revisions_to_keep,
    'minimum_age_to_delete' => $minimum_age_to_delete,
    'when_to_delete' => $when_to_delete,
  );

  // Adding the info into te array.
  $node_revision_delete_track[$content_type] = $content_type_info;

  // Saving the values in the config.
  variable_set('node_revision_delete_track', $node_revision_delete_track);
}