diff options
author | sgiehl <stefan@piwik.org> | 2015-07-25 15:25:45 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-07-25 15:25:45 +0300 |
commit | b6ea05940f5815f96fa455695d56e2aeb62024b9 (patch) | |
tree | 14f1d47bb2195479b2ed110c99d325b04b7314f8 /plugins/Overlay | |
parent | 34b0ed21e10a9afb827f73a7eb601941827c327a (diff) |
fixes #8352 - added link to open segmented visitor log in page overlay sidebar
Diffstat (limited to 'plugins/Overlay')
-rw-r--r-- | plugins/Overlay/Controller.php | 4 | ||||
-rw-r--r-- | plugins/Overlay/javascripts/Piwik_Overlay.js | 16 | ||||
-rw-r--r-- | plugins/Overlay/stylesheets/overlay.css | 6 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.twig | 1 | ||||
-rw-r--r-- | plugins/Overlay/templates/renderSidebar.twig | 1 |
5 files changed, 26 insertions, 2 deletions
diff --git a/plugins/Overlay/Controller.php b/plugins/Overlay/Controller.php index a649cd4a03..795d7b991d 100644 --- a/plugins/Overlay/Controller.php +++ b/plugins/Overlay/Controller.php @@ -53,6 +53,7 @@ class Controller extends \Piwik\Plugin\Controller $date = Common::getRequestVar('date'); $currentUrl = Common::getRequestVar('currentUrl'); $currentUrl = Common::unsanitizeInputValue($currentUrl); + $segment = ''; $normalizedCurrentUrl = PageUrl::excludeQueryParametersFromUrl($currentUrl, $idSite); $normalizedCurrentUrl = Common::unsanitizeInputValue($normalizedCurrentUrl); @@ -83,6 +84,8 @@ class Controller extends \Piwik\Plugin\Controller $showMetrics = array('nb_hits', 'nb_visits', 'nb_users', 'nb_uniq_visitors', 'bounce_rate', 'exit_rate', 'avg_time_on_page'); + $segment = $row->getMetadata('segment'); + foreach ($showMetrics as $metric) { $value = $row->getColumn($metric); if ($value === false) { @@ -124,6 +127,7 @@ class Controller extends \Piwik\Plugin\Controller $view->idSite = $idSite; $view->period = $period; $view->date = $date; + $view->segment = $segment; $this->outputCORSHeaders(); return $view->render(); diff --git a/plugins/Overlay/javascripts/Piwik_Overlay.js b/plugins/Overlay/javascripts/Piwik_Overlay.js index 32818ac33d..b7f38a89b4 100644 --- a/plugins/Overlay/javascripts/Piwik_Overlay.js +++ b/plugins/Overlay/javascripts/Piwik_Overlay.js @@ -8,7 +8,7 @@ var Piwik_Overlay = (function () { var $body, $iframe, $sidebar, $main, $location, $loading, $errorNotLoading; - var $rowEvolutionLink, $transitionsLink, $fullScreenLink; + var $rowEvolutionLink, $transitionsLink, $fullScreenLink, $visitorLogLink; var idSite, period, date; @@ -68,8 +68,12 @@ var Piwik_Overlay = (function () { if ($sidebar.find('.overlayNoData').size() == 0) { $rowEvolutionLink.show(); - $transitionsLink.show() + $transitionsLink.show(); + if ($('#segment').val()) { + $visitorLogLink.show(); + } } + } ); ajaxRequest.setErrorCallback(function () { @@ -96,6 +100,7 @@ var Piwik_Overlay = (function () { $fullScreenLink.hide(); $rowEvolutionLink.hide(); $transitionsLink.hide(); + $visitorLogLink.hide(); $errorNotLoading.hide(); } @@ -145,6 +150,7 @@ var Piwik_Overlay = (function () { $rowEvolutionLink = $('#overlayRowEvolution'); $transitionsLink = $('#overlayTransitions'); $fullScreenLink = $('#overlayFullScreen'); + $visitorLogLink = $('#overlaySegmentedVisitorLog'); adjustDimensions(); @@ -213,6 +219,12 @@ var Piwik_Overlay = (function () { return false; }); + // handle segmented visitor log link + $visitorLogLink.click(function () { + DataTable_RowActions_Registry.getActionByName('SegmentVisitorLog').createInstance({}).showVisitorLog('Actions.getPageUrls', $('#segment').val(), {}); + return false; + }); + // handle full screen link $fullScreenLink.click(function () { var href = iframeSrcBase; diff --git a/plugins/Overlay/stylesheets/overlay.css b/plugins/Overlay/stylesheets/overlay.css index ea11085f02..e0357bfcdd 100644 --- a/plugins/Overlay/stylesheets/overlay.css +++ b/plugins/Overlay/stylesheets/overlay.css @@ -64,6 +64,7 @@ a#overlayTitle { color: #255792; } +a#overlaySegmentedVisitorLog, a#overlayFullScreen, a#overlayRowEvolution, a#overlayTransitions { @@ -85,11 +86,16 @@ a#overlayTransitions { background: url(../../Transitions/images/transitions_icon_hover.png) no-repeat 0 6px; } +a#overlaySegmentedVisitorLog { + background: url(../../Live/images/visitorlog-hover.png) no-repeat 0 8px; +} + a#overlayFullScreen { margin-top: 20px; background: url(../../Morpheus/images/fullscreen.png) no-repeat 3px 8px; } +a#overlaySegmentedVisitorLog:hover, a#overlayFullScreen:hover, a#overlayRowEvolution:hover, a#overlayTransitions:hover { diff --git a/plugins/Overlay/templates/index.twig b/plugins/Overlay/templates/index.twig index 9f2cdb8ac0..a5d21d3655 100644 --- a/plugins/Overlay/templates/index.twig +++ b/plugins/Overlay/templates/index.twig @@ -51,6 +51,7 @@ <a id="overlayRowEvolution">{{ 'General_RowEvolutionRowActionTooltipTitle'|translate }}</a> <a id="overlayTransitions">{{ 'General_TransitionsRowActionTooltipTitle'|translate }}</a> + <a id="overlaySegmentedVisitorLog">{{ 'Live_RowActionTooltipTitle'|translate }}</a> </div> <div id="overlayMain"> diff --git a/plugins/Overlay/templates/renderSidebar.twig b/plugins/Overlay/templates/renderSidebar.twig index 078880becc..09d8cf0d40 100644 --- a/plugins/Overlay/templates/renderSidebar.twig +++ b/plugins/Overlay/templates/renderSidebar.twig @@ -17,6 +17,7 @@ </li> {% endfor %} </ul> + <input type="hidden" value="{{ segment }}" id="segment" /> {% else %} <!-- note: the class overlayNoData is used in Piwik_Overlay.js --> <div class="overlayNoData">{{ 'Overlay_NoData'|translate }}</div> |