You are here

function panels_term_settings_form in Panels 5.2

Same name and namespace in other branches
  1. 6.2 arguments/term.inc \panels_term_settings_form()

Settings form for the argument

1 string reference to 'panels_term_settings_form'
panels_term_panels_arguments in arguments/term.inc
@file arguments/term.inc

File

arguments/term.inc, line 74
arguments/term.inc

Code

function panels_term_settings_form($conf) {
  if (empty($conf)) {
    $conf = array(
      'input_form' => 'tid',
    );
  }
  $options = array();
  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
    $options[$vid] = $vocabulary->name;
  }
  $form['input_form'] = array(
    '#title' => t('Argument type'),
    '#type' => 'radios',
    '#options' => array(
      'tid' => t('Term ID'),
      'term' => t('Term name'),
    ),
    '#default_value' => $conf['input_form'],
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
  );
  $form['vids'] = array(
    '#title' => t('Vocabularies'),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#description' => t('You can restrict this argument to use the checked vocabularies. Arguments from non-conforming vocabularies will be ignored, and Panels will behave as if no argument were given. Leave all unchecked to impose no restriction.'),
    '#default_value' => $conf['vids'],
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
  );
  $form['own_default'] = array(
    '#title' => t('Use different default display'),
    '#type' => 'checkbox',
    '#description' => t('If checked, when this argument is present it will use its own display rather than the default. Vocabularies not selected in the "Own display" field will use this one.'),
    '#default_value' => $conf['own_default'],
  );
  $form['displays'] = array(
    '#title' => t('Own display'),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $conf['displays'],
    '#description' => t('Each checked vocabulary will get its own special display to layout its content. Only vocabularies set above should be set here. Vocabularies not set here will use the default display.'),
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
  );
  return $form;
}