Projet

Général

Profil

Paste
Télécharger (660 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / variable / variable_views / includes / views_handler_field_variable_value.inc @ 7942932f

1
<?php
2
/**
3
 * A handler to display data from variable_values
4
 *
5
 * @ingroup views_field_handlers
6
 */
7
class views_handler_field_variable_value extends views_handler_field {
8
  function construct() {
9
    parent::construct();
10
    // Be explicit about the table we are using.
11
    $this->additional_fields['name'] = array('table' => 'variable', 'field' => 'name');
12
  }
13

    
14
  /**
15
   * Render value using variable name for formatting.
16
   */
17
  function render($values) {
18
    $name = $this->get_value($values, 'name');
19
    $variable = variable_build($name);
20
    $variable['value'] = unserialize($this->get_value($values));
21
    return variable_format_value($variable);
22
  }
23
}