function hashtags_configuration_form in Hashtags 7
Same name and namespace in other branches
- 7.2 hashtags.module \hashtags_configuration_form()
Hashtags configuration form
1 string reference to 'hashtags_configuration_form'
- hashtags_menu in ./
hashtags.module - Implements hook_menu().
File
- ./
hashtags.module, line 789
Code
function hashtags_configuration_form($form, &$form_state) {
$field_name = variable_get('hashtags_terms_field', '');
$types = node_type_get_names();
$types_keys = array_keys($types);
$default_values = array();
$vocabulary = taxonomy_vocabulary_load(variable_get('hashtags_vocabulary', 0));
foreach ($types_keys as $type) {
if (field_info_instance('node', $field_name, $type)) {
$default_values[$type] = $type;
}
else {
$default_values[$type] = 0;
}
}
$values = array();
$form['hashtags_content_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Content types'),
'#options' => $types,
'#default_value' => $default_values,
'#description' => t('Check for what content types you want Hashtags functionality to have'),
);
$form['advanced'] = array(
'#title' => t('Advanced'),
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['advanced']['clean_orphaned_terms'] = array(
'#type' => 'submit',
'#value' => t('Clean orphaned hashtags'),
'#submit' => array(
'hashtags_clean_orphaned_terms_submit',
),
);
$form['advanced']['clean_hash_symbol'] = array(
'#type' => 'submit',
'#value' => t('Clean hash symbol'),
'#submit' => array(
'hashtags_clean_hash_symbol_submit',
),
);
$form['advanced']['import_to_index'] = array(
'#type' => 'submit',
'#value' => t('Import hashtags to index'),
'#submit' => array(
'hashtags_import_to_index_submit',
),
);
$form['#submit'][] = 'hashtags_fields_content_types_submit';
return system_settings_form($form);
}