You are here

function better_revisions_admin in Better Revisions 7

1 string reference to 'better_revisions_admin'
better_revisions_menu in ./better_revisions.module

File

./better_revisions.module, line 120
Main enhanced revisions module file.

Code

function better_revisions_admin() {
  $form = array();
  $form['br_require'] = array(
    '#type' => 'checkbox',
    '#title' => t('Require revision type selection'),
    '#default_value' => variable_get('br_require', FALSE),
    '#description' => t('Will only be required if <em>Create new revision</em> is checked.'),
  );
  $form['br_list_title'] = array(
    '#type' => 'textfield',
    '#title' => 'Revision list title',
    '#default_value' => variable_get('br_list_title', BF_DEFAULT_TITLE),
    '#required' => TRUE,
  );
  $form['br_list_options'] = array(
    '#type' => 'textarea',
    '#title' => 'Revision list options',
    '#default_value' => variable_get('br_list_options', BF_DEFAULT_OPTS),
    '#required' => TRUE,
    '#description' => 'Enter options, one per line',
  );
  $form['br_list_help'] = array(
    '#type' => 'textfield',
    '#title' => 'Revision list help text',
    '#default_value' => variable_get('br_list_help', ''),
  );
  $form['br_add_txt'] = array(
    '#type' => 'radios',
    '#title' => t('Add an open text area for revision notes'),
    '#default_value' => variable_get('br_add_txt', 0),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes (optional)'),
      2 => t('Yes (required)'),
    ),
  );
  $form['br_area_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title for the revision notes box'),
    '#default_value' => variable_get('br_area_title', BF_DEFAULT_AREA_TITLE),
    '#states' => array(
      'visible' => array(
        array(
          ':input[name="br_add_txt"]' => array(
            'value' => 1,
          ),
        ),
        array(
          ':input[name="br_add_txt"]' => array(
            'value' => 2,
          ),
        ),
      ),
    ),
  );
  return system_settings_form($form);
}