function ctools_search_result_content_type_edit_form

Returns an edit form for custom type settings.

File

plugins/content_types/search/search_result.inc, line 119

Code

function ctools_search_result_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['log'] = array(
        '#type' => 'checkbox',
        '#default_value' => $conf['log'],
        '#title' => t('Record a watchdog log entry when searches are made'),
    );
    $form['override_empty'] = array(
        '#type' => 'checkbox',
        '#default_value' => $conf['override_empty'],
        '#title' => t('Override "no result" text'),
    );
    $form['empty_title'] = array(
        '#title' => t('Title'),
        '#type' => 'textfield',
        '#default_value' => $conf['empty_title'],
        '#dependency' => array(
            'edit-override-empty' => array(
                1,
            ),
        ),
    );
    $form['empty_field'] = array(
        '#type' => 'text_format',
        '#title' => t('No result text'),
        '#default_value' => $conf['empty'],
        '#format' => $conf['empty_format'],
        '#dependency' => array(
            'edit-override-empty' => array(
                1,
            ),
        ),
    );
    $form['override_no_key'] = array(
        '#type' => 'checkbox',
        '#default_value' => $conf['override_no_key'],
        '#title' => t('Display text if no search keywords were submitted'),
    );
    $form['no_key_title'] = array(
        '#title' => t('Title'),
        '#type' => 'textfield',
        '#default_value' => $conf['no_key_title'],
        '#dependency' => array(
            'edit-override-no-key' => array(
                1,
            ),
        ),
    );
    $form['no_key_field'] = array(
        '#type' => 'text_format',
        '#title' => t('No result text'),
        '#default_value' => $conf['no_key'],
        '#format' => $conf['no_key_format'],
        '#dependency' => array(
            'edit-override-no-key' => array(
                1,
            ),
        ),
    );
    return $form;
}