update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
48
www/analytics/plugins/CustomVariables/Columns/Base.php
Normal file
48
www/analytics/plugins/CustomVariables/Columns/Base.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace Piwik\Plugins\CustomVariables\Columns;
|
||||
|
||||
use Piwik\DataTable;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugin\Dimension\VisitDimension;
|
||||
use Piwik\Plugin\Segment;
|
||||
use Piwik\Plugins\CustomVariables\CustomVariables;
|
||||
|
||||
class Base extends VisitDimension
|
||||
{
|
||||
protected function configureSegmentsFor($segmentNameSuffix)
|
||||
{
|
||||
$numCustomVariables = CustomVariables::getNumUsableCustomVariables();
|
||||
|
||||
$segment = new Segment();
|
||||
$segment->setType('dimension');
|
||||
$segment->setSegment('customVariable' . $segmentNameSuffix);
|
||||
$segment->setName($this->getName() . ' (' . Piwik::translate('CustomVariables_ScopeVisit') . ')');
|
||||
$segment->setCategory('CustomVariables_CustomVariables');
|
||||
$segment->setUnionOfSegments($this->getSegmentColumns('customVariable' . $segmentNameSuffix, $numCustomVariables));
|
||||
$this->addSegment($segment);
|
||||
|
||||
$segment = new Segment();
|
||||
$segment->setType('dimension');
|
||||
$segment->setSegment('customVariablePage' . $segmentNameSuffix);
|
||||
$segment->setName($this->getName() . ' (' . Piwik::translate('CustomVariables_ScopePage') . ')');
|
||||
$segment->setCategory('CustomVariables_CustomVariables');
|
||||
$segment->setUnionOfSegments($this->getSegmentColumns('customVariablePage' . $segmentNameSuffix, $numCustomVariables));
|
||||
$this->addSegment($segment);
|
||||
}
|
||||
|
||||
private function getSegmentColumns($column, $numCustomVariables)
|
||||
{
|
||||
$columns = array();
|
||||
for ($i = 1; $i <= $numCustomVariables; ++$i) {
|
||||
$columns[] = $column . $i;
|
||||
}
|
||||
return $columns;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue