$vid, 'tid' => $tid, 'depth' => $depth, ); $config_id = "content-taxonomy-$field_name"; $vocabulary = taxonomy_vocabulary_load($vid); $defaults = array( // Enable the save_lineage setting by default if the multiple parents // vocabulary option is enabled. 'save_lineage' => (int) ($vocabulary->hierarchy == 2), 'editability' => array( 'max_levels' => min($depth, _hs_taxonomy_hierarchical_select_get_depth($vid)), ), ); // If this config is being created (not edited), then enable the dropbox if // this is a "multiple values" field. This allows for an intuitive // transition to a Hierarchical Select widget. if (variable_get('hsd_config_'. $config_id, FALSE) === FALSE) { $defaults['dropbox']['status'] = $field['multiple']; } $strings = array( 'hierarchy' => t('vocabulary'), 'hierarchies' => t('vocabularies'), 'item' => t('term'), 'items' => t('terms'), 'item_type' => t('term type'), 'entity' => t('node'), 'entities' => t('nodes'), ); $max_hierarchy_depth = min(($depth == 0) ? 9 : $depth, _hs_taxonomy_hierarchical_select_get_depth($vid)); $preview_is_required = $field['required']; $form['hierarchical_select_config'] = hierarchical_select_common_config_form($module, $params, $config_id, $defaults, $strings, $max_hierarchy_depth, $preview_is_required); $form['link'] = array( '#value' => l('Back to the field configuration', 'admin/content/node-type/'. str_replace('_', '-', $content_type['type']) .'/fields/'. $field_name), '#prefix' => '