mantisbt:extensible_object_embedding_requirements
Differences
This shows you the differences between two versions of the page.
mantisbt:extensible_object_embedding_requirements [2007/08/26 04:40] – created vboctor | mantisbt:extensible_object_embedding_requirements [2008/10/29 04:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Extensible Object Embedding (e.g. YouTube) ====== | ||
+ | **Author: Victor Boctor** | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | This feature is to allow embedding of custom objects into Mantis. | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | The syntax to embed an object would be as follows: | ||
+ | |||
+ | < | ||
+ | [embed type=youtube]dgwbHzOec9I[/ | ||
+ | </ | ||
+ | |||
+ | In the above example, " | ||
+ | |||
+ | ===== How will it work? ===== | ||
+ | |||
+ | The string_api.php will detect patterns like [embed type=sometype]param[/ | ||
+ | |||
+ | The methods in embed API take a single parameter and return the replacement string. | ||
+ | |||
+ | ===== How to define new types? ===== | ||
+ | |||
+ | <code php> | ||
+ | function custom_function_override_embed( $p_type, $p_param ) { | ||
+ | switch ( $p_type ) { | ||
+ | case ' | ||
+ | return "some output for type ' | ||
+ | default: | ||
+ | return custom_function_default_embed( $p_type, $p_param ); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Feedback ===== | ||
+ | |||
+ | Please provide feedback in this section. |