Browse files

Fixed MDL-9923, modified form to accept URLs

Media file was busted for framesets, fixed now
  • Loading branch information...
1 parent 58c70ca commit b42cae480fd2aeb5391d02fe309b6205c4f69ce1 mark-nielsen committed May 28, 2007
Showing with 14 additions and 13 deletions.
  1. +13 −12 mod/lesson/mediafile.php
  2. +1 −1 mod/lesson/mod_form.php
View
25 mod/lesson/mediafile.php
@@ -30,19 +30,22 @@
error('Course module is incorrect');
}
- print_header($course->shortname);
+ if (!is_url($lesson->mediafile)) {
+ print_header($course->shortname);
+ }
if ($printclose) { // this is for framesets
if ($lesson->mediaclose) {
- echo '<div class="lessonmediafilecontrol">
- <form>
- <div>
- <input type="button" onclick="top.close();" value="'.get_string("closewindow").'" />
- </div>
- </form>
- </div>';
+ print_header($course->shortname);
+ echo '<div class="lessonmediafilecontrol">
+ <form>
+ <div>
+ <input type="button" onclick="top.close();" value="'.get_string("closewindow").'" />
+ </div>
+ </form>
+ </div>';
+ print_footer();
}
- print_footer();
exit();
}
@@ -155,13 +158,11 @@
} else if (is_url($lesson->mediafile) or $mimetype == 'text/html' or $mimetype == 'text/plain') {
// might be dangerous to handle all of these in the same fasion. It is being set by a teacher though.
- /*
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
echo "<html dir=\"ltr\">\n";
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />';
echo "<title>{$course->shortname}</title></head>\n";
- */
if ($lesson->mediaclose) {
echo "<frameset rows=\"90%,*\">";
echo "<frame src=\"$fullurl\" />";
@@ -172,7 +173,7 @@
echo "<frame src=\"$fullurl\" />";
echo "</frameset>";
}
- print_footer();
+ echo '</html>';
exit();
} else if (in_array($mimetype, array('image/gif','image/jpeg','image/png'))) { // Image
View
2 mod/lesson/mod_form.php
@@ -215,7 +215,7 @@ function definition() {
$mform->addElement('choosecoursefile', 'mediafile', get_string('mediafile', 'lesson'), array('courseid'=>$COURSE->id));
$mform->setHelpButton('mediafile', array('mediafile', get_string('mediafile', 'lesson'), 'lesson'));
$mform->setDefault('mediafile', '');
- $mform->setType('mediafile', PARAM_PATH);
+ $mform->setType('mediafile', PARAM_RAW);
$mform->addElement('selectyesno', 'mediaclose', get_string('mediaclose', 'lesson'));
$mform->setDefault('mediaclose', 0);

0 comments on commit b42cae4

Please sign in to comment.