1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Manage aggregates in a database
|
5
|
*
|
6
|
* $Id: aggregates.php,v 1.12 2005/10/18 03:45:15 chriskl Exp $
|
7
|
*/
|
8
|
|
9
|
// Include application functions
|
10
|
include_once('./libraries/lib.inc.php');
|
11
|
|
12
|
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
|
13
|
if (!isset($msg)) $msg = '';
|
14
|
|
15
|
/**
|
16
|
* Show default list of aggregates in the database
|
17
|
*/
|
18
|
function doDefault($msg = '') {
|
19
|
global $data, $conf, $misc;
|
20
|
global $lang;
|
21
|
|
22
|
$misc->printTrail('schema');
|
23
|
$misc->printTabs('schema', 'aggregates');
|
24
|
$misc->printMsg($msg);
|
25
|
|
26
|
$aggregates = $data->getAggregates();
|
27
|
|
28
|
$columns = array(
|
29
|
'aggregate' => array(
|
30
|
'title' => $lang['strname'],
|
31
|
'field' => 'proname',
|
32
|
),
|
33
|
'type' => array(
|
34
|
'title' => $lang['strtype'],
|
35
|
'field' => 'proargtypes',
|
36
|
'params'=> array('null' => $lang['stralltypes']),
|
37
|
),
|
38
|
'comment' => array(
|
39
|
'title' => $lang['strcomment'],
|
40
|
'field' => 'aggcomment',
|
41
|
),
|
42
|
);
|
43
|
|
44
|
$actions = array();
|
45
|
|
46
|
$misc->printTable($aggregates, $columns, $actions, $lang['strnoaggregates']);
|
47
|
}
|
48
|
|
49
|
/**
|
50
|
* Generate XML for the browser tree.
|
51
|
*/
|
52
|
function doTree() {
|
53
|
global $misc, $data;
|
54
|
|
55
|
$aggregates = $data->getAggregates();
|
56
|
|
57
|
$proto = concat(field('proname'), ' (', field('proargtypes'), ')');
|
58
|
|
59
|
$attrs = array(
|
60
|
'text' => $proto,
|
61
|
'icon' => 'functions',
|
62
|
'toolTip'=> field('aggcomment'),
|
63
|
);
|
64
|
|
65
|
$misc->printTreeXML($aggregates, $attrs);
|
66
|
exit;
|
67
|
}
|
68
|
|
69
|
if ($action == 'tree') doTree();
|
70
|
|
71
|
$misc->printHeader($lang['straggregates']);
|
72
|
$misc->printBody();
|
73
|
|
74
|
switch ($action) {
|
75
|
default:
|
76
|
doDefault();
|
77
|
break;
|
78
|
}
|
79
|
|
80
|
$misc->printFooter();
|
81
|
|
82
|
?>
|