| 1 |
<?php
|
| 2 |
// $Id: fusioncharts.install,v 1.5 2008/08/31 07:10:29 aaron1234nz Exp $
|
| 3 |
/**
|
| 4 |
* Implementation of hook_install().
|
| 5 |
*/
|
| 6 |
function fusioncharts_install() {
|
| 7 |
$success = TRUE;
|
| 8 |
switch ($GLOBALS['db_type']) {
|
| 9 |
case 'mysql':
|
| 10 |
case 'mysqli':
|
| 11 |
db_query("CREATE TABLE {fusioncharts} (
|
| 12 |
nid int NOT NULL,
|
| 13 |
vid int NOT NULL,
|
| 14 |
chart_type varchar(64) NOT NULL,
|
| 15 |
settings longtext default NULL,
|
| 16 |
attributes longtext default NULL,
|
| 17 |
data longtext default NULL,
|
| 18 |
width int NOT NULL,
|
| 19 |
height int NOT NULL,
|
| 20 |
PRIMARY KEY (vid)
|
| 21 |
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
| 22 |
break;
|
| 23 |
case 'pgsql':
|
| 24 |
db_query("CREATE TABLE {fusioncharts} (
|
| 25 |
nid integer NOT NULL,
|
| 26 |
vid integer NOT NULL,
|
| 27 |
chart_type varchar(64) NOT NULL,
|
| 28 |
settings text default NULL,
|
| 29 |
attributes text default NULL,
|
| 30 |
data text default NULL,
|
| 31 |
width integer NOT NULL,
|
| 32 |
height integer NOT NULL,
|
| 33 |
PRIMARY KEY (vid)
|
| 34 |
)");
|
| 35 |
break;
|
| 36 |
}
|
| 37 |
$chart_types = array(
|
| 38 |
'Single Series Charts' => array(
|
| 39 |
'Column 3D' => 'Column 3D',
|
| 40 |
'Column 2D' => 'Column 2D',
|
| 41 |
'Line 2D' => 'Line 2D',
|
| 42 |
'Area 2D' => 'Area 2D',
|
| 43 |
'Bar 2D' => 'Bar 2D',
|
| 44 |
'Pie 2D' => 'Pie 2D',
|
| 45 |
'Pie 3D' => 'Pie 3D',
|
| 46 |
'Doughnut 2D' => 'Doughnut 2D',
|
| 47 |
),
|
| 48 |
'Multi-series Charts' => array(
|
| 49 |
'Multi-series Column 2D' => 'Multi-series Column 2D',
|
| 50 |
'Multi-series Column 3D' => 'Multi-series Column 3D',
|
| 51 |
'Multi-series Line 2D' => 'Multi-series Line 2D',
|
| 52 |
'Multi-series Bar 2D' => 'Multi-series Bar 2D',
|
| 53 |
'Multi-series Area 2D' => 'Multi-series Area 2D'
|
| 54 |
),
|
| 55 |
'Stacked Charts' => array(
|
| 56 |
'Stacked Column 3D' => 'Stacked Column 3D',
|
| 57 |
'Stacked Column 2D' => 'Stacked Column 2D',
|
| 58 |
'Stacked Bar 2D' => 'Stacked Bar 2D',
|
| 59 |
'Stacked Area 2D' => 'Stacked Area 2D'
|
| 60 |
),
|
| 61 |
'Combination Charts' => array(
|
| 62 |
'Multi-series Column 2D + Line - Dual Y Axis' => 'Multi-series Column 2D + Line - Dual Y Axis',
|
| 63 |
'Multi-series Column 3D + Line - Dual Y Axis' => 'Multi-series Column 3D + Line - Dual Y Axis'
|
| 64 |
),
|
| 65 |
// 'Financial Charts' => array(
|
| 66 |
// 'Candlestick Chart' => 'Candlestick Chart'
|
| 67 |
// ),
|
| 68 |
'Funnel Chart' => array(
|
| 69 |
'Funnel Chart' => 'Funnel Chart'
|
| 70 |
),
|
| 71 |
// 'Gantt Chart' => array(
|
| 72 |
// 'Gantt Chart' => 'Gantt Chart'
|
| 73 |
// )
|
| 74 |
);
|
| 75 |
variable_set('fusioncharts', $chart_types);
|
| 76 |
$fusioncharts_settings = array(
|
| 77 |
'bgcolor' => '#f3f3f3',
|
| 78 |
'bgAlpha' => '70',
|
| 79 |
'canvasBgColor' => '#f3fff3',
|
| 80 |
'canvasBorderColor' => '#000000',
|
| 81 |
'canvasBorderThickness' => '1',
|
| 82 |
'showCanvasBg' => '1',
|
| 83 |
'showCanvasBase' => '1',
|
| 84 |
'shownames' => '1',
|
| 85 |
'showValues' => '1',
|
| 86 |
'animation' => '1',
|
| 87 |
'showLimits' => '0',
|
| 88 |
'showLegend' => '1',
|
| 89 |
'rotateNames' => '0',
|
| 90 |
'showColumnShadow' => '1',
|
| 91 |
'baseFont' => 'Arial',
|
| 92 |
'baseFontSize' => '10',
|
| 93 |
'baseFontColor' => '#000000',
|
| 94 |
'outCnvBaseFont' => 'Arial',
|
| 95 |
'outCnvBaseFontSze' => '14',
|
| 96 |
'outCnvBaseFontColor' => '#000000',
|
| 97 |
'showhovercap' => '1',
|
| 98 |
'hoverCapBgColor' => '#ffffff',
|
| 99 |
'hoverCapBorderColor' => '#000000',
|
| 100 |
'zeroPlaneColor' => '#000000',
|
| 101 |
'formatNumber' => '1',
|
| 102 |
'formatNumberScale' => '1',
|
| 103 |
'decimalSeparator' => '.',
|
| 104 |
'thousandSeparator' => ',',
|
| 105 |
'decimalPrecision' => '0',
|
| 106 |
'divLineDecimalPrecision' => '0',
|
| 107 |
'limitsDecimalPrecision' => '0',
|
| 108 |
'divlinecolor' => '#000000',
|
| 109 |
'showDivLineValue' => '1',
|
| 110 |
'showAlternateHGridColor' => '0',
|
| 111 |
'alternateHGridColor' => '#000000',
|
| 112 |
'VDivlinecolor' => '#000000',
|
| 113 |
'showAlternateVGridColor' => '0',
|
| 114 |
'alternateVGridColor' => '#000000',
|
| 115 |
);
|
| 116 |
$fusioncharts_attributes = array(
|
| 117 |
'colors' => array(
|
| 118 |
'color1' => '#AFD8F8',
|
| 119 |
'color2' => '#F6BD0F',
|
| 120 |
'color3' => '#8BBA00',
|
| 121 |
'color4' => '#FF8E46',
|
| 122 |
'color5' => '#008E8E',
|
| 123 |
'color6' => '#D64646',
|
| 124 |
'color7' => '#8E468E',
|
| 125 |
'color8' => '#588526',
|
| 126 |
'color9' => '#B3AA00',
|
| 127 |
'color10' => '#008ED6',
|
| 128 |
'color11' => '#9D080D',
|
| 129 |
'color12' => '#A186BE'
|
| 130 |
)
|
| 131 |
);
|
| 132 |
variable_set('fusioncharts-defset', $fusioncharts_settings);
|
| 133 |
variable_set('fusioncharts-defattr', $fusioncharts_atributes);
|
| 134 |
}
|
| 135 |
|
| 136 |
|
| 137 |
/**
|
| 138 |
* Implementation of hook_uninstall().
|
| 139 |
*/
|
| 140 |
function fusioncharts_uninstall() {
|
| 141 |
db_query('DROP TABLE {fusioncharts}');
|
| 142 |
variable_del('fusioncharts');
|
| 143 |
variable_del('fusioncharts-defset');
|
| 144 |
variable_del('fusioncharts-defattr');
|
| 145 |
}
|
| 146 |
|