From: <var...@us...> - 2009-09-26 16:57:38
|
Revision: 7159 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7159&view=rev Author: vargenau Date: 2009-09-26 16:57:28 +0000 (Sat, 26 Sep 2009) Log Message: ----------- Allow compact video syntax {{video.flv}} (like Wikicreole images) Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/InlineParser.php trunk/lib/stdlib.php trunk/pgsrc/Help%2FVideoPlugin Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2009-09-26 16:51:39 UTC (rev 7158) +++ trunk/lib/BlockParser.php 2009-09-26 16:57:28 UTC (rev 7159) @@ -1151,6 +1151,13 @@ return true; } + // It's a video + if (is_video($imagename)) { + $pi = '<'.'?plugin Video file="' . $pi . '" ?>'; + $this->_element = new Cached_PluginInvocation($pi); + return true; + } + $pi = str_replace("\n", "", $pi); $vars = ''; Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-09-26 16:51:39 UTC (rev 7158) +++ trunk/lib/InlineParser.php 2009-09-26 16:57:28 UTC (rev 7159) @@ -1065,6 +1065,12 @@ } } + // It's a video + if (is_video($imagename)) { + $s = '<'.'?plugin Video file="' . $imagename . '" ?'.'>'; + return new Cached_PluginInvocation($s); + } + $page = str_replace("\n", "", $page); $vars = ''; Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2009-09-26 16:51:39 UTC (rev 7158) +++ trunk/lib/stdlib.php 2009-09-26 16:57:28 UTC (rev 7159) @@ -98,6 +98,7 @@ isSerialized($s) parse_attributes($line) is_image ($filename) + is_video ($filename) compute_tablecell ($table, $i, $j, $imax, $jmax) function: LinkInterWikiLink($link, $linktext) @@ -2457,6 +2458,16 @@ } /** + * Returns true if the filename ends with an video suffix. + * Currently only FLV + */ +function is_video ($filename) { + + return string_ends_with(strtolower($filename), ".flv"); +} + + +/** * Compute cell in spreadsheet table * $table: two-dimensional table * $i and $j: indexes of cell to compute Modified: trunk/pgsrc/Help%2FVideoPlugin =================================================================== --- trunk/pgsrc/Help%2FVideoPlugin 2009-09-26 16:51:39 UTC (rev 7158) +++ trunk/pgsrc/Help%2FVideoPlugin 2009-09-26 16:57:28 UTC (rev 7159) @@ -1,4 +1,4 @@ -Date: Thu, 24 Sep 2009 10:54:37 +0000 +Date: Sat, 26 Sep 2009 17:26:43 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -11,6 +11,8 @@ The **~Video** [[Help:WikiPlugin|plugin]] allows to include video in a wiki page. Video file must be encoded in FLV format. +The Video plugin can also be called withe the ~{~{video.flv~}~} syntax. + == Arguments Use only one of ##url## or ##file## arguments at a time. @@ -44,16 +46,21 @@ == Example -A video : +A video: {{{ <<Video url=http://a.video.server/a_video.flv>> }}} -Another video : +Another video: {{{ <<Video file=another_video.flv>> }}} +This is equivalent to: +{{{ +{{another_video.flv}} +}}} + == Authors * Roger Guignard, Alcatel-Lucent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |