[Piwik-svn] r193 - in trunk/modules: API DataTable/Renderer

svnmaster at piwik.org svnmaster at piwik.org
Fri Jan 18 18:02:49 CET 2008


Author: matt
Date: 2008-01-18 18:02:49 +0100 (Fri, 18 Jan 2008)
New Revision: 193

Modified:
   trunk/modules/API/Proxy.php
   trunk/modules/API/Request.php
   trunk/modules/DataTable/Renderer/Xml.php
Log:
Doc

Modified: trunk/modules/API/Proxy.php
===================================================================
--- trunk/modules/API/Proxy.php	2008-01-18 16:57:49 UTC (rev 192)
+++ trunk/modules/API/Proxy.php	2008-01-18 17:02:49 UTC (rev 193)
@@ -246,19 +246,21 @@
 				$str .= '<small>';
 				
 				if($outputExampleUrls)
-				{
+				{
+					// we prefix all URLs with $prefixUrls
+					// used when we include this output in the Piwik official documentation for example
 					$exampleUrl = $this->getExampleUrl($class, $methodName);
 					if($exampleUrl !== false)
 					{
 						$lastNUrls = '';
 						if( ereg('(date)',$exampleUrl))
 						{
-							$exampleUrlRss1 = $this->getExampleUrl($class, $methodName, array('date' => 'last10')) . $prefixUrls;
-							$exampleUrlRss2 = $this->getExampleUrl($class, $methodName, array('date' => 'last5','period' => 'week',)) . $prefixUrls;
+							$exampleUrlRss1 = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last10')) ;
+							$exampleUrlRss2 = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last5','period' => 'week',));
 							$lastNUrls = ",	RSS of the last <a target=_blank href='$exampleUrlRss1&format=rss'>10 days</a>, <a target=_blank href='$exampleUrlRss2&format=Rss'>5 weeks</a>,
 									XML of the <a target=_blank href='$exampleUrlRss1&format=xml'>last 10 days</a>";
 						}
-						$exampleUrl = $exampleUrl . $prefixUrls;
+						$exampleUrl = $prefixUrls . $exampleUrl ;
 						$str .= " [ Example in  
 									<a target=_blank href='$exampleUrl&format=xml'>XML</a>, 
 									<a target=_blank href='$exampleUrl&format=PHP&prettyDisplay=true'>PHP</a>, 

Modified: trunk/modules/API/Request.php
===================================================================
--- trunk/modules/API/Request.php	2008-01-18 16:57:49 UTC (rev 192)
+++ trunk/modules/API/Request.php	2008-01-18 17:02:49 UTC (rev 193)
@@ -326,8 +326,7 @@
 		switch($format)
 		{
 			case 'xml':
-				@header('Content-type: text/xml');
-				
+				@header("Content-Type: text/xml;charset=utf-8");
 				$return = 
 					'<?xml version="1.0" encoding="utf-8" ?>'.
 					'<result>'.
@@ -372,7 +371,7 @@
 		switch($format)
 		{
 			case 'xml':
-				@header('Content-type: text/xml');
+				@header("Content-Type: text/xml;charset=utf-8");
 				$return = 
 					'<?xml version="1.0" encoding="utf-8" ?>'.
 					'<result>'.

Modified: trunk/modules/DataTable/Renderer/Xml.php
===================================================================
--- trunk/modules/DataTable/Renderer/Xml.php	2008-01-18 16:57:49 UTC (rev 192)
+++ trunk/modules/DataTable/Renderer/Xml.php	2008-01-18 17:02:49 UTC (rev 193)
@@ -211,7 +211,7 @@
 	protected function output( $xml )
 	{
 		// silent fail because otherwise it throws an exception in the unit tests
-		@header('Content-type: text/xml');
+		@header("Content-Type: text/xml;charset=utf-8");
 		$xml = '<?xml version="1.0" encoding="utf-8" ?>' .  "\n" . $xml;
 		return $xml;
 	}



More information about the Piwik-svn mailing list