[Piwik-svn] r458 - in trunk: modules/API plugins/API plugins/API/lang plugins/Home/templates

svnmaster at piwik.org svnmaster at piwik.org
Tue May 6 23:24:55 CEST 2008


Author: matt
Date: 2008-05-06 23:24:53 +0200 (Tue, 06 May 2008)
New Revision: 458

Modified:
   trunk/modules/API/Proxy.php
   trunk/plugins/API/API.php
   trunk/plugins/API/Controller.php
   trunk/plugins/API/lang/en.php
   trunk/plugins/Home/templates/links_misc_modules.tpl
Log:
- clarified the API key help
- included API section in the admin area

Modified: trunk/modules/API/Proxy.php
===================================================================
--- trunk/modules/API/Proxy.php	2008-05-06 21:01:04 UTC (rev 457)
+++ trunk/modules/API/Proxy.php	2008-05-06 21:24:53 UTC (rev 458)
@@ -236,7 +236,7 @@
 		foreach($this->api as $class => $info)
 		{
 			$moduleName = $this->getModuleNameFromClassName($class);
-			$str .= "\n<h3>Module ".$moduleName."</h3>";
+			$str .= "\n<h2>Module ".$moduleName."</h2>";
 			
 			foreach($info as $methodName => $infoMethod)
 			{

Modified: trunk/plugins/API/API.php
===================================================================
--- trunk/plugins/API/API.php	2008-05-06 21:01:04 UTC (rev 457)
+++ trunk/plugins/API/API.php	2008-05-06 21:24:53 UTC (rev 458)
@@ -25,3 +25,4 @@
 	}
 }
 
+Piwik_AddAdminMenu('API', array('module' => 'API', 'action' => 'listAllAPI'));
\ No newline at end of file

Modified: trunk/plugins/API/Controller.php
===================================================================
--- trunk/plugins/API/Controller.php	2008-05-06 21:01:04 UTC (rev 457)
+++ trunk/plugins/API/Controller.php	2008-05-06 21:24:53 UTC (rev 458)
@@ -20,7 +20,6 @@
 {
 	function index()
 	{
-//		sleep(1);
 		$request = new Piwik_API_Request();
 		echo $request->process();
 	}
@@ -39,7 +38,6 @@
 				$loaded++;
 			}
 			catch(Exception $e){
-//				$errors .= "<br>\n" . $e->getMessage();
 			}
 		}
 		return $loaded;
@@ -55,10 +53,19 @@
 	function listAllAPI()
 	{
 		$token_auth = Zend_Registry::get('auth')->getTokenAuth();
-		echo "<style>body{ font-family:georgia,arial; font-size:0.95em;} </style>";
+		echo "<style>body{ font-family:georgia,arial; font-size:0.95em;} 
+		#token_auth { 
+			background-color:#E8FFE9; 
+			border-color:#00CC3A; 
+			border-style: solid;
+			border-width: 1px;
+			margin: 0pt 0pt 16px 8px;
+			padding: 12px;			
+			line-height:4em;
+		</style>";
 		echo sprintf(Piwik_Translate('API_QuickDocumentation'),$token_auth);
+		echo "<span id='token_auth'>token_auth = <b>$token_auth</b></span>";
 
-
 		$loaded = $this->init();
 		echo "<p><i> ".sprintf(Piwik_Translate('API_LoadedAPIs'),$loaded)."</i></p>\n";
 		

Modified: trunk/plugins/API/lang/en.php
===================================================================
--- trunk/plugins/API/lang/en.php	2008-05-06 21:01:04 UTC (rev 457)
+++ trunk/plugins/API/lang/en.php	2008-05-06 21:24:53 UTC (rev 458)
@@ -1,12 +1,12 @@
 <?php
 $translations = array(
 	'API_QuickDocumentation' => 
-		"<h1>API quick documentation</h1>".
+		"<h2>API quick documentation</h2>".
 		"<p>If you don't have data for today you can first <a href='misc/generateVisits.php' target=_blank>generate some data</a> using the Visits Generator script.</p>".
 		"<p>You can try the different formats available for every method. It is very easy to extract any data you want from piwik!</p>".
-		"<p>If you want to <b>request the data without being logged in to Piwik</b> you need to add the parameter <code><u>&token_auth=%s</u></code> to the API calls URLs that require authentication.</p>".
-		"<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a> or the <a href='http://dev.piwik.org/trac/wiki/API/Reference'>API Reference</a>.</b></P>",
+		"<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a> or the <a href='http://dev.piwik.org/trac/wiki/API/Reference'>API Reference</a>.</b></P>".
+		"<h2>User authentication</h2>".
+		"<p>If you want to <b>request the data in your scripts, in a crontab, etc. </b> you need to add the parameter <code><u>&token_auth=%s</u></code> to the API calls URLs that require authentication.</p>".
+		"<p>This token_auth is as secret as your login and password, <b>do not share it!</p>",
 	'API_LoadedAPIs' => 'Loaded successfully %s APIs',
-	
-
 );

Modified: trunk/plugins/Home/templates/links_misc_modules.tpl
===================================================================
--- trunk/plugins/Home/templates/links_misc_modules.tpl	2008-05-06 21:01:04 UTC (rev 457)
+++ trunk/plugins/Home/templates/links_misc_modules.tpl	2008-05-06 21:24:53 UTC (rev 458)
@@ -1,8 +1,8 @@
 <script type="text/javascript" src="libs/jquery/thickbox.js"></script>
 <link rel="stylesheet" href="libs/jquery/thickbox.css">
-<span id="miscLinks">
+<div id="miscLinks">
 <a href='?module=AdminHome'>Admin</a></li> |
-<a href='?module=API&action=listAllAPI'><b>API </b></a> | 
+<a href='?module=AdminHome&action=showInContext&moduleToLoad=API&actionToLoad=listAllAPI&module=AdminHome&action=showInContext'><b>API</b></a> | 
 <a href='?module=Widgetize'>Widgets</li></a> |
 <a href='?module=Feedback&action=index&keepThis=true&TB_iframe=true&height=400&width=400' title="Send us feedback" class="thickbox">Send us feedback</a>
-</span>
+</div>



More information about the Piwik-svn mailing list