You are here

function tmgmt_node_ui_handler_filter_node_translatable_types::query in Translation Management Tool 7

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

sources/node/views/handlers/tmgmt_node_handler_filter_node_translatable_types.inc, line 16
Contains tmgmt_node_ui_handler_filter_node_translatable_types.

Class

tmgmt_node_ui_handler_filter_node_translatable_types
Limits node types to those enabled for content translation.

Code

function query() {
  $this
    ->ensure_my_table();
  $valid_types = array_keys(tmgmt_source_translatable_item_types('node'));
  if ($valid_types) {
    $this->query
      ->add_where($this->options['group'], "{$this->table_alias}.{$this->real_field}", array_values($valid_types), 'IN');
  }
  else {

    // There are no valid translatable node types, do not return any results.
    $this->query
      ->add_where_expression($this->options['group'], '1 = 0');
  }
}