Index: core/ViewDataTable/GenerateGraphHTML.php
===================================================================
--- core/ViewDataTable/GenerateGraphHTML.php	(revision 857)
+++ core/ViewDataTable/GenerateGraphHTML.php	(working copy)
@@ -18,27 +18,27 @@
  */
 abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable
 {	
-	protected $width = '100%'; 
+	protected $width = '100%';
 	protected $height = 250;
 	protected $graphType = 'standard';
-	
+
 	/**
 	 * @see Piwik_ViewDataTable::init()
 	 */
 	function init($currentControllerName,
-						$currentControllerAction, 
+						$currentControllerAction,
 						$apiMethodToRequestDataTable )
 	{
 		parent::init($currentControllerName,
-						$currentControllerAction, 
+						$currentControllerAction,
 						$apiMethodToRequestDataTable );
 
 		$this->dataTableTemplate = 'CoreHome/templates/graph.tpl';
-		
+
 		$this->disableOffsetInformation();
 		$this->disableExcludeLowPopulation();
 		$this->disableSearchBox();
-		$this->parametersToModify = array( 
+		$this->parametersToModify = array(
 						'viewDataTable' => $this->getViewDataTableIdToLoad(),
 						// in the case this controller is being executed by another controller
 						// eg. when being widgetized in an IFRAME
@@ -47,7 +47,7 @@
 						'action' => $currentControllerAction,
 		);
 	}
-	
+
 	/**
 	 * Sets parameters to modify in the future generated URL
 	 * @param array $array array('nameParameter' => $newValue, ...)
@@ -56,7 +56,7 @@
 	{
 		$this->parametersToModify = array_merge($this->parametersToModify, $array);
 	}
-	
+
 	/**
 	 * @see Piwik_ViewDataTable::main()
 	 */
@@ -70,7 +70,7 @@
 		
 		$this->view = $this->buildView();
 	}
-	
+
 	protected function buildView()
 	{
 		$view = new Piwik_View($this->dataTableTemplate);
@@ -89,55 +89,51 @@
 		$view->properties = $this->getViewProperties();
 		return $view;
 	}
-	
-	protected function getFlashInvocationCode( $url = 'libs/open-flash-chart/data-files/nodata.txt', $use_swfobject = true  )
-	{ 
-		$width = $this->width; 
-		$height = $this->height; 
 
+	protected function getFlashInvocationCode( $url = 'libs/open-flash-chart/data-files/nodata.txt', $use_swfobject = true )
+	{
+		$width = $this->width;
+		$height = $this->height;
+
 		$libPathInPiwik = 'libs/open-flash-chart/';
 		$currentPath = Piwik_Url::getCurrentUrlWithoutFileName();
 		$pathToLibraryOpenChart = $currentPath . $libPathInPiwik;
-		
+
 		$url = Piwik_Url::getCurrentUrlWithoutQueryString() . $url;
-	    // escape the & and stuff:
-	    $url = urlencode($url);
-		
+		// escape the & and stuff:
+		$url = urlencode($url);
+
 		$obj_id = $this->uniqueIdViewDataTable . "Chart";
-	    $div_name = $this->uniqueIdViewDataTable . "FlashContent";
-	    	   
-	    $return = ''; 
-	    if( $use_swfobject )
-	    {
-	    	// Using library for auto-enabling Flash object on IE, disabled-Javascript proof
-		    $return .=  '
-				<div id="'. $div_name .'"></div>
-				<script type="text/javascript">
-				var so = new SWFObject("'.$pathToLibraryOpenChart.'open-flash-chart.swf", "'.$obj_id.'_swf", "'. $width . '", "' . $height . '", "9", "#FFFFFF");
-				so.addVariable("data", "'. $url . '");
-				so.addParam("allowScriptAccess", "sameDomain");
-				so.addParam("wmode", "transparent");
-				so.write("'. $div_name .'");
-				</script>
-				<noscript>
-				';
+		$div_name = $this->uniqueIdViewDataTable . "FlashContent";
+
+		$return = '';
+		if( $use_swfobject )
+		{
+			// Using library for auto-enabling Flash object on IE, disabled-Javascript proof
+			$return .=  '
+<div id="'. $div_name .'"><div id="'. $obj_id .'_swf"><noscript>';
 		}
+
 		$urlGraph = $pathToLibraryOpenChart."open-flash-chart.swf?data=" . $url;
-		
+
 		// when the object/embed is changed, see also widgetize.js; it may require a logic update
-		$this->graphCodeEmbed .= "<div><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" . $width . "' height='" . $height . "' id='". $obj_id ."' >".
-							"<param name='movie' value='".$urlGraph."' />".
-							"<param name='wmode' value='transparent' />".
-							"<param name='allowScriptAccess' value='sameDomain' /> ".
-							"<embed src='$urlGraph' allowScriptAccess='sameDomain' quality='high' bgcolor='#FFFFFF' width='". $width ."' height='". $height ."' name='open-flash-chart' type='application/x-shockwave-flash' id='". $obj_id ."' />".
-							"</object></div>";
+		$this->graphCodeEmbed .= '<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' . $width . '" height="' . $height . '" id="'. $obj_id .'" >
+<param name="movie" value="'.$urlGraph.'" />
+<param name="wmode" value="opaque" />
+<param name="allowScriptAccess" value="sameDomain" />
+<embed src="'.$urlGraph.'" wmode="opaque" allowScriptAccess="sameDomain" quality="high" bgcolor="#FFFFFF" width="'. $width .'" height="'. $height .'" name="open-flash-chart" type="application/x-shockwave-flash" id="'. $obj_id .'" />
+</object></div>';
 		$return .= $this->graphCodeEmbed;
-		
-		if ( $use_swfobject ) {
-			$return .= '</noscript>';
+
+		if( $use_swfobject )
+		{
+			$return .= '
+</noscript></div></div>
+<script type="text/javascript">
+swfobject.embedSWF("'.$pathToLibraryOpenChart.'open-flash-chart.swf", "'. $obj_id .'_swf", "'. $width . '", "' . $height . '", "9.0.0", false, {"data":"'.$url.'"}, {"allowScriptAccess":"sameDomain","wmode":"opaque"}, {"bgcolor":"#FFFFFF"});
+</script>';
 		}
-		
+
 		return $return;
 	}
 }
-

Property changes on: core/ViewDataTable/GenerateGraphHTML.php
___________________________________________________________________
Added: svn:eol-style
   + native


