function ctools_search_form_content_type_edit_form

Returns an edit form for custom type settings.

File

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

Code

function ctools_search_form_content_type_edit_form($form, &$form_state) {
    $conf = $form_state['conf'];
    $types = array();
    foreach (search_get_info() as $module => $info) {
        $types[$module] = $info['title'];
    }
    $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'],
        '#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'],
        '#dependency' => array(
            'edit-override-prompt' => array(
                1,
            ),
        ),
        '#suffix' => '</div>',
    );
    return $form;
}