piecemaker.api.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the Piecemaker module.
  5. */
  6. /**
  7. * @addtogroup hooks
  8. * @{
  9. */
  10. /**
  11. * Allows modules to define different handlers for the Piecemaker API
  12. *
  13. * @return
  14. * An Associtive array with ID keys that contain a callback and an access callback
  15. */
  16. function hook_piecemaker_handler() {
  17. return array(
  18. 'example_piecemaker' => array(
  19. 'callback' => 'example_piecemaker_settings',
  20. 'access' => 'example_piecemaker_access',
  21. ),
  22. );
  23. }
  24. /**
  25. * An Example of what a Piecemaker xml array should look like
  26. * Returns the xml array for the piecemaker example
  27. *
  28. * @param $key
  29. * The key from which we would retrieve the settings if this were real
  30. *
  31. * @return
  32. * A structured array from which the piecemaker API will build an XML settings file
  33. */
  34. function example_piecemaker_settings($key) {
  35. $xml['Settings'] = _piecemaker_default_settings();
  36. $xml['Transitions'] = variable_get('piecemaker_default_transitions', array());
  37. $items[] = array(
  38. '#type' => 'Image',
  39. '#attributes' => array(
  40. 'Source' => 'https://mail.google.com/mail/u/0/images/2/5/planets/base/gmail_solid_white_beta.png',
  41. 'Title' => 'An Image Node',
  42. ),
  43. 'Hyperlink' => array(
  44. '#attributes' => array(
  45. 'URL' => 'http://google.com',
  46. 'Target' => '_parent',
  47. ),
  48. ),
  49. 'Text' => 'Test text. Just to show whats up.'
  50. );
  51. $items[] = array(
  52. '#type' => 'Video',
  53. '#attributes' => array(
  54. 'Source' => 'https://mail.google.com/mail/u/0/images/2/5/planets/base/gmail_solid_white_beta.png',
  55. 'Title' => 'A Video Node',
  56. 'Width' => '960',
  57. 'Height' => '360',
  58. 'Autoplay' => 'true',
  59. ),
  60. 'Image' => array(
  61. '#attributes' => array(
  62. 'Source' => 'http://google.com',
  63. ),
  64. ),
  65. );
  66. $items[] = array(
  67. '#type' => 'Flash',
  68. '#attributes' => array(
  69. 'Source' => 'https://mail.google.com/mail/u/0/images/2/5/planets/base/gmail_solid_white_beta.png',
  70. 'Title' => 'A Flash Node',
  71. ),
  72. 'Image' => array(
  73. '#attributes' => array(
  74. 'Source' => 'http://google.com',
  75. ),
  76. ),
  77. );
  78. $xml['Contents'] = $items;
  79. return $xml;
  80. }