function ctools_context_query_string_create_query_string

Create a context from manual configuration.

1 string reference to 'ctools_context_query_string_create_query_string'
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 28

Code

function ctools_context_query_string_create_query_string($empty, $data = NULL, $conf = FALSE) {
    $context = new ctools_context('query_string');
    $context->plugin = 'query_string';
    if ($empty) {
        return $context;
    }
    if ($conf) {
        if (!empty($_GET[$data['key']])) {
            $context->data = $_GET[$data['key']];
        }
        else {
            $context->data = $data['fallback_value'];
        }
    }
    return $context;
}