Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Contents/VisitorDetails.php')
-rw-r--r--plugins/Contents/VisitorDetails.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/Contents/VisitorDetails.php b/plugins/Contents/VisitorDetails.php
new file mode 100644
index 0000000000..acf3363d38
--- /dev/null
+++ b/plugins/Contents/VisitorDetails.php
@@ -0,0 +1,50 @@
+<?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;
+
+use Piwik\Plugins\Live\VisitorDetailsAbstract;
+use Piwik\Tracker\Action;
+use Piwik\View;
+
+class VisitorDetails extends VisitorDetailsAbstract
+{
+ public function extendActionDetails(&$action, $nextAction, $visitorDetails)
+ {
+ if ($action['type'] != Action::TYPE_CONTENT) {
+ unset($action['contentName']);
+ unset($action['contentPiece']);
+ unset($action['contentTarget']);
+ unset($action['contentInteraction']);
+ }
+ }
+
+ public function renderAction($action, $previousAction, $visitorDetails)
+ {
+ if ($action['type'] != Action::TYPE_CONTENT) {
+ return;
+ }
+
+ $view = new View('@Contents/_actionContent.twig');
+ $view->action = $action;
+ $view->previousAction = $previousAction;
+ $view->visitInfo = $visitorDetails;
+ return $view->render();
+ }
+
+ public function renderActionTooltip($action, $visitInfo)
+ {
+ if ($action['type'] != Action::TYPE_CONTENT) {
+ return [];
+ }
+
+ $view = new View('@Contents/_actionTooltip');
+ $view->action = $action;
+ return [[ 10, $view->render() ]];
+ }
+} \ No newline at end of file