function ctools_context_query_string_settings_form

Form builder; settings for the context.

1 string reference to 'ctools_context_query_string_settings_form'
query_string.inc in plugins/contexts/query_string.inc
Context plugin that can extract arbitrary values from the query string.

File

plugins/contexts/query_string.inc, line 50

Code

function ctools_context_query_string_settings_form($form, &$form_state) {
    $form['key'] = array(
        '#title' => t('Query string key'),
        '#description' => t('Enter the key of the value that must be returned from the query string.'),
        '#type' => 'textfield',
        '#required' => TRUE,
    );
    if (isset($form_state['conf']['key'])) {
        $form['key']['#default_value'] = $form_state['conf']['key'];
    }
    $form['fallback_value'] = array(
        '#title' => t('Fallback value'),
        '#description' => t('Enter a value that must be returned if the above specified key does not exist in the query string.'),
        '#type' => 'textfield',
    );
    if (!empty($form_state['conf']['fallback_value'])) {
        $form['fallback_value']['#default_value'] = $form_state['conf']['fallback_value'];
    }
    return $form;
}