You are here

function node_revision_generate_form in Node Revision Delete 7.3

Generate revisions form.

Parameters

array $form: The form element.

array $form_state: The form state.

Return value

array The form.

1 string reference to 'node_revision_generate_form'
node_revision_generate_menu in modules/node_revision_generate/node_revision_generate.module
Implements hook_menu().

File

modules/node_revision_generate/node_revision_generate.module, line 84

Code

function node_revision_generate_form(array $form, array &$form_state) {
  $form = array();
  $form['bundles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Content types'),
    '#options' => node_type_get_names(),
    '#required' => TRUE,
  );
  $form['revisions_number'] = array(
    '#type' => 'textfield',
    '#title' => t('Revisions number'),
    '#default_value' => 1,
    '#description' => t('The number of revisions that will be created for each node of the selected content types.'),
    '#required' => TRUE,
  );
  $form['age'] = array(
    '#type' => 'fieldset',
    '#title' => t('Revisions age'),
    '#description' => t('The age between each generated revision.'),
    '#required' => TRUE,
  );
  $form['age']['number'] = array(
    '#type' => 'textfield',
    '#default_value' => 1,
    '#required' => TRUE,
  );
  $time_options = array(
    '86400' => t('Day'),
    '604800' => t('Week'),
    '2592000' => t('Month'),
  );
  $form['age']['time'] = array(
    '#type' => 'select',
    '#options' => $time_options,
  );
  $form['description'] = array(
    '#type' => 'item',
    '#markup' => t('The first revision will be generated starting from the created date of the last node revision and the last one will not have a date in the future. So, depending on this maybe we will not generate the number of revisions you expect.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Generate revisions'),
  );

  // Adding the donation text.
  $form['#prefix'] = _node_revision_delete_get_donation_text();
  return $form;
}