/[drupal]/contributions/modules/ubercart/uc_product/views/uc_product_handler_field_price.inc
ViewVC logotype

Diff of /contributions/modules/ubercart/uc_product/views/uc_product_handler_field_price.inc

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

revision 1.1.2.6 by islandusurper, Tue Oct 20 20:58:06 2009 UTC revision 1.1.2.7 by islandusurper, Fri Nov 20 15:00:47 2009 UTC
# Line 14  class uc_product_handler_field_price ext Line 14  class uc_product_handler_field_price ext
14      parent::options($options);      parent::options($options);
15    
16      $options['format'] = 'uc_price';      $options['format'] = 'uc_price';
17        $options['revision'] = 'themed';
18    }    }
19    
20    function options_form(&$form, &$form_state) {    function options_form(&$form, &$form_state) {
# Line 32  class uc_product_handler_field_price ext Line 33  class uc_product_handler_field_price ext
33        '#weight' => 1,        '#weight' => 1,
34      );      );
35    
36        $form['revision'] = array(
37          '#title' => t('Revision'),
38          '#type' => 'select',
39          '#options' => array(
40            'original' => t('Original'),
41            'altered' => t('Altered'),
42            'formatted-original' => t('Formatted original'),
43            'formatted' => t('Formatted'),
44            'themed-original' => t('Themed original'),
45            'themed' => t('Themed'),
46          ),
47          '#default_value' => $options['revision'],
48          '#process' => array('views_process_dependency'),
49          '#dependency' => array('radio:options[format]' => array('uc_price')),
50          '#weight' => 1,
51        );
52    
53      // Change weight and dependency of the previous field on the parent numeric ones      // Change weight and dependency of the previous field on the parent numeric ones
54      $weight = 2;      $weight = 2;
55      foreach (array('set_precision', 'precision', 'decimal', 'separator', 'prefix', 'suffix') as $field) {      foreach (array('set_precision', 'precision', 'decimal', 'separator', 'prefix', 'suffix') as $field) {
# Line 49  class uc_product_handler_field_price ext Line 67  class uc_product_handler_field_price ext
67      }      }
68    }    }
69    
   function query() {  
     $this->ensure_my_table();  
     $this->add_additional_fields();  
   }  
   
70    function render($values) {    function render($values) {
71      if ($this->options['format'] == 'numeric') {      if ($this->options['format'] == 'numeric') {
72        return parent::render($values);        return parent::render($values);
# Line 62  class uc_product_handler_field_price ext Line 75  class uc_product_handler_field_price ext
75      if ($this->options['format'] == 'uc_price') {      if ($this->options['format'] == 'uc_price') {
76        $product = node_load($values->{$this->aliases['nid']});        $product = node_load($values->{$this->aliases['nid']});
77        $context = array(        $context = array(
78          'revision' => 'themed',          'revision' => $this->options['revision'],
79          'type' => 'product',          'type' => 'product',
80          'class' => array(          'class' => array(
81            'product',            'product',

Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

  ViewVC Help
Powered by ViewVC 1.1.3