You are here

function profanity_ctools_export_ui_form in Profanity 7

Implements hook_ctools_export_ui_form().

1 string reference to 'profanity_ctools_export_ui_form'
profanity_ctools_export_ui.inc in plugins/export_ui/profanity_ctools_export_ui.inc
Profanity export UI plugin.

File

plugins/export_ui/profanity_ctools_export_ui.inc, line 36
Profanity export UI plugin.

Code

function profanity_ctools_export_ui_form(&$form, &$form_state) {
  $list = $form_state['item'];
  $form['words'] = array(
    '#type' => 'textarea',
    '#title' => t('Words'),
    '#default_value' => $list->words,
    '#required' => TRUE,
    '#description' => t('The words to match against, separated by commas.'),
  );
  $form['replacement_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Replacement mode'),
    '#default_value' => $list->replacement_mode,
    '#required' => TRUE,
    '#options' => array(
      0 => t('Replace found words with a character repeated to match the length of the original word'),
      1 => t('Replace found words with a phrase'),
    ),
  );
  $form['replacement_character'] = array(
    '#type' => 'textfield',
    '#title' => t('Replacement character'),
    '#default_value' => $list->replacement_character,
    '#maxlength' => 2,
    '#size' => 6,
    '#states' => array(
      'required' => array(
        ':input[name="replacement_mode"]' => array(
          'value' => 0,
        ),
      ),
      'visible' => array(
        ':input[name="replacement_mode"]' => array(
          'value' => 0,
        ),
      ),
    ),
  );
  $form['replacement_phrase'] = array(
    '#type' => 'textfield',
    '#title' => t('Replacement phrase'),
    '#default_value' => $list->replacement_phrase,
    '#maxlength' => 128,
    '#states' => array(
      'required' => array(
        ':input[name="replacement_mode"]' => array(
          'value' => 1,
        ),
      ),
      'visible' => array(
        ':input[name="replacement_mode"]' => array(
          'value' => 1,
        ),
      ),
    ),
  );
  $form['case_sensitive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Match words as case sensitive'),
    '#default_value' => $list->case_sensitive,
  );
  $form['match_partial'] = array(
    '#type' => 'checkbox',
    '#title' => t('Match partial occurances of words'),
    '#default_value' => $list->match_partial,
  );
  $form['#submit'][] = 'profanity_crud_form_submit';
}