You are here

function word_link_exchange_export_form in Word Link 7

Same name and namespace in other branches
  1. 8 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_export_form()
  2. 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_export_form()

Export taxonomy to word link form.

1 string reference to 'word_link_exchange_export_form'
word_link_exchange_menu in modules/word_link_exchange/word_link_exchange.module
Implements hook_menu().

File

modules/word_link_exchange/word_link_exchange.module, line 398
Code for the Word link exchange module.

Code

function word_link_exchange_export_form() {
  $form = array();
  $delimiter = array(
    'semicolon' => t('« ; » (Semicolon)'),
    'comma' => t('« , » (Comma)'),
    'tabulation' => t('«   » (Tabulation)'),
    'pipe' => t('« | » (Pipe)'),
    'space' => t('«   » (Space)'),
    'currency_sign' => t('« ¤ » (Currency sign)'),
    'custom_delimiter' => t('Custom delimiter'),
  );
  $line_ending = array(
    'unix' => t('Unix / Linux'),
    'mac' => t('Apple Mac'),
    'ms' => t('Microsoft DOS'),
  );
  $form['export'] = array(
    '#type' => 'fieldset',
    '#title' => t('Export to CSV file'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['export']['delimiter'] = array(
    '#type' => 'select',
    '#title' => t('Delimeter'),
    '#options' => $delimiter,
  );
  $form['export']['delimiter_custom'] = array(
    '#type' => 'textfield',
    '#title' => 'Custom delimiter',
    '#size' => 2,
    '#maxlength' => 1,
    '#description' => t('Specify your custom delimiter.'),
    '#states' => array(
      'visible' => array(
        ':input[name=delimiter]' => array(
          'value' => 'custom_delimiter',
        ),
      ),
    ),
  );
  $form['export']['line_ending'] = array(
    '#type' => 'select',
    '#title' => t('Line ending'),
    '#options' => $line_ending,
    '#description' => t('Choose the end of line to use.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Export'),
  );
  return $form;
}