Skip to content
Browse files

changed the name for the popups, IE was failing with long names

  • Loading branch information...
1 parent 7ba8ebd commit 7250297f1b10abebee2ece5e0bcc9205cdb97f85 michaelpenne committed Jun 16, 2005
Showing with 5 additions and 2 deletions.
  1. +5 −2 mod/lesson/view.php
View
7 mod/lesson/view.php
@@ -294,7 +294,8 @@
if (!empty($lesson->mediafile)) {
// open our pop-up
$url = '/mod/lesson/mediafile.php?id='.$cm->id;
- $name = $lesson->mediafile;
+ $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;
echo "\n<script language=\"javascript\" type=\"text/javascript\">";
echo "\n<!--\n";
@@ -402,8 +403,10 @@
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'], '.'));
echo '<div align="right">';
- link_to_popup_window ($url, $lesson->mediafile, get_string('mediafilepopup', 'lesson'), '', '', get_string('mediafilepopup', 'lesson'), $options);
+ link_to_popup_window ($url, $name, get_string('mediafilepopup', 'lesson'), '', '', get_string('mediafilepopup', 'lesson'), $options);
helpbutton("mediafilestudent", get_string("mediafile", "lesson"), "lesson");
echo '</div>';
}

0 comments on commit 7250297

Please sign in to comment.
Something went wrong with that request. Please try again.