[svn r16555] change the path to audio files of mp3 players to absolute ones

skala
Eric Marguin 17 years ago
parent 9e1821a94b
commit 61196097e8
  1. 16
      main/document/create_document.php
  2. 13
      main/document/edit_document.php
  3. 15
      main/newscorm/learnpath.class.php

@ -1,5 +1,5 @@
<?php
// $Id: create_document.php 16553 2008-10-17 07:31:11Z elixir_inter $
// $Id: create_document.php 16555 2008-10-17 10:29:14Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -397,17 +397,11 @@ if ($form->validate())
$content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $texte);
// replace fake by flv player if needed (fake is present only in templates)
$content = str_replace('<img src="'.api_get_path(REL_PATH).'main/inc/lib/fckeditor/editor/css/images/flv.gif?flv=',
'<object type="application/x-shockwave-flash" data="'.api_get_path(REL_PATH).'main/inc/lib/flv_player/player_flv_mini.swf" height="240" width="320">
<param name="movie" value="'.api_get_path(REL_PATH).'main/inc/lib/flv_player/player_flv_mini.swf" />
<param name="FlashVars" value="flv=',$content);
$content = str_replace('&amp;endflv" alt="" />','&autoplay=1" /></object><style type="text/css">body{}</style>',$content);
$texte = str_replace('mp3player.swf?son='.urlencode($path_to_remove), 'mp3player.swf?son=.%2F', $texte);
// change the path of mp3 to absolute
$content = preg_replace("|(flashvars=\"file=)([\./]*)|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
fputs($fp, $content);
fclose($fp);

@ -1,4 +1,4 @@
<?php // $Id: edit_document.php 16553 2008-10-17 07:31:11Z elixir_inter $
<?php // $Id: edit_document.php 16555 2008-10-17 10:29:14Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -411,12 +411,11 @@ if($is_allowedToEdit)
//if flv player, change absolute paht temporarely to prevent from erasing it in the following lines
$texte = str_replace('flv=h','flv=h|',$texte);
$texte = str_replace('flv=/','flv=/|',$texte);
$path_to_remove=api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir;
$texte=str_replace($path_to_remove,'./',$texte);
$texte=str_replace('mp3player.swf?son='.urlencode($path_to_remove),'mp3player.swf?son=.%2F',$texte);
// for flv player : change back the url to absolute
$texte = str_replace('flv=h|','flv=h',$texte);
$texte = str_replace('flv=/|','flv=/',$texte);
// change the path of mp3 to absolute
$texte = preg_replace("|(flashvars=\"file=)([\./]*)|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$texte);
fputs($fp,$texte);
fclose($fp);
$perm = api_get_setting('permissions_for_new_directories');

@ -4479,16 +4479,12 @@ class learnpath {
$filename = $tmp_filename . '.html';
$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);
$content = str_replace(api_get_path('WEB_COURSE_PATH'), api_get_path(REL_PATH).'courses/', $content);
// for flv player : change back the url to absolute
$content = str_replace('flv=h|','flv=h',$content);
$content = str_replace('flv=/|','flv=/',$content);
// change the path of mp3 to absolute
$content = preg_replace("|(flashvars=\"file=)([\./]*)|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
// for flv player : to prevent edition problem with firefox, we have to use a strange tip (don't blame me please)
@ -4591,6 +4587,9 @@ class learnpath {
$content = text_filter($content);
$content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $content);
// change the path of mp3 to absolute
$content = preg_replace("|(flashvars=\"file=)([\./]*)|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
fputs($fp, $content);
fclose($fp);
}

Loading…
Cancel
Save