From 033eb7d8c4ac652fe2a38a6568100b7541b2f7cf Mon Sep 17 00:00:00 2001 From: Cindy Li Date: Fri, 8 Oct 2010 18:42:04 +0000 Subject: [PATCH] 1. replace AT_INCLUDE_PATH with TR_INCLUDE_PATH 2. copy over the flowplayer handling from ATutor --- docs/home/classes/ContentUtility.class.php | 47 ++++++++++++++----- docs/home/editor/editor_tab_functions.inc.php | 6 +-- .../editor/editor_tabs/alternatives.inc.php | 2 +- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/docs/home/classes/ContentUtility.class.php b/docs/home/classes/ContentUtility.class.php index 21e8e4d..f90f236 100644 --- a/docs/home/classes/ContentUtility.class.php +++ b/docs/home/classes/ContentUtility.class.php @@ -140,19 +140,40 @@ class ContentUtility { private static function embedFLV($text) { global $content_base_href; - // .flv - uses Flowplayer 3.0 from flowplayer.org (playing file via full URL) - preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[0],PREG_SET_ORDER); - $media_replace[0] =" - "; - - // .flv - uses Flowplayer 3.0 from flowplayer.org (playing file from AT_content_dir) - preg_match_all("#\[media[0-9a-z\|]*\]([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[1],PREG_SET_ORDER); - $media_replace[1] =" - "; + $media_replace = array(); + $media_matches = array(); + + // .flv (playing file via full URL) + preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.flv\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .flv (playing file from TR_content_dir) + preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.flv\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mp4 (playing file via full URL) + preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mp4\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mp4 (playing file from TR_content_dir) + preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.mp4\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mov (playing file via full URL) + preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mov\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mov (playing file from TR_content_dir) + preg_match_all("#\[media[0-9a-z\|]*\]([.\w\d]+[^\s\"]+)\.mov\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mp3 (playing file via full URL) + preg_match_all("#\[media[0-9a-z\|]*\]http://([\w\./-]+)\.mp3\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; + + // .mp3 (playing file from TR_content_dir) + preg_match_all("#\[media[0-9a-z\|]*\](.+[^\s\"]+)\.mp3\[/media\]#i",$text,$media_matches[],PREG_SET_ORDER); + $media_replace[] =""; $has_flv = false; // Executing the replace diff --git a/docs/home/editor/editor_tab_functions.inc.php b/docs/home/editor/editor_tab_functions.inc.php index 58e8c62..fb004e2 100644 --- a/docs/home/editor/editor_tab_functions.inc.php +++ b/docs/home/editor/editor_tab_functions.inc.php @@ -93,9 +93,9 @@ function isValidURL($url) { function populate_a4a($cid, $content, $formatting){ global $db, $my_files; - include_once(AT_INCLUDE_PATH.'classes/A4a/A4a.class.php'); - include_once(AT_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php'); /* for XML_HTMLSax */ - include_once(AT_INCLUDE_PATH.'classes/ContentOutputParser.class.php'); /* for parser */ + include_once(TR_INCLUDE_PATH.'classes/A4a/A4a.class.php'); + include_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php'); /* for XML_HTMLSax */ + include_once(TR_INCLUDE_PATH.'classes/ContentOutputParser.class.php'); /* for parser */ $body = format_content($content, $formatting,array()); diff --git a/docs/home/editor/editor_tabs/alternatives.inc.php b/docs/home/editor/editor_tabs/alternatives.inc.php index ebf1231..7fe20db 100644 --- a/docs/home/editor/editor_tabs/alternatives.inc.php +++ b/docs/home/editor/editor_tabs/alternatives.inc.php @@ -97,7 +97,7 @@ function display_alternative_cell($secondary_resources, $alternative_type, $cont global $db, $content_row; populate_a4a($cid, $_POST['body_text'], $_POST['formatting']); -include_once(AT_INCLUDE_PATH.'classes/A4a/A4a.class.php'); +include_once(TR_INCLUDE_PATH.'classes/A4a/A4a.class.php'); $a4a = new A4a($cid); $primary_resources = $a4a->getPrimaryResources(); -- 2.17.1