commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / packages / OpenFlashChart / php-ofc-library / ofc_tags.php
1 <?php
2
3 class ofc_tags
4 {
5 function ofc_tags()
6 {
7 $this->type = "tags";
8 $this->values = array();
9 }
10
11 function colour( $colour )
12 {
13 $this->colour = $colour;
14 return $this;
15 }
16
17 /**
18 *@param $font as string. e.g. "Verdana"
19 *@param $size as integer. Size in px
20 */
21 function font($font, $size)
22 {
23 $this->font = $font;
24 $this->{'font-size'} = $size;
25 return $this;
26 }
27
28 /**
29 *@param $x as integer. Size of x padding in px
30 *@param $y as integer. Size of y padding in px
31 */
32 function padding($x, $y)
33 {
34 $this->{"pad-x"} = $x;
35 $this->{"pad-y"} = $y;
36 return $this;
37 }
38
39
40 function rotate( $angle )
41 {
42 $this->rotate = $angle;
43 }
44 function align_x_center()
45 {
46 $this->{"align-x"} = "center";
47 return $this;
48 }
49
50 function align_x_left()
51 {
52 $this->{"align-x"} = "left";
53 return $this;
54 }
55
56 function align_x_right()
57 {
58 $this->{"align-x"} = "right";
59 return $this;
60 }
61
62 function align_y_above()
63 {
64 $this->{"align-y"} = "above";
65 return $this;
66 }
67
68 function align_y_below()
69 {
70 $this->{"align-y"} = "below";
71 return $this;
72 }
73
74 function align_y_center()
75 {
76 $this->{"align-y"} = "center";
77 return $this;
78 }
79
80 /**
81 * This can contain some HTML, e.g:
82 * - "More <a href="javascript:alert(12);">info</a>"
83 * - "<a href="http://teethgrinder.co.uk">ofc</a>"
84 */
85 function text($text)
86 {
87 $this->text = $text;
88 return $this;
89 }
90
91 /**
92 * This works, but to get the mouse pointer to change
93 * to a little hand you need to use "<a href="">stuff</a>"-- see text()
94 */
95 function on_click($on_click)
96 {
97 $this->{'on-click'} = $on_click;
98 return $this;
99 }
100
101 /**
102 *@param $bold boolean.
103 *@param $underline boolean.
104 *@param $border boolean.
105 *@prarm $alpha real (0 to 1.0)
106 */
107 function style($bold, $underline, $border, $alpha )
108 {
109 $this->bold = $bold;
110 $this->border = $underline;
111 $this->underline = $border;
112 $this->alpha = $alpha;
113 return $this;
114 }
115
116 /**
117 *@param $tag as ofc_tag
118 */
119 function append_tag($tag)
120 {
121 $this->values[] = $tag;
122 }
123 }
124
125 class ofc_tag extends ofc_tags
126 {
127 function ofc_tag($x, $y)
128 {
129 $this->x = $x;
130 $this->y = $y;
131 }
132 }