mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
Added another extension for Real Media. This should cover all the file
types for which you would want to embed a player or give you a way to do it eg writing an ram or rpm file.
This commit is contained in:
parent
6fe1db7e74
commit
03d843b2dc
@ -78,6 +78,15 @@
|
||||
set_config( 'filter_mediaplugin_enable_ram', 1 );
|
||||
}
|
||||
}
|
||||
if (!isset($CFG->filter_mediaplugin_enable_rpm) or $forcereset) {
|
||||
if (isset($CFG->filter_mediaplugin_ignore_rpm)) {
|
||||
set_config( 'filter_mediaplugin_enable_rpm', !$CFG->filter_mediaplugin_ignore_rpm );
|
||||
set_config( 'filter_mediaplugin_ignore_rpm','' );
|
||||
}
|
||||
else {
|
||||
set_config( 'filter_mediaplugin_enable_rpm', 1 );
|
||||
}
|
||||
}
|
||||
if (!isset($CFG->filter_mediaplugin_enable_rm) or $forcereset) {
|
||||
if (isset($CFG->filter_mediaplugin_ignore_rm)) {
|
||||
set_config( 'filter_mediaplugin_enable_rm', !$CFG->filter_mediaplugin_ignore_rm );
|
||||
|
@ -209,6 +209,31 @@ function mediaplugin_filter($courseid, $text) {
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_rpm) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.rpm\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
||||
$replace = '\\0<p class="mediaplugin rpm"><object width="240" height="180">';
|
||||
$replace .= '<param name="src" value="\\2.rpm" />';
|
||||
$replace .= '<param name="autostart" value="true" />';
|
||||
$replace .= '<param name="controls" value="imagewindow" />';
|
||||
$replace .= '<param name="console" value="video" />';
|
||||
$replace .= '<param name="loop" value="true" />';
|
||||
$replace .= '<embed src="\\2.rm" width=240" height="180" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="true">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object><br />';
|
||||
|
||||
$replace .= '<object width="320" height="30">';
|
||||
$replace .= '<param name="src" value="\\2.rpm" />';
|
||||
$replace .= '<param name="autostart" value="true" />';
|
||||
$replace .= '<param name="controls" value="ControlPanel" />';
|
||||
$replace .= '<param name="console" value="video" />';
|
||||
$replace .= '<embed src="\\2.rm" width="240" height="30" controls="ControlPanel" type="audio/x-pn-realaudio-plugin" console="video" autostart="true">';
|
||||
$replace .= '</embed>';
|
||||
$replace .= '</object></p>';
|
||||
|
||||
$text = preg_replace($search, $replace, $text);
|
||||
}
|
||||
|
||||
if ($CFG->filter_mediaplugin_enable_rm) {
|
||||
$search = '/<a(.*?)href=\"([^<]+)\.rm\"([^>]*)>(.*?)<\/a>/is';
|
||||
|
@ -12,6 +12,7 @@
|
||||
$txt->mediapluginavi = get_string( 'mediapluginavi','admin' );
|
||||
$txt->mediapluginflv = get_string( 'mediapluginflv','admin' );
|
||||
$txt->mediapluginram = get_string( 'mediapluginram','admin' );
|
||||
$txt->mediapluginrpm = get_string( 'mediapluginrpm','admin' );
|
||||
$txt->mediapluginrm = get_string( 'mediapluginrm','admin' );
|
||||
$txt->yes = get_string( 'yes' );
|
||||
$txt->no = get_string( 'no' );
|
||||
@ -60,6 +61,11 @@
|
||||
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_ram',
|
||||
$CFG->filter_mediaplugin_enable_ram ); ?></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><?php echo $txt->mediapluginrpm ?></td>
|
||||
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_rpm',
|
||||
$CFG->filter_mediaplugin_enable_rpm ); ?></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><?php echo $txt->mediapluginrm ?></td>
|
||||
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_rm',
|
||||
|
Loading…
x
Reference in New Issue
Block a user