You are here

function ctools_search_form_content_type_edit_form in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/content_types/search/search_form.inc \ctools_search_form_content_type_edit_form()

Returns an edit form for custom type settings.

File

plugins/content_types/search/search_form.inc, line 82

Code

function ctools_search_form_content_type_edit_form(&$form, &$form_state) {
  $conf = $form_state['conf'];
  $types = array();
  foreach (module_implements('search') as $name) {
    $types[$name] = module_invoke($name, 'search', 'name', TRUE);
  }
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Search type'),
    '#options' => $types,
    '#default_value' => $conf['type'],
  );
  $form['form'] = array(
    '#type' => 'select',
    '#title' => t('Search form'),
    '#options' => array(
      'simple' => t('Simple'),
      'advanced' => t('Advanced'),
    ),
    '#default_value' => $conf['form'],
    '#description' => t('The advanced form may have additional options based upon the search type. For example the advanced content (node) search form will allow searching by node type and taxonomy term.'),
  );
  $form['path_type'] = array(
    '#prefix' => '<div class="container-inline">',
    '#type' => 'select',
    '#title' => t('Path'),
    '#options' => array(
      'default' => t('Default'),
      'same' => t('Same page'),
      'custom' => t('Custom'),
    ),
    '#default_value' => $conf['path_type'],
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#default_value' => $conf['path'],
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'edit-path-type' => array(
        'custom',
      ),
    ),
    '#suffix' => '</div>',
  );
  $form['override_prompt'] = array(
    '#prefix' => '<div class="container-inline">',
    '#type' => 'checkbox',
    '#default_value' => $conf['override_prompt'],
    '#title' => t('Override default prompt'),
  );
  $form['prompt'] = array(
    '#type' => 'textfield',
    '#default_value' => $conf['prompt'],
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'edit-override-prompt' => array(
        1,
      ),
    ),
    '#suffix' => '</div>',
  );
}