update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -14,6 +14,8 @@ use Piwik\API\Request;
use Piwik\Common;
use Piwik\Config;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Url;
use Piwik\View;
/**
@ -23,12 +25,22 @@ class Controller extends \Piwik\Plugin\Controller
{
function index()
{
$token = 'token_auth=' . Common::getRequestVar('token_auth', 'anonymous', 'string');
// when calling the API through http, we limit the number of returned results
if (!isset($_GET['filter_limit'])) {
$_GET['filter_limit'] = Config::getInstance()->General['API_datatable_default_limit'];
$token .= '&api_datatable_default_limit=' . $_GET['filter_limit'];
}
$request = new Request('token_auth=' . Common::getRequestVar('token_auth', 'anonymous', 'string'));
return $request->process();
$request = new Request($token);
$response = $request->process();
if (is_array($response)) {
$response = var_export($response, true);
}
return $response;
}
public function listAllMethods()
@ -58,7 +70,7 @@ class Controller extends \Piwik\Plugin\Controller
foreach ($segments as $segment) {
// Eg. Event Value is a metric, not in the Visit metric category,
// we make sure it is displayed along with the Events dimensions
if($segment['type'] == 'metric' && $segment['category'] != Piwik::translate('General_Visit')) {
if ($segment['type'] == 'metric' && $segment['category'] != Piwik::translate('General_Visit')) {
$segment['type'] = 'dimension';
}
@ -125,4 +137,14 @@ class Controller extends \Piwik\Plugin\Controller
</table>
";
}
public function glossary()
{
Piwik::checkUserHasSomeViewAccess();
return $this->renderTemplate('glossary', array(
'reports' => Request::processRequest('API', array('method' => 'API.getGlossaryReports')),
'metrics' => Request::processRequest('API', array('method' => 'API.getGlossaryMetrics')),
));
}
}