[svn r16639] fix another bug when editing a document with audioplayer

skala
Eric Marguin 16 years ago
parent 38dfe92324
commit 08d6fdeacd
  1. 6
      main/document/create_document.php
  2. 11
      main/document/edit_document.php
  3. 11
      main/newscorm/learnpath.class.php

@ -1,5 +1,5 @@
<?php <?php
// $Id: create_document.php 16635 2008-10-28 10:12:46Z elixir_inter $ // $Id: create_document.php 16639 2008-10-29 08:39:49Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -400,8 +400,10 @@ if ($form->validate())
// change the path of mp3 to absolute // change the path of mp3 to absolute
// first regexp deals with ../../../ urls
$content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content); $content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
//second regexp deals with audio/ urls
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/',$content);
fputs($fp, $content); fputs($fp, $content);

@ -1,4 +1,4 @@
<?php // $Id: edit_document.php 16635 2008-10-28 10:12:46Z elixir_inter $ <?php // $Id: edit_document.php 16639 2008-10-29 08:39:49Z elixir_inter $
/* /*
============================================================================== ==============================================================================
Dokeos - elearning and course management software Dokeos - elearning and course management software
@ -413,10 +413,13 @@ if($is_allowedToEdit)
$texte = str_replace('flv=/','flv=/|',$texte); $texte = str_replace('flv=/','flv=/|',$texte);
// change the path of mp3 to absolute // change the path of mp3 to absolute
// first regexp deals with ../../../ urls
$texte = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$texte); $texte = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$texte);
//second regexp deals with audio/ urls
$texte = preg_replace("|(flashvars=\"file=)([^/]+)/|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/',$texte);
fputs($fp,$texte);
fputs($fp,$texte);
fclose($fp); fclose($fp);
$perm = api_get_setting('permissions_for_new_directories'); $perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770'); $perm = octdec(!empty($perm)?$perm:'0770');

@ -4483,9 +4483,11 @@ class learnpath {
$content = str_replace(api_get_path('WEB_COURSE_PATH'), api_get_path(REL_PATH).'courses/', $content); $content = str_replace(api_get_path('WEB_COURSE_PATH'), api_get_path(REL_PATH).'courses/', $content);
// change the path of mp3 to absolute // change the path of mp3 to absolute
// first regexp deals with ../../../ urls
$content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content); $content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
//second regexp deals with audio/ urls
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/',$content);
// for flv player : to prevent edition problem with firefox, we have to use a strange tip (don't blame me please) // for flv player : to prevent edition problem with firefox, we have to use a strange tip (don't blame me please)
$content = str_replace('</body>','<style type="text/css">body{}</style></body>',$content); $content = str_replace('</body>','<style type="text/css">body{}</style></body>',$content);
@ -4588,8 +4590,11 @@ class learnpath {
$content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $content); $content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $content);
// change the path of mp3 to absolute // change the path of mp3 to absolute
// first regexp deals with ../../../ urls
$content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content); $content = preg_replace("|(flashvars=\"file=)(\.+/)+|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
//second regexp deals with audio/ urls
$content = preg_replace("|(flashvars=\"file=)([^/]+)/|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/',$content);
fputs($fp, $content); fputs($fp, $content);
fclose($fp); fclose($fp);
} }

Loading…
Cancel
Save