Browse Source

[svn r13222] fix bugs with flv player in learnpath docs

Eric Marguin 17 years ago
parent
commit
ca4d414ae7
1 changed files with 9 additions and 0 deletions
  1. 9 0
      main/newscorm/learnpath.class.php

+ 9 - 0
main/newscorm/learnpath.class.php

@@ -3976,9 +3976,18 @@ class learnpath {
 		
 		$content = stripslashes(text_filter($content));
 		
+		//if flv player, change absolute paht temporarely to prevent from erasing it in the following lines
+		$content = str_replace('flv=h','flv=h|',$content);
+		$content = str_replace('flv=/','flv=/|',$content);		
+		
 		$path_to_remove = api_get_path('WEB_COURSE_PATH') . $_course['path'] . '/document' . $dir;
 		$content = str_replace($path_to_remove, './', $content);
 		
+		// for flv player : change back the url to absolute
+		$content = str_replace('flv=h|','flv=h',$content);
+		$content = str_replace('flv=/|','flv=/',$content);
+		
+		
 		if(!file_exists($filepath . $filename))
 		{
 			if($fp = @fopen($filepath . $filename, 'w'))