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/ProfessionalServices/ProfessionalServices.php')
-rw-r--r--plugins/ProfessionalServices/ProfessionalServices.php51
1 files changed, 41 insertions, 10 deletions
diff --git a/plugins/ProfessionalServices/ProfessionalServices.php b/plugins/ProfessionalServices/ProfessionalServices.php
index 5dd848e61d..d11bc22b38 100644
--- a/plugins/ProfessionalServices/ProfessionalServices.php
+++ b/plugins/ProfessionalServices/ProfessionalServices.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\ProfessionalServices;
use Piwik\Common;
use Piwik\View;
+use Piwik\Plugin;
class ProfessionalServices extends \Piwik\Plugin
{
@@ -26,6 +27,8 @@ class ProfessionalServices extends \Piwik\Plugin
'Template.endGoalEditTable' => array('function' => 'getGoalFunnelOverviewPromo', 'after' => true),
'Template.afterEventsReport' => 'getEventsPromo',
'Template.afterReferrersKeywordsReport' => 'getSearchKeywordsPerformancePromo',
+ 'Template.afterOverlaySidebar' => 'getHeatmapPromo',
+ 'Template.afterVisitorProfileOverview' => 'getSessionRecordingPromo',
);
}
@@ -48,7 +51,7 @@ class ProfessionalServices extends \Piwik\Plugin
$action = 'promoServices';
}
- if($action == 'rssPiwikPro') {
+ if ($action == 'rssPiwikPro') {
$action = 'rss';
}
}
@@ -60,10 +63,29 @@ class ProfessionalServices extends \Piwik\Plugin
return $isWidget;
}
+ public function getHeatmapPromo(&$out)
+ {
+ if (!$this->shouldShowPromoForPlugin('HeatmapSessionRecording')) {
+ return;
+ }
+
+ $view = new View('@ProfessionalServices/promoHeatmaps');
+ $out .= $view->render();
+ }
+
+ public function getSessionRecordingPromo(&$out)
+ {
+ if (!$this->shouldShowPromoForPlugin('HeatmapSessionRecording')) {
+ return;
+ }
+
+ $view = new View('@ProfessionalServices/promoSessionRecordings');
+ $out .= $view->render();
+ }
+
public function getSearchKeywordsPerformancePromo(&$out)
{
- if(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('SearchEngineKeywordsPerformance')
- || $this->isRequestForDashboardWidget()) {
+ if (!$this->shouldShowPromoForPlugin('SearchEngineKeywordsPerformance')) {
return;
}
@@ -73,8 +95,7 @@ class ProfessionalServices extends \Piwik\Plugin
public function getGoalFunnelOverviewPromo(&$out)
{
- if(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('Funnels')
- || $this->isRequestForDashboardWidget()) {
+ if (!$this->shouldShowPromoForPlugin('Funnels')) {
return;
}
@@ -82,11 +103,9 @@ class ProfessionalServices extends \Piwik\Plugin
$out .= $view->render();
}
-
public function getGoalOverviewPromo(&$out)
{
- if(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('AbTesting')
- || $this->isRequestForDashboardWidget()) {
+ if (!$this->shouldShowPromoForPlugin('AbTesting')) {
return;
}
@@ -96,11 +115,23 @@ class ProfessionalServices extends \Piwik\Plugin
public function getEventsPromo(&$out)
{
- if($this->isRequestForDashboardWidget()) {
+ if ($this->isRequestForDashboardWidget()) {
return;
}
+
$view = new View('@ProfessionalServices/promoBelowEvents');
- $view->displayMediaAnalyticsAd = !\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MediaAnalytics');
+ $view->displayMediaAnalyticsAd = !$this->isPluginActivated('MediaAnalytics');
$out .= $view->render();
}
+
+ private function shouldShowPromoForPlugin($pluginName)
+ {
+ return !$this->isPluginActivated($pluginName) && !$this->isRequestForDashboardWidget();
+ }
+
+ private function isPluginActivated($pluginName)
+ {
+ return Plugin\Manager::getInstance()->isPluginActivated($pluginName);
+ }
+
}