1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Manage opclasss in a database
|
5
|
*
|
6
|
* $Id: opclasses.php,v 1.8 2005/10/18 03:45:16 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 opclasss 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','opclasses');
|
24
|
$misc->printMsg($msg);
|
25
|
|
26
|
$opclasses = $data->getOpClasses();
|
27
|
|
28
|
$columns = array(
|
29
|
'accessmethod' => array(
|
30
|
'title' => $lang['straccessmethod'],
|
31
|
'field' => 'amname',
|
32
|
),
|
33
|
'opclass' => array(
|
34
|
'title' => $lang['strname'],
|
35
|
'field' => 'opcname',
|
36
|
),
|
37
|
'type' => array(
|
38
|
'title' => $lang['strtype'],
|
39
|
'field' => 'opcintype',
|
40
|
),
|
41
|
'default' => array(
|
42
|
'title' => $lang['strdefault'],
|
43
|
'field' => 'opcdefault',
|
44
|
'type' => 'yesno',
|
45
|
),
|
46
|
'comment' => array(
|
47
|
'title' => $lang['strcomment'],
|
48
|
'field' => 'opccomment',
|
49
|
),
|
50
|
);
|
51
|
|
52
|
$actions = array();
|
53
|
|
54
|
$misc->printTable($opclasses, $columns, $actions, $lang['strnoopclasses']);
|
55
|
}
|
56
|
|
57
|
/**
|
58
|
* Generate XML for the browser tree.
|
59
|
*/
|
60
|
function doTree() {
|
61
|
global $misc, $data;
|
62
|
|
63
|
$opclasses = $data->getOpClasses();
|
64
|
|
65
|
// OpClass prototype: "op_class/access_method"
|
66
|
$proto = concat(field('opcname'),'/',field('amname'));
|
67
|
|
68
|
$attrs = array(
|
69
|
'text' => $proto,
|
70
|
'icon' => 'operators',
|
71
|
'toolTip'=> field('opccomment'),
|
72
|
);
|
73
|
|
74
|
$misc->printTreeXML($opclasses, $attrs);
|
75
|
exit;
|
76
|
}
|
77
|
|
78
|
if ($action == 'tree') doTree();
|
79
|
|
80
|
$misc->printHeader($lang['stropclasses']);
|
81
|
$misc->printBody();
|
82
|
|
83
|
switch ($action) {
|
84
|
default:
|
85
|
doDefault();
|
86
|
break;
|
87
|
}
|
88
|
|
89
|
$misc->printFooter();
|
90
|
|
91
|
?>
|