/[drupal]/contributions/modules/country_code/country_code_handler_filter_node_country_current.inc
ViewVC logotype

Contents of /contributions/modules/country_code/country_code_handler_filter_node_country_current.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Tue Oct 28 20:46:34 2008 UTC (12 months, 4 weeks ago) by nedjo
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +3 -3 lines
File MIME type: text/x-php
Issue #326726, refactor views filters to work with new global language.
1 <?php
2 // $Id: country_code_handler_filter_node_country_current.inc,v 1.4 2008/10/23 09:14:56 snpower Exp $
3
4 /**
5 * @file
6 * Implementation of a views current country filter for the country code module.
7 */
8
9 /**
10 * Filter by country.
11 */
12 class country_code_handler_filter_node_country_current extends views_handler_filter {
13
14 function query() {
15 $this->ensure_my_table();
16
17 $definition = array(
18 'table' => 'node',
19 'field' => 'tnid',
20 'left_table' => 'node',
21 'left_field' => 'tnid',
22 'extra' => array(
23 array(
24 'field' => 'language',
25 'value' => '***CURRENT_LANGUAGE***',
26 ),
27 ),
28 );
29
30 $join = new views_join();
31 $join->definition = $definition;
32 $join->construct();
33
34 $alias = $this->query->add_table('node', NULL, $join);
35 $this->query->add_where($this->options['group'], "$this->table_alias.language =
36 '%s' OR ($this->table_alias.language =
37 '%s' AND $alias.nid IS NULL)", array('***CURRENT_LANGUAGE***', '***COUNTRY_CODE_LANGUAGE***'));
38 }
39
40 }

  ViewVC Help
Powered by ViewVC 1.1.2