Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace create_function #56

Merged
merged 1 commit into from Jan 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 31 additions & 31 deletions API.php
Expand Up @@ -10,8 +10,8 @@
* @package Piwik_BotTracker
*/
namespace Piwik\Plugins\BotTracker;

use Piwik\DataTable\Row;
use Piwik\DataTable\Row;

use Piwik\Db;
use Piwik\Common;
Expand Down Expand Up @@ -70,7 +70,7 @@ function getAllBotDataWithIcon($idSite)
$dataTable->renameColumn('botActive', 'label');

$dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getActiveIcon'));
$dataTable->filter('ColumnCallbackReplace', array('label', create_function('$label', "return ' ';")));
$dataTable->filter('ColumnCallbackReplace', array('label', function($label) { return ' '; }));
$dataTable->queueFilter('ColumnCallbackAddMetadata', array(array(), 'logoWidth', function () { return 16; }));
$dataTable->queueFilter('ColumnCallbackAddMetadata', array(array(), 'logoHeight', function () { return 16; }));

Expand Down Expand Up @@ -210,19 +210,19 @@ static function htmlentities2utf8 ($string)
$output = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $string);
return html_entity_decode($output);
}

/**
* Get Data for the Report "Top10"
* @param int $idSite
* @param string $period
* @param string $date
* @param bool|string $segment
* @return DataTable
*/
public function getTop10($idSite, $period, $date, $segment = false)
{
return $this->getAllBotDataPie($idSite);
}
/**
* Get Data for the Report "Top10"
* @param int $idSite
* @param string $period
* @param string $date
* @param bool|string $segment
* @return DataTable
*/
public function getTop10($idSite, $period, $date, $segment = false)
{
return $this->getAllBotDataPie($idSite);
}
/**
* Get Data for the Report "BotTracker"
* @param int $idSite
Expand All @@ -235,19 +235,19 @@ public function getBotTracker($idSite, $period, $date, $segment = false)
{
return $this->getAllBotDataWithIcon($idSite);
}


/**
* Get Data for Dashboard-Widget
* @param int $idSite
* @param string $period
* @param string $date
* @param bool|string $segment
* @return DataTable
*/
public function getBotTrackerAnzeige($idSite, $period, $date, $segment = false)
{
return $this->getActiveBotData($idSite);
}

/**
* Get Data for Dashboard-Widget
* @param int $idSite
* @param string $period
* @param string $date
* @param bool|string $segment
* @return DataTable
*/
public function getBotTrackerAnzeige($idSite, $period, $date, $segment = false)
{
return $this->getActiveBotData($idSite);
}
}