diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-02-10 08:37:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 08:37:26 +0300 |
commit | bc1d57f6dc43e843d26cbb5e484539201f518cf9 (patch) | |
tree | 124d9ba0bb2f0a860fdaa9e39c059944dc94af4e /plugins/CoreHome/Categories | |
parent | f3782b96ad41d9ec52e759e7ca47bceba570bc35 (diff) |
Display help icons for categories/subcategories (#17062)
* show help icons in left and display help messages on click
* pointless commit
* more fixes for when to show icon persistent
* More docs & more fixes.
* some fixes, more styling changes + UI test
* remove line breaks
* fix link
* update SecurityInfo plugin to latest
* apply more review feedback
* Adding help text + tweak to notification title bar.
* fix issues after review and make exception clearer
* update submodules
* Update CustomVariables submodule.
* fixing tests
* fix test
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/CoreHome/Categories')
5 files changed, 33 insertions, 0 deletions
diff --git a/plugins/CoreHome/Categories/DevicesSubcategory.php b/plugins/CoreHome/Categories/DevicesSubcategory.php index 2d2e6193c6..f212d9568f 100644 --- a/plugins/CoreHome/Categories/DevicesSubcategory.php +++ b/plugins/CoreHome/Categories/DevicesSubcategory.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\CoreHome\Categories; use Piwik\Category\Subcategory; +use Piwik\Piwik; class DevicesSubcategory extends Subcategory { @@ -16,4 +17,8 @@ class DevicesSubcategory extends Subcategory protected $id = 'DevicesDetection_Devices'; protected $order = 15; + public function getHelp() + { + return '<p>' . Piwik::translate('CoreHome_DevicesSubcategoryHelp') . '</p>'; + } } diff --git a/plugins/CoreHome/Categories/EngagementSubcategory.php b/plugins/CoreHome/Categories/EngagementSubcategory.php index 4e840bf2d8..2e016d06ba 100644 --- a/plugins/CoreHome/Categories/EngagementSubcategory.php +++ b/plugins/CoreHome/Categories/EngagementSubcategory.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\CoreHome\Categories; use Piwik\Category\Subcategory; +use Piwik\Piwik; class EngagementSubcategory extends Subcategory { @@ -16,4 +17,9 @@ class EngagementSubcategory extends Subcategory protected $id = 'VisitorInterest_Engagement'; protected $order = 46; + public function getHelp() + { + return '<p>' . Piwik::translate('CoreHome_EngagementSubcategoryHelp1') . '</p>' + . '<p>' . Piwik::translate('CoreHome_EngagementSubcategoryHelp2') . '</p>'; + } } diff --git a/plugins/CoreHome/Categories/SoftwareSubcategory.php b/plugins/CoreHome/Categories/SoftwareSubcategory.php index 5f7cabf6b1..5672adb559 100644 --- a/plugins/CoreHome/Categories/SoftwareSubcategory.php +++ b/plugins/CoreHome/Categories/SoftwareSubcategory.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\CoreHome\Categories; use Piwik\Category\Subcategory; +use Piwik\Piwik; class SoftwareSubcategory extends Subcategory { @@ -16,4 +17,8 @@ class SoftwareSubcategory extends Subcategory protected $id = 'DevicesDetection_Software'; protected $order = 20; + public function getHelp() + { + return '<p>' . Piwik::translate('CoreHome_SoftwareSubcategoryHelp') . '</p>'; + } } diff --git a/plugins/CoreHome/Categories/VisitorsCategory.php b/plugins/CoreHome/Categories/VisitorsCategory.php index 3541c7818f..8cbbbb9033 100644 --- a/plugins/CoreHome/Categories/VisitorsCategory.php +++ b/plugins/CoreHome/Categories/VisitorsCategory.php @@ -9,10 +9,22 @@ namespace Piwik\Plugins\CoreHome\Categories; use Piwik\Category\Category; +use Piwik\Piwik; +use Piwik\Url; class VisitorsCategory extends Category { protected $id = 'General_Visitors'; protected $order = 5; protected $icon = 'icon-reporting-visitors'; + + public function getHelp() + { + $visitsLogUrl = '<a href="#" onclick="this.href=broadcast.buildReportingUrl(\'category=General_Visitors&subcategory=Live_VisitorLog\')">'; + + $helpText = '<p>' . Piwik::translate('CoreHome_VisitorsCategoryHelp1') . '</p>'; + $helpText .= '<p>' . Piwik::translate('CoreHome_VisitorsCategoryHelp2', [$visitsLogUrl, '</a>']) . '</p>'; + + return $helpText; + } } diff --git a/plugins/CoreHome/Categories/VisitorsOverviewSubcategory.php b/plugins/CoreHome/Categories/VisitorsOverviewSubcategory.php index abb84ff0ab..4e3747f048 100644 --- a/plugins/CoreHome/Categories/VisitorsOverviewSubcategory.php +++ b/plugins/CoreHome/Categories/VisitorsOverviewSubcategory.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\CoreHome\Categories; use Piwik\Category\Subcategory; +use Piwik\Piwik; class VisitorsOverviewSubcategory extends Subcategory { @@ -16,4 +17,8 @@ class VisitorsOverviewSubcategory extends Subcategory protected $id = 'General_Overview'; protected $order = 2; + public function getHelp() + { + return '<p>' . Piwik::translate('CoreHome_VisitorsOverviewHelp') . '</p>'; + } } |