Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Mayer committed Dec 15, 2009
1 parent 5b99edf commit ac3e945
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 1 addition & 2 deletions tagging.admin.inc
Expand Up @@ -2,8 +2,7 @@
/*
* Providing a administration interface for tagging.
*/
function tagging_admin_settings() {
$options = node_get_types('names');
function tagging_admin_settings() {
$form['tagging_show_max_suggestion'] = array(
'#type' => 'textfield',
'#title' => t('Maximum suggestions'),
Expand Down
26 changes: 15 additions & 11 deletions tagging.module
Expand Up @@ -39,17 +39,6 @@ function tagging_elements() {
*
*/
function tagging_form_alter(&$form, $form_state, $form_id) {
// Showing taxonomy settings. Lets show our settings also.
if ($form_id === 'taxonomy_form_vocabulary') {
$form['settings']['tagging_inject'] = array(
'#type' => 'checkbox',
'#title' => t('Tagging Widget'),
'#weight' => 10,
'#default_value' => variable_get('tagging_inject_'. $form['vid']['#value'], 0),
'#description' => t('Use the visual tagging-widget, when this taxonomy is shown to the user'),
);
$form['#submit'][] = 'tagging_form_vocabulary_submit';
}
// Check if we are editting a node and we actually have a tag taxonomy.
if ($form['#id'] === 'node-form' && isset($form['taxonomy']['tags'])) {
foreach ($form['taxonomy']['tags'] as $id => $values) {
Expand All @@ -62,6 +51,21 @@ function tagging_form_alter(&$form, $form_state, $form_id) {
}
}

/**
* Implementation of hook_form_ID_alter.
*
*/
function tagging_form_taxonomy_form_vocabulary_alter(&$form, $form_state ) {
$form['settings']['tagging_inject'] = array(
'#type' => 'checkbox',
'#title' => t('Tagging Widget'),
'#weight' => 10,
'#default_value' => variable_get('tagging_inject_'. $form['vid']['#value'], 0),
'#description' => t('Use the visual tagging-widget, when this taxonomy is shown to the user'),
);
$form['#submit'][] = 'tagging_form_vocabulary_submit';
}

/*
* Implementing hook_theme.
*/
Expand Down

0 comments on commit ac3e945

Please sign in to comment.