You are here

function ctools_term_list_content_type_edit_form in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 plugins/content_types/term_context/term_list.inc \ctools_term_list_content_type_edit_form()

Returns an edit form for the custom type.

File

plugins/content_types/term_context/term_list.inc, line 121

Code

function ctools_term_list_content_type_edit_form($form, &$form_state) {
  $conf = $form_state['conf'];
  $form['type'] = array(
    '#type' => 'radios',
    '#title' => t('Which terms'),
    '#options' => ctools_admin_term_list_options(),
    '#default_value' => $conf['type'],
    '#prefix' => '<div class="clearfix no-float">',
    '#suffix' => '</div>',
  );
  $form['include_current_term'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include the current term in the list'),
    '#default_value' => !empty($conf['include_current_term']),
    '#prefix' => '<div class="clearfix no-float">',
    '#suffix' => '</div>',
    '#states' => array(
      'invisible' => array(
        ':input[name="type"], unique1' => array(
          '!value' => 'child',
        ),
        ':input[name="type"], unique2' => array(
          '!value' => 'parent',
        ),
      ),
    ),
  );
  $form['list_type'] = array(
    '#type' => 'select',
    '#title' => t('List type'),
    '#options' => array(
      'ul' => t('Unordered'),
      'ol' => t('Ordered'),
    ),
    '#default_value' => $conf['list_type'],
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path'),
    '#default_value' => empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path'],
    '#description' => t('The path to use for the terms. You may use %tid to place the term id as part of the path; if let off, it will be appended to the end.'),
  );
  return $form;
}