diff options
author | Stefan Giehl <stefan@matomo.org> | 2019-04-07 22:58:32 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-04-07 22:58:32 +0300 |
commit | 51ac534345e965adec4a7e5cbcf30901d8631486 (patch) | |
tree | 5c46a65df8092ea69e18e83b49402619c0ea03ee /plugins/Live | |
parent | 64a257fa4ae9f70b87d15f93b7a262121de0c1f2 (diff) |
Hide mainurl visitor log action list (#13933)
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/VisitorDetails.php | 4 | ||||
-rw-r--r-- | plugins/Live/templates/_actionCommon.twig | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Live/VisitorDetails.php b/plugins/Live/VisitorDetails.php index bd60d886a0..42a79d7d49 100644 --- a/plugins/Live/VisitorDetails.php +++ b/plugins/Live/VisitorDetails.php @@ -89,7 +89,11 @@ class VisitorDetails extends VisitorDetailsAbstract return; } + $sitesModel = new \Piwik\Plugins\SitesManager\Model(); + $view = new View($template); + $view->mainUrl = trim(Site::getMainUrlFor($this->getIdSite())); + $view->additionalUrls = $sitesModel->getAliasSiteUrlsFromId($this->getIdSite()); $view->action = $action; $view->previousAction = $previousAction; $view->visitInfo = $visitorDetails; diff --git a/plugins/Live/templates/_actionCommon.twig b/plugins/Live/templates/_actionCommon.twig index a697485a0e..ac47820fc6 100644 --- a/plugins/Live/templates/_actionCommon.twig +++ b/plugins/Live/templates/_actionCommon.twig @@ -24,7 +24,12 @@ {% else %} <a href="{{ action.url|safelink|e('html_attr') }}" rel="noreferrer noopener" target="_blank" class="action-list-url truncated-text-line"> - {{ action.url|replace({'http://': '', 'https://': ''}) }} + {% if not additionalUrls|length %} + {# remove main url from urls if site has no additional urls defined #} + {{ action.url|replace({(mainUrl~'/'): '/', 'http://': '', 'https://': ''}) }} + {% else %} + {{ action.url|replace({'http://': '', 'https://': ''}) }} + {% endif %} </a> {% endif %} {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}</p>{% endif %} |