You are here

API.txt in Media Library 6

*********
* Hooks *
*********

General
========

* function hook_media_types()
Declares wich media type(s) are handled by your module.
The format to return is:
@return
  Array with type machine-names as keys and an array with 
  the following attributes as value:
    title
    description
    steps - number of steps the insertion form will have (not counting
    preview and type selection steps). Must be set to at least '1'.

Filtering
=========
These functions allow you to control how the filter will process tags into
outputs.

* function hook_media_filter($content)
This hook is called upon filtering of content. It calls only the module
declared for the $content['type'].
@param
  content - array with the content vars to be used on rendering
@return
  The fully rendered HTML content. You should properly use theme functions 
  for this.

* function hook_media_filter_alter(&$content)
This hook allows you to alter the parameters of any [media:XXX] tag. You
can check for the type in $content['type']
@param
  content - array with content vars to be used on rendering


Filter Tag Generation
=====================
These functions are used to generate proper tags to be filtered later.

function hook_media_tag($object)
This function actually generates the tag as an array.
@param
  object - The structure to be converted to a tag.
@return
  The array in paramater => value form. 

function hook_media_tag_alter(&$object)
allow the modules to change attributes of the object before all the tag is 
actually processed. This is useful if you have to change attributes used by 
other modules, like the common media attributes.
@param
  object - The structure to be converted to a tag.

File

API.txt
View source
  1. *********
  2. * Hooks *
  3. *********
  4. General
  5. ========
  6. * function hook_media_types()
  7. Declares wich media type(s) are handled by your module.
  8. The format to return is:
  9. @return
  10. Array with type machine-names as keys and an array with
  11. the following attributes as value:
  12. title
  13. description
  14. steps - number of steps the insertion form will have (not counting
  15. preview and type selection steps). Must be set to at least '1'.
  16. Filtering
  17. =========
  18. These functions allow you to control how the filter will process tags into
  19. outputs.
  20. * function hook_media_filter($content)
  21. This hook is called upon filtering of content. It calls only the module
  22. declared for the $content['type'].
  23. @param
  24. content - array with the content vars to be used on rendering
  25. @return
  26. The fully rendered HTML content. You should properly use theme functions
  27. for this.
  28. * function hook_media_filter_alter(&$content)
  29. This hook allows you to alter the parameters of any [media:XXX] tag. You
  30. can check for the type in $content['type']
  31. @param
  32. content - array with content vars to be used on rendering
  33. Filter Tag Generation
  34. =====================
  35. These functions are used to generate proper tags to be filtered later.
  36. function hook_media_tag($object)
  37. This function actually generates the tag as an array.
  38. @param
  39. object - The structure to be converted to a tag.
  40. @return
  41. The array in paramater => value form.
  42. function hook_media_tag_alter(&$object)
  43. allow the modules to change attributes of the object before all the tag is
  44. actually processed. This is useful if you have to change attributes used by
  45. other modules, like the common media attributes.
  46. @param
  47. object - The structure to be converted to a tag.