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

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

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


Revision 1.2 - (show annotations) (download) (as text)
Thu Oct 23 09:14:56 2008 UTC (13 months ago) by snpower
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +6 -1 lines
File MIME type: text/x-php
coding / commenting style changes.
1 <?php
2 // $Id: country_code_handler_field_node_country.inc,v 1.1 2008/10/21 00:18:23 nedjo Exp $
3
4 /**
5 * @file
6 * Field handler for country code module.
7 */
8
9 /**
10 * Field handler to translate a node language into a readable form of its country.
11 */
12 class country_code_handler_field_node_country extends views_handler_field_node {
13 function construct() {
14 parent::construct();
15 $this->additional_fields['language'] = 'language';
16 }
17
18 function query() {
19 $this->ensure_my_table();
20 $this->add_additional_fields();
21 }
22
23 function render($values) {
24 $language = $values->{$this->aliases['language']};
25 if ($country_code = strtolower(substr($language, 3))) {
26 if ($value = country_code_country_name($country_code)) {
27 return $this->render_link(check_plain($value), $values);
28 }
29 }
30 return '';
31 }
32 }
33

  ViewVC Help
Powered by ViewVC 1.1.2