Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | class ofc_menu_item
|
---|
4 | {
|
---|
5 | /**
|
---|
6 | * @param $text as string. The menu item text.
|
---|
7 | * @param $javascript_function_name as string. The javascript function name, the
|
---|
8 | * js function takes one parameter, the chart ID. See ofc_menu_item_camera for
|
---|
9 | * some example code.
|
---|
10 | */
|
---|
11 | function ofc_menu_item($text, $javascript_function_name)
|
---|
12 | {
|
---|
13 | $this->type = "text";
|
---|
14 | $this->text = $text;
|
---|
15 | $tmp = 'javascript-function';
|
---|
16 | $this->$tmp = $javascript_function_name;
|
---|
17 | }
|
---|
18 | }
|
---|
19 |
|
---|
20 | class ofc_menu_item_camera
|
---|
21 | {
|
---|
22 | /**
|
---|
23 | * @param $text as string. The menu item text.
|
---|
24 | * @param $javascript_function_name as string. The javascript function name, the
|
---|
25 | * js function takes one parameter, the chart ID. So for example, our js function
|
---|
26 | * could look like this:
|
---|
27 | *
|
---|
28 | * function save_image( chart_id )
|
---|
29 | * {
|
---|
30 | * alert( chart_id );
|
---|
31 | * }
|
---|
32 | *
|
---|
33 | * to make a menu item call this: ofc_menu_item_camera('Save chart', 'save_image');
|
---|
34 | */
|
---|
35 | function ofc_menu_item_camera($text, $javascript_function_name)
|
---|
36 | {
|
---|
37 | $this->type = "camera-icon";
|
---|
38 | $this->text = $text;
|
---|
39 | $tmp = 'javascript-function';
|
---|
40 | $this->$tmp = $javascript_function_name;
|
---|
41 | }
|
---|
42 | }
|
---|
43 |
|
---|
44 | class ofc_menu
|
---|
45 | {
|
---|
46 | function ofc_menu($colour, $outline_colour)
|
---|
47 | {
|
---|
48 | $this->colour = $colour;
|
---|
49 | $this->outline_colour = $outline_colour;
|
---|
50 | }
|
---|
51 |
|
---|
52 | function values($values)
|
---|
53 | {
|
---|
54 | $this->values = $values;
|
---|
55 | }
|
---|
56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.