/[drupal]/contributions/modules/cck/includes/cck.term.inc
ViewVC logotype

Contents of /contributions/modules/cck/includes/cck.term.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Sat Jul 11 00:33:00 2009 UTC (4 months, 2 weeks ago) by yched
Branch: MAIN
File MIME type: text/x-php
#491196 by bangpound; Add support code for the in-progress 'taxo as field' work.
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_field_settings_form()
6 * on behalf of core List module.
7 */
8 function taxonomy_field_settings_form($field, $instance) {
9 // Get the right values for allowed_values_function, which is a core setting.
10 $options = array();
11 $vocabularies = taxonomy_get_vocabularies();
12 foreach ($vocabularies as $vocabulary) {
13 $options[$vocabulary->vid] = $vocabulary->name;
14 }
15 $form['allowed_values'] = array(
16 '#tree' => TRUE,
17 );
18 foreach ($field['settings']['allowed_values'] as $delta => $tree) {
19 $form['allowed_values'][$delta]['vid'] = array(
20 '#type' => 'select',
21 '#title' => t('Vocabulary'),
22 '#default_value' => $tree['vid'],
23 '#options' => $options,
24 '#required' => TRUE,
25 '#description' => t('The vocabulary which supplies the options for this field.'),
26 );
27 $form['allowed_values'][$delta]['parent'] = array(
28 '#type' => 'value',
29 '#value' => $tree['parent'],
30 );
31 }
32
33 return $form;
34 }

  ViewVC Help
Powered by ViewVC 1.1.2