PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@ -0,0 +1,60 @@
<?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\Contents\Columns;
use Piwik\Columns\Discriminator;
use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
class ContentInteraction extends ActionDimension
{
protected $columnName = 'idaction_content_interaction';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected $type = self::TYPE_TEXT;
protected $acceptValues = 'The type of interaction with the content. For instance "click" or "submit".';
protected $segmentName = 'contentInteraction';
protected $nameSingular = 'Contents_ContentInteraction';
protected $namePlural = 'Contents_ContentInteractions';
protected $category = 'General_Actions';
protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
public function getDbColumnJoin()
{
return new ActionNameJoin();
}
public function getDbDiscriminator()
{
return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
{
return Action::TYPE_CONTENT_INTERACTION;
}
public function onLookupAction(Request $request, Action $action)
{
if (!($action instanceof ActionContent)) {
return false;
}
$interaction = $request->getParam('c_i');
$interaction = trim($interaction);
if (strlen($interaction) > 0) {
return $interaction;
}
return false;
}
}

View File

@ -0,0 +1,61 @@
<?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\Contents\Columns;
use Piwik\Columns\Discriminator;
use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Exception\InvalidRequestParameterException;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
class ContentName extends ActionDimension
{
protected $columnName = 'idaction_content_name';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected $segmentName = 'contentName';
protected $nameSingular = 'Contents_ContentName';
protected $namePlural = 'Contents_ContentNames';
protected $acceptValues = 'The name of a content block, for instance "Ad Sale"';
protected $type = self::TYPE_TEXT;
protected $category = 'General_Actions';
protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
public function getDbColumnJoin()
{
return new ActionNameJoin();
}
public function getDbDiscriminator()
{
return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
{
return Action::TYPE_CONTENT_NAME;
}
public function onLookupAction(Request $request, Action $action)
{
if (!($action instanceof ActionContent)) {
return false;
}
$contentName = $request->getParam('c_n');
$contentName = trim($contentName);
if (strlen($contentName) > 0) {
return $contentName;
}
throw new InvalidRequestParameterException('Param `c_n` must not be empty or filled with whitespaces');
}
}

View File

@ -0,0 +1,60 @@
<?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\Contents\Columns;
use Piwik\Columns\Discriminator;
use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
class ContentPiece extends ActionDimension
{
protected $columnName = 'idaction_content_piece';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected $segmentName = 'contentPiece';
protected $nameSingular = 'Contents_ContentPiece';
protected $namePlural = 'Contents_ContentPieces';
protected $acceptValues = 'The actual content. For instance "ad.jpg" or "My text ad"';
protected $type = self::TYPE_TEXT;
protected $category = 'General_Actions';
protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
public function getDbColumnJoin()
{
return new ActionNameJoin();
}
public function getDbDiscriminator()
{
return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
{
return Action::TYPE_CONTENT_PIECE;
}
public function onLookupAction(Request $request, Action $action)
{
if (!($action instanceof ActionContent)) {
return false;
}
$contentPiece = $request->getParam('c_p');
$contentPiece = trim($contentPiece);
if (strlen($contentPiece) > 0) {
return $contentPiece;
}
return false;
}
}

View File

@ -0,0 +1,60 @@
<?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\Contents\Columns;
use Piwik\Columns\Discriminator;
use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
class ContentTarget extends ActionDimension
{
protected $columnName = 'idaction_content_target';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
protected $type = self::TYPE_URL;
protected $nameSingular = 'Contents_ContentTarget';
protected $namePlural = 'Contents_ContentTargets';
protected $segmentName = 'contentTarget';
protected $category = 'General_Actions';
protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
protected $acceptValues = 'For instance the URL of a landing page: "http://landingpage.example.com"';
public function getDbColumnJoin()
{
return new ActionNameJoin();
}
public function getDbDiscriminator()
{
return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
{
return Action::TYPE_CONTENT_TARGET;
}
public function onLookupAction(Request $request, Action $action)
{
if (!($action instanceof ActionContent)) {
return false;
}
$contentTarget = $request->getParam('c_t');
$contentTarget = trim($contentTarget);
if (strlen($contentTarget) > 0) {
return $contentTarget;
}
return false;
}
}

View File

@ -0,0 +1,57 @@
<?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\Contents\Columns\Metrics;
use Piwik\DataTable\Row;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugin\ProcessedMetric;
/**
* The content interaction rate. Calculated as:
*
* nb_interactions / nb_impressions
*
* nb_interactions & nb_impressions are calculated by the Contents archiver.
*/
class InteractionRate extends ProcessedMetric
{
public function getName()
{
return 'interaction_rate';
}
public function getTranslatedName()
{
return Piwik::translate('Contents_InteractionRate');
}
public function getDocumentation()
{
return Piwik::translate('Contents_InteractionRateMetricDocumentation');
}
public function compute(Row $row)
{
$interactions = $this->getMetric($row, 'nb_interactions');
$impressions = $this->getMetric($row, 'nb_impressions');
return Piwik::getQuotientSafe($interactions, $impressions, $precision = 4);
}
public function format($value, Formatter $formatter)
{
return $formatter->getPrettyPercentFromQuotient($value);
}
public function getDependentMetrics()
{
return array('nb_interactions', 'nb_impressions');
}
}