NEW FEATURE: Media file now works with web pages and with text and html files. Also, the pop-up

window size is configurable as well as an optional close button at the bottom of the window.
This commit is contained in:
michaelpenne 2005-10-28 22:45:47 +00:00
parent 525bb31f37
commit 3eca6cf1bf
9 changed files with 98 additions and 12 deletions

View file

@ -365,9 +365,8 @@
if (!empty($lesson->mediafile)) {
// open our pop-up
$url = '/mod/lesson/mediafile.php?id='.$cm->id;
$path_parts = pathinfo($lesson->mediafile);
$name = substr($path_parts['basename'], 0, strstr($path_parts['basename'], '.'));
$options = 'menubar=0,location=0,left=5,top=5,scrollbars,resizable,width='. 650 .',height='. 100;
$name = 'lessonmediafile';
$options = 'menubar=0,location=0,left=5,top=5,scrollbars,resizable,width='. $lesson->mediawidth .',height='. $lesson->mediaheight;
echo "\n<script language=\"javascript\" type=\"text/javascript\">";
echo "\n<!--\n";
echo " openpopup('$url', '$name', '$options', 0);";
@ -479,9 +478,8 @@
if (!empty($lesson->mediafile)) {
$url = '/mod/lesson/mediafile.php?id='.$cm->id;
$options = 'menubar=0,location=0,left=5,top=5,scrollbars,resizable,width='. 650 .',height='. 100;
$path_parts = pathinfo($lesson->mediafile);
$name = substr($path_parts['basename'], 0, strstr($path_parts['basename'], '.'));
$options = 'menubar=0,location=0,left=5,top=5,scrollbars,resizable,width='. $lesson->mediawidth .',height='. $lesson->mediaheight;
$name = 'lessonmediafile';
echo '<div align="right">';
link_to_popup_window ($url, $name, get_string('mediafilepopup', 'lesson'), '', '', get_string('mediafilepopup', 'lesson'), $options);
helpbutton("mediafilestudent", get_string("mediafile", "lesson"), "lesson");