-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBugzilla.class.php
More file actions
52 lines (40 loc) · 1.32 KB
/
Bugzilla.class.php
File metadata and controls
52 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
require_once(dirname(__FILE__) . '/BugzillaOutput.class.php');
// Factory
class Bugzilla {
public static function create($config=array(), $opts=array(), $title='') {
// Default configuration
// FIXME: This should be in the main configuration
$theconfig = array(
'type' => 'bug',
'display' => 'table',
);
// Overlay user's desired configuration
foreach( $config as $key => $value ) {
$theconfig[$key] = $value;
}
// Generate the proper object
switch( $theconfig['display'] ) {
case 'list':
$b = new BugzillaList($theconfig, $opts, $title);
break;
case 'bar':
$b = new BugzillaBarGraph($theconfig, $opts, $title);
break;
case 'vbar':
$b = new BugzillaVerticalBarGraph($theconfig, $opts, $title);
break;
case 'pie':
$b = new BugzillaPieGraph($theconfig, $opts, $title);
break;
case 'inline':
$b = new BugzillaInline($theconfig, $opts, $title);
break;
case 'table':
default:
$b = new BugzillaTable($theconfig, $opts, $title);
}
return $b;
}
}
?>