--- content_taxonomy_autocomplete.module 2009-08-19 04:42:30.000000000 -0500 +++ content_taxonomy_autocomplete.module 2009-08-31 13:15:20.000000000 -0500 @@ -92,10 +92,26 @@ function content_taxonomy_autocomplete_w '#description' => t('Use the Active Tags module to improve the usability of this autocomplete widget.'), ); } + if (module_exists('active_tags_popular')) { + $form['autocomplete']['active_tags_popular'] = array( + '#type' => 'checkbox', + '#title' => t('Active Tags Helper - Popular'), + '#weight' => 11, + '#default_value' => isset($widget['active_tags_popular']) ? $widget['active_tags_popular'] : 0, + '#description' => t('Adds additional helpers to the active tags widget to assist in adding popular tags to posts'), + ); + $form['autocomplete']['active_tags_popular_no'] = array( + '#type' => 'textfield', + '#title' => t('Number of popular tags to show'), + '#weight' => 12, + '#size' => 20, + '#default_value' => isset($widget['active_tags_popular_no']) ? $widget['active_tags_popular_no'] : 10, + ); + } return $form; case 'save': - return array('new_terms', 'extra_parent', 'maxlength', 'active_tags'); + return array('new_terms', 'extra_parent', 'maxlength', 'active_tags', 'active_tags_popular', 'active_tags_popular_no'); } } @@ -104,6 +120,10 @@ function _content_taxonomy_autocomplete_ if (!is_numeric($value) || intval($value) != $value || $value <= 0) { form_error($element, t('"Maximum length" must be a positive integer.')); } + + if (module_exists('active_tags_popular') && $element['#post']['active_tags_popular']) { + variable_set('active_tags_popular_no_'.$element['#post']['vid'], $element['#post']['active_tags_popular_no']); + } } /** @@ -173,7 +193,7 @@ function content_taxonomy_autocomplete_p $field_name = $element['#field_name']; $field = $form['#field_info'][$field_name]; $field_key = $element['#columns'][0]; - + $vid = $element['#vid']; $element[$field_key] = array( '#type' => 'textfield', '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : '', @@ -197,6 +217,12 @@ function content_taxonomy_autocomplete_p active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper'); } + if (module_exists('active_tags_popular') && $field['widget']['active_tags_popular']) { + active_tags_popular_enable_widget('#active_tags_popular'.$vid.'-'.$element['#id'].' '.'#' . $element['#id'] . '-value-wrapper'); + $element['#prefix'] = '
'; + $element['#suffix'] = '
'; + } + return $element; }