function node_build_filter_query

Applies filters for node administration filters based on session.

Parameters

$query: A SelectQuery to which the filters should be applied.

1 call to node_build_filter_query()
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.

File

modules/node/node.admin.inc, line 127

Code

function node_build_filter_query(SelectQueryInterface $query) {
    // Build query
    $filter_data = isset($_SESSION['node_overview_filter']) ? $_SESSION['node_overview_filter'] : array();
    foreach ($filter_data as $index => $filter) {
        list($key, $value) = $filter;
        switch ($key) {
            case 'status':
                // Note: no exploitable hole as $key/$value have already been checked when submitted
                list($key, $value) = explode('-', $value, 2);
            case 'type':
            case 'language':
                $query->condition('n.' . $key, $value);
                break;
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.