mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
Added Flash and some cleanups in display
This commit is contained in:
parent
c59b07ece6
commit
cce96a89c2
@ -47,10 +47,28 @@ function mediaplugin_filter($courseid, $text) {
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
if (empty($CFG->filter_mediaplugin_ignore_swf)) {
|
||||
$search = '/<a(.*?)href=\"(.*?)\.swf\"([^>]*)>(.*?)<\/a>/i';
|
||||
|
||||
$replace = '\\0<p class="mediaplugin"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
|
||||
$replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
|
||||
$replace .= ' width="400" height="300" id="mp3player" align="">';
|
||||
$replace .= " <param name=movie value=\"\\2.swf\">";
|
||||
$replace .= ' <param name=quality value=high>';
|
||||
$replace .= " <embed src=\"\\2.swf\" ";
|
||||
$replace .= " quality=high width=\"400\" height=\"300\" name=\"flashfilter\" ";
|
||||
$replace .= ' type="application/x-shockwave-flash" ';
|
||||
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
if (empty($CFG->filter_mediaplugin_ignore_mov)) {
|
||||
$search = '/<a(.*?)href=\"(.*?)\.mov\"([^>]*)>(.*?)<\/a>/i';
|
||||
|
||||
$replace = '\\0<br /><object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
|
||||
$replace = '\\0<p class="mediaplugin"><object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
|
||||
$replace .= ' codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
|
||||
$replace .= ' height="300" width="400"';
|
||||
$replace .= ' id="quicktime" align="" type="application/x-oleobject">';
|
||||
@ -64,7 +82,7 @@ function mediaplugin_filter($courseid, $text) {
|
||||
$replace .= ' autoplay="false" controller="true" loop="true" ';
|
||||
$replace .= ' pluginspage="http://quicktime.apple.com/">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
@ -72,7 +90,7 @@ function mediaplugin_filter($courseid, $text) {
|
||||
if (empty($CFG->filter_mediaplugin_ignore_wmv)) {
|
||||
$search = '/<a(.*?)href=\"(.*?)\.wmv\"([^>]*)>(.*?)<\/a>/i';
|
||||
|
||||
$replace = '\\0<br /><object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"';
|
||||
$replace = '\\0<p class="mediaplugin"><object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"';
|
||||
$replace .= ' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
|
||||
$replace .= ' standby="Loading Microsoft® Windows® Media Player components..." ';
|
||||
$replace .= ' id="msplayer" align="" type="application/x-oleobject">';
|
||||
@ -91,7 +109,7 @@ function mediaplugin_filter($courseid, $text) {
|
||||
$replace .= ' TransparentAtStart="0" AnimationAtStart="0" ShowGotoBar="0" EnableFullScreenControls="1"';
|
||||
$replace .= ' pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user