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.txtView source
-
- *********
- * 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.