comparison views_calc.install @ 3:5635080385bd tip

Merge patch with 1.x-dev
author Franck Deroche <franck@defr.org>
date Fri, 07 Aug 2009 15:20:12 +0200
parents b0a976e17cc7
children
comparison
equal deleted inserted replaced
1:cedf71edacf5 3:5635080385bd
1 <?php 1 <?php
2 // $Id: views_calc.install,v 1.3 2008/09/16 18:03:08 karens Exp $ 2 // $Id: views_calc.install,v 1.5 2009/06/12 16:38:30 karens Exp $
3 /** 3 /**
4 * Implementation of hook_schema(). 4 * Implementation of hook_schema().
5 */ 5 */
6 function views_calc_schema() { 6 function views_calc_schema() {
7 $schema['views_calc_fields'] = array( 7 $schema['views_calc_fields'] = array(
8 'fields' => array( 8 'fields' => array(
9 'cid' => array('type' => 'serial', 'not null' => TRUE, 'disp-width' => '10'), 9 'cid' => array('type' => 'serial', 'not null' => TRUE, 'disp-width' => '10'),
10 'label' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''), 10 'label' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
11 'format' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''), 11 'format' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
12 'custom' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''), 12 'custom' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
13 'base' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
13 'tablelist' => array('type' => 'text', 'not null' => TRUE), 14 'tablelist' => array('type' => 'text', 'not null' => TRUE),
14 'fieldlist' => array('type' => 'text', 'not null' => TRUE), 15 'fieldlist' => array('type' => 'text', 'not null' => TRUE),
15 'calc' => array('type' => 'text', 'not null' => TRUE), 16 'calc' => array('type' => 'text', 'not null' => TRUE),
16 ), 17 ),
17 'primary key' => array('cid'), 18 'primary key' => array('cid'),
123 break; 124 break;
124 } 125 }
125 return $ret; 126 return $ret;
126 } 127 }
127 128
128 /**
129 * TODO
130 * Use these values to create new default views, then delete them.
131 *
132 function views_calc_update_6000() { 129 function views_calc_update_6000() {
133 $view_calcs = (array) variable_get('views_calc_vid',''); 130 $ret = array();
134 foreach ($view_calcs as $view_id) { 131 db_add_field($ret, 'views_calc_fields', 'base', array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => 'node'));
135 variable_del('views_calc_'. $view_id .'_col'); 132 return $ret;
136 variable_del('views_calc_'. $view_id .'_col_calc');
137 variable_del('views_calc_'. $view_id .'_row');
138 variable_del('views_calc_'. $view_id .'_row_calc');
139 }
140 variable_del('views_calc_vid');
141 variable_del('views_calc_operators');
142
143 } 133 }
144 */