thebuggenie/thebuggenie — pull request #240 by sharrondenice (2014-03-05 17:54:32+00:00)
Title: Added functionality to embed links into wiki

Enhancement Ticket #2308
According to a website link (http://sourceforge.net/p/bugs-bug-genie/wiki/markdown_syntax/#md_ex_video) TheBugGenie supports URL embedding, however I was unable to locate this functionality in the code or subsequent wiki's for TheBugGenie. Added in the functionality based on the Wiki from the link

- Updated core/classes/TBGTextParser.class.php
- Added case to search namespace for the embed keyword
- format is similar to most namespaces, [[embed:(|width=X,height=Y,type=iframe|object)]], but it also supports [[embed url=(|width=X,height=Y,type=iframe|object)]] which was the format specified in the wiki at the URL link above
- width and height or optional, default values are set to 500 and 400 for width and height, respectfully
- type is also optional, default value is iframe, object is the old way to embed youtube links
- Updated core/lib/common.inc.php
- Added two functions to test youtube links
- tbg_youtube_link to test to see if the url is a youtube link
- tbg_youtube_prepare_link to update commonly used links to ensure they are form mated for proper embedding
- Updated core/lib/ui.inc.php
- Added two new functions that support embedding
- iframe_tag - returns iframe html
- object_tag - returns object tag

Aslo added another test case - if the href is empty or set to 'embed' then this means an empty embed tag was entered '[[embed]]', and further processing should be halted