From: Cindy Li Date: Tue, 12 Oct 2010 17:55:17 +0000 (-0000) Subject: 1. fixed function populate_a4a() to clean up alternatives from db when no resources... X-Git-Tag: v1.1~11 X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=acontent.git;a=commitdiff_plain;h=ba44f956d009e0a18fe9dcdcd78c12542f810ffa 1. fixed function populate_a4a() to clean up alternatives from db when no resources and to figure out content_base_href when it's not presented; 1. added missing controls files into flowplayer module. --- diff --git a/docs/home/classes/ContentUtility.class.php b/docs/home/classes/ContentUtility.class.php index 72bff9c..b1485d0 100644 --- a/docs/home/classes/ContentUtility.class.php +++ b/docs/home/classes/ContentUtility.class.php @@ -208,16 +208,17 @@ class ContentUtility { { $text .= ' '; } diff --git a/docs/home/editor/editor_tab_functions.inc.php b/docs/home/editor/editor_tab_functions.inc.php index f32351c..c7fdda1 100644 --- a/docs/home/editor/editor_tab_functions.inc.php +++ b/docs/home/editor/editor_tab_functions.inc.php @@ -91,12 +91,20 @@ function isValidURL($url) { * @return: none */ function populate_a4a($cid, $content, $formatting){ - global $db, $my_files; + global $my_files, $content_base_href, $contentManager; 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 */ + // initialize content_base_href; used in format_content + if (!isset($content_base_href)) { + $result = $contentManager->getContentPage($cid); + // return if the cid is not found + if (!($content_row = @mysql_fetch_assoc($result))) return; + $content_base_href = $content_row["content_path"].'/'; + } + $body = ContentUtility::formatContent($content, $formatting); $handler = new ContentOutputParser(); @@ -128,23 +136,23 @@ function populate_a4a($cid, $content, $formatting){ $resources[] = convertAmp($file); // converts & to & } - if (count($resources) == 0) return; - $a4a = new A4a($cid); $db_primary_resources = $a4a->getPrimaryResources(); // clean up the removed resources foreach ($db_primary_resources as $primary_rid=>$db_resource){ //if this file from our table is not found in the $resource, then it's not used. - if(in_array($db_resource['resource'], $resources)===false){ - $a4a->deletePrimaryResource($primary_rid); + if(count($resources) == 0 || !in_array($db_resource['resource'], $resources)){ + $a4a->deletePrimaryResource($primary_rid); } } + + if (count($resources) == 0) return; // insert the new resources foreach($resources as $primary_resource) { - if (!is_array($a4a->getPrimaryResourceByName($primary_resource))){ + if (!$a4a->getPrimaryResourceByName($primary_resource)){ $a4a->setPrimaryResource($cid, $primary_resource, $_SESSION['lang']); } } diff --git a/docs/include/jscripts/flowplayer/flowplayer-3.2.4.swf b/docs/include/jscripts/flowplayer/flowplayer-3.2.4.swf new file mode 100644 index 0000000..d8c5ce9 Binary files /dev/null and b/docs/include/jscripts/flowplayer/flowplayer-3.2.4.swf differ diff --git a/docs/include/jscripts/flowplayer/flowplayer-3.2.5.swf b/docs/include/jscripts/flowplayer/flowplayer-3.2.5.swf deleted file mode 100644 index c9ff79a..0000000 Binary files a/docs/include/jscripts/flowplayer/flowplayer-3.2.5.swf and /dev/null differ diff --git a/docs/include/jscripts/flowplayer/flowplayer.audio-3.2.1.swf b/docs/include/jscripts/flowplayer/flowplayer.audio-3.2.1.swf new file mode 100644 index 0000000..3f1ad82 Binary files /dev/null and b/docs/include/jscripts/flowplayer/flowplayer.audio-3.2.1.swf differ diff --git a/docs/include/jscripts/flowplayer/flowplayer.captions-3.2.2.swf b/docs/include/jscripts/flowplayer/flowplayer.captions-3.2.2.swf new file mode 100644 index 0000000..2667a61 Binary files /dev/null and b/docs/include/jscripts/flowplayer/flowplayer.captions-3.2.2.swf differ diff --git a/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.2.swf b/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.2.swf new file mode 100644 index 0000000..3f814c0 Binary files /dev/null and b/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.2.swf differ diff --git a/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.3.swf b/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.3.swf deleted file mode 100644 index 190b5be..0000000 Binary files a/docs/include/jscripts/flowplayer/flowplayer.controls-3.2.3.swf and /dev/null differ diff --git a/docs/include/jscripts/flowplayer/flowplayer.rtmp-3.2.3.swf b/docs/include/jscripts/flowplayer/flowplayer.rtmp-3.2.3.swf new file mode 100644 index 0000000..43f4c19 Binary files /dev/null and b/docs/include/jscripts/flowplayer/flowplayer.rtmp-3.2.3.swf differ