You are here

function advpoll_converter_form in Advanced Poll 7.3

Same name and namespace in other branches
  1. 7 advpoll_converter/advpoll_converter.admin.inc \advpoll_converter_form()
  2. 7.2 advpoll_converter/advpoll_converter.admin.inc \advpoll_converter_form()

Administrative form for converter.

1 string reference to 'advpoll_converter_form'
advpoll_converter_menu in advpoll_converter/advpoll_converter.module
Implements hook_menu().

File

advpoll_converter/advpoll_converter.admin.inc, line 10
Advanced Poll Converter Module Admin Forms and Functions.

Code

function advpoll_converter_form($form, $form_state) {
  $form = array(
    '#attributes' => array(
      'class' => array(
        'advpoll-converter-form',
      ),
    ),
  );
  $form['info'] = array(
    '#title' => t('Advanced Poll Converter'),
    '#description' => t('Select core Drupal polls to convert to Advanced polls. As always with any conversion process, be sure to back up your data.'),
    '#type' => 'fieldset',
    '#tree' => FALSE,
  );
  $polls = _advpoll_converter_get_polls();
  if ($polls) {
    $options = array(
      0 => t('No'),
      1 => t('Yes'),
    );
    $form['info']['advpoll_converter_delete'] = array(
      '#title' => t('Delete source polls?'),
      '#type' => 'radios',
      '#options' => $options,
      '#default_value' => 1,
      '#description' => t('When the process is run, should original polls be deleted?'),
    );
    $form['info']['advpoll_converter_select'] = array(
      '#type' => 'select',
      '#title' => t('Select polls to convert.'),
      '#options' => $polls,
      '#multiple' => TRUE,
      '#description' => t('Select the polls to convert.'),
      '#size' => 10,
    );
    $form['info']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Convert'),
    );
  }
  else {
    $form['info']['message'] = array(
      '#type' => 'item',
      '#markup' => t('There are currently no polls to convert.'),
    );
  }
  return $form;
}