function devel_generate_vocab_form_submit

FormAPI submission to generate taxonomy vocabularies.

File

devel_generate/devel_generate.module, line 356

Code

function devel_generate_vocab_form_submit($form, &$form_state) {
    $values = $form_state['values'];
    module_load_include('inc', 'devel_generate');
    if ($values['kill_taxonomy']) {
        devel_generate_delete_vocabularies();
        drupal_set_message(t('Deleted existing vocabularies.'));
    }
    $new_vocs = devel_generate_vocabs($values['num_vocabs'], $values['title_length']);
    if (!empty($new_vocs)) {
        drupal_set_message(t('Created the following new vocabularies: !vocs', array(
            '!vocs' => implode(', ', $new_vocs),
        )));
    }
}