ofc_menu.php 1.3 KB

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