Permalink
Browse files

Added support for .ram files and added config settings.

  • Loading branch information...
ikawhero
ikawhero committed Mar 13, 2006
1 parent a68dc79 commit d539ccf3e8e44b4e77aeba1ce7c8152627572bbe
Showing with 46 additions and 1 deletion.
  1. +9 −0 filter/mediaplugin/defaultsettings.php
  2. +25 −1 filter/mediaplugin/filter.php
  3. +12 −0 filter/mediaplugin/filterconfig.html
@@ -69,6 +69,15 @@
set_config( 'filter_mediaplugin_enable_flv', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_ram) or $forcereset) {
if (isset($CFG->filter_mediaplugin_ignore_ram)) {
set_config( 'filter_mediaplugin_enable_ram', !$CFG->filter_mediaplugin_ignore_ram );
set_config( 'filter_mediaplugin_ignore_ram','' );
}
else {
set_config( 'filter_mediaplugin_enable_ram', 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 );
@@ -184,7 +184,32 @@ function mediaplugin_filter($courseid, $text) {
$text = preg_replace($search, $replace, $text);
}
if ($CFG->filter_mediaplugin_enable_ram) {
$search = '/<a(.*?)href=\"([^<]+)\.ram\"([^>]*)>(.*?)<\/a>/is';
$replace = '\\0<p class="mediaplugin ram"><object width="240" height="180">';
$replace .= '<param name="src" value="\\2.ram" />';
$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.ram" />';
$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';
@@ -209,7 +234,6 @@ function mediaplugin_filter($courseid, $text) {
$text = preg_replace($search, $replace, $text);
}
return $text;
@@ -11,6 +11,8 @@
$txt->mediapluginmpg = get_string( 'mediapluginmpg','admin' );
$txt->mediapluginavi = get_string( 'mediapluginavi','admin' );
$txt->mediapluginflv = get_string( 'mediapluginflv','admin' );
$txt->mediapluginram = get_string( 'mediapluginram','admin' );
$txt->mediapluginrm = get_string( 'mediapluginrm','admin' );
$txt->yes = get_string( 'yes' );
$txt->no = get_string( 'no' );
@@ -53,4 +55,14 @@
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_flv',
$CFG->filter_mediaplugin_enable_flv ); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php echo $txt->mediapluginram ?></td>
<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->mediapluginrm ?></td>
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_rm',
$CFG->filter_mediaplugin_enable_rm ); ?></td>
</tr>
</table>

0 comments on commit d539ccf

Please sign in to comment.