function word_link_exchange_import_form in Word Link 8
Same name and namespace in other branches
- 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_import_form()
- 7 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_import_form()
Import form.
1 string reference to 'word_link_exchange_import_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 51 - Code for the Word link exchange module.
Code
function word_link_exchange_import_form() {
if (function_exists('taxonomy_vocabulary_get_names')) {
$vocabularies = taxonomy_vocabulary_get_names();
}
$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'),
);
if (!empty($vocabularies)) {
$form['taxonomy'] = array(
'#type' => 'details',
'#title' => t('Import from taxonomy'),
'#collapsed' => TRUE,
);
$form['taxonomy']['vocabularies'] = array(
'#type' => 'select',
'#title' => t('Select vocabularies'),
'#options' => $vocabularies,
'#multiple' => TRUE,
);
$form['taxonomy']['import_limit'] = array(
'#type' => 'textfield',
'#size' => 4,
'#maxlenghth' => 4,
'#default_value' => 250,
'#title' => t('Import limit'),
'#description' => t('This counts of terms will be processed by one page request.'),
);
}
$form['import'] = array(
'#type' => 'details',
'#title' => t('Import from file'),
'#collapsed' => TRUE,
);
$form['import']['file'] = array(
'#type' => 'file',
'#title' => t('CSV file'),
'#size' => 50,
'#description' => t('A comma separated (<em>.csv</em>) file.'),
);
$form['import']['delimiter'] = array(
'#type' => 'select',
'#title' => t('Delimiter'),
'#options' => $delimiter,
);
$form['import']['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['submit'] = array(
'#type' => 'submit',
'#value' => t('Import'),
);
return $form;
}