You are here

public function views_handler_filter_node_status::query in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 modules/node/views_handler_filter_node_status.inc \views_handler_filter_node_status::query()
  2. 6.2 modules/node/views_handler_filter_node_status.inc \views_handler_filter_node_status::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter::query

File

modules/node/views_handler_filter_node_status.inc, line 37
Definition of views_handler_filter_node_status.

Class

views_handler_filter_node_status
Filter by published status.

Code

public function query() {
  $table = $this
    ->ensure_my_table();
  $this->query
    ->add_where_expression($this->options['group'], "{$table}.status = 1 OR ({$table}.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0 AND ***VIEW_OWN_UNPUBLISHED_NODES*** = 1) OR ***BYPASS_NODE_ACCESS*** = 1");
}