You are here

function ctools_terms_from_node_settings_form in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/relationships/terms_from_node.inc \ctools_terms_from_node_settings_form()

Settings form for the relationship.

1 string reference to 'ctools_terms_from_node_settings_form'
terms_from_node.inc in plugins/relationships/terms_from_node.inc
Plugin to provide an relationship handler for all terms from node.

File

plugins/relationships/terms_from_node.inc, line 51
Plugin to provide an relationship handler for all terms from node.

Code

function ctools_terms_from_node_settings_form($conf) {
  $options = array();
  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
    $options[$vid] = $vocabulary->name;
  }
  $form['vid'] = array(
    '#title' => t('Vocabulary'),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $conf['vid'],
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
  );
  $form['concatenator'] = array(
    '#title' => t('Concatenator'),
    '#type' => 'select',
    '#options' => array(
      ',' => ', (AND)',
      '+' => '+ (OR)',
    ),
    '#default_value' => $conf['concatenator'],
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
    '#description' => t("When the value from this context is passed on to a view as argument, the terms can be concatenated in the form of 1+2+3 (for OR) or 1,2,3 (for AND)."),
  );
  return $form;
}