Skip to content
Extraits de code Groupes Projets
Valider b6f1a8b0 rédigé par BeezyT's avatar BeezyT
Parcourir les fichiers

refs #2465

 * renaming menu item to "Page Overlay", putting it under Actions
 * config option to disable framed mode altogether (can be used when websites contain frame busters)
 * fixed error for anonymous user
 * loading message in framed mode

git-svn-id: http://dev.piwik.org/svn/trunk@7419 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 10755cfc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -315,6 +315,10 @@ graphs_default_period_to_plot_when_period_range = day ...@@ -315,6 +315,10 @@ graphs_default_period_to_plot_when_period_range = day
; a view of the current page. The value X can be set here. ; a view of the current page. The value X can be set here.
insight_limit = 300 insight_limit = 300
; With this option, you can disable the framed mode of the Insight plugin. If set to 1, the Insight session
; will be started in a new tab instead of the iframe.
insight_disable_framed_mode = 0
[Tracker] [Tracker]
; Piwik uses first party cookies by default. If set to 1, ; Piwik uses first party cookies by default. If set to 1,
; the visit ID cookie will be set on the Piwik server domain as well ; the visit ID cookie will be set on the Piwik server domain as well
......
...@@ -1804,7 +1804,7 @@ And thank you for using Piwik!', ...@@ -1804,7 +1804,7 @@ And thank you for using Piwik!',
'Transitions_NoDataForAction' => 'There\'s no data for %s', 'Transitions_NoDataForAction' => 'There\'s no data for %s',
'Transitions_NoDataForActionDetails' => 'Either the action had no pageviews during the period %s or it is invalid.', 'Transitions_NoDataForActionDetails' => 'Either the action had no pageviews during the period %s or it is invalid.',
'Transitions_ErrorBack' => 'Go back to the previous action', 'Transitions_ErrorBack' => 'Go back to the previous action',
'Insight_Insight' => 'Insight', 'Insight_Insight' => 'Page Overlay',
'Insight_Page' => 'Page', 'Insight_Page' => 'Page',
'Insight_MainMetrics' => 'Main metrics', 'Insight_MainMetrics' => 'Main metrics',
'Insight_NoData' => 'There is no data for this page during the selected period.', 'Insight_NoData' => 'There is no data for this page during the selected period.',
...@@ -1815,5 +1815,7 @@ And thank you for using Piwik!', ...@@ -1815,5 +1815,7 @@ And thank you for using Piwik!',
'Insight_ClicksFromXLinks' => '%1$s clicks from one of %2$s links', 'Insight_ClicksFromXLinks' => '%1$s clicks from one of %2$s links',
'Insight_Link' => 'Link', 'Insight_Link' => 'Link',
'Insight_OpenNewTab' => 'Open in new tab', 'Insight_OpenNewTab' => 'Open in new tab',
'Insight_RedirectUrlError' => 'You are attempting to open Insight for the URL "%s". %s None of the URLs from the Piwik settings matches the link. Please add the domain there.' 'Insight_RedirectUrlError' => 'You are attempting to open Insight for the URL "%s". %s None of the URLs from the Piwik settings matches the link. Please add the domain there.',
'Insight_Domain' => 'Domain',
'Insight_NoFrameModeText' => 'The page overlay session will be launched in a new tab. %s If opening the tab doesn\'t work automatically, please %sclick here%s.'
); );
...@@ -56,7 +56,13 @@ class Piwik_Insight_API ...@@ -56,7 +56,13 @@ class Piwik_Insight_API
$sitesManager = Piwik_SitesManager_API::getInstance(); $sitesManager = Piwik_SitesManager_API::getInstance();
$site = $sitesManager->getSiteFromId($idSite); $site = $sitesManager->getSiteFromId($idSite);
return Piwik_SitesManager::getTrackerExcludedQueryParameters($site); try {
return Piwik_SitesManager::getTrackerExcludedQueryParameters($site);
} catch(Exception $e) {
// an exception is thrown when the user has no admin access.
// in this case, we don't handle excluded parameters.
return array();
}
} }
/** /**
......
...@@ -18,7 +18,12 @@ class Piwik_Insight_Controller extends Piwik_Controller ...@@ -18,7 +18,12 @@ class Piwik_Insight_Controller extends Piwik_Controller
{ {
Piwik::checkUserHasViewAccess($this->idSite); Piwik::checkUserHasViewAccess($this->idSite);
$view = Piwik_View::factory('index'); $template = 'index';
if (Piwik_Config::getInstance()->General['insight_disable_framed_mode']) {
$template = 'index_noframe';
}
$view = Piwik_View::factory($template);
$view->idSite = $this->idSite; $view->idSite = $this->idSite;
$view->date = Piwik_Common::getRequestVar('date', 'today'); $view->date = Piwik_Common::getRequestVar('date', 'today');
$view->period = Piwik_Common::getRequestVar('period', 'day'); $view->period = Piwik_Common::getRequestVar('period', 'day');
......
...@@ -45,7 +45,7 @@ class Piwik_Insight extends Piwik_Plugin ...@@ -45,7 +45,7 @@ class Piwik_Insight extends Piwik_Plugin
public function addMenu() public function addMenu()
{ {
Piwik_AddMenu('General_Visitors', 'Insight_Insight', Piwik_AddMenu('Actions_Actions', 'Insight_Insight',
array('module' => 'Insight', 'action' => 'index'), array('module' => 'Insight', 'action' => 'index'),
$display = true, $order = 60); $display = true, $order = 60);
} }
......
...@@ -34,6 +34,17 @@ ...@@ -34,6 +34,17 @@
padding: 0; padding: 0;
} }
#Insight_Loading {
background: url(../../../themes/default/images/loading-blue.gif) no-repeat center 10px;
float: left;
width: 190px;
position: relative;
clear: left;
padding-top: 35px;
text-align: center;
display: none;
}
#Insight_Sidebar { #Insight_Sidebar {
float: left; float: left;
width: 200px; width: 200px;
...@@ -126,4 +137,8 @@ h2.Insight_MainMetrics { ...@@ -126,4 +137,8 @@ h2.Insight_MainMetrics {
body .piwik-tooltip.Insight_Tooltip { body .piwik-tooltip.Insight_Tooltip {
font-size: 11px; font-size: 11px;
padding: 3px 5px 3px 6px; padding: 3px 5px 3px 6px;
}
#Insight_NoFrame {
padding: 20px 0 40px 2px
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<div id="Insight_Sidebar"></div> <div id="Insight_Sidebar"></div>
<div id="Insight_Loading">{'General_Loading_js'|translate|escape:'html'}</div>
<div id="Insight_Main"> <div id="Insight_Main">
<iframe <iframe
id="Insight_Iframe" id="Insight_Iframe"
...@@ -17,4 +19,8 @@ ...@@ -17,4 +19,8 @@
<script type="text/javascript"> <script type="text/javascript">
Piwik_Insight.init(); Piwik_Insight.init();
Piwik_Insight_Translations = {literal}{{/literal}
domain: "{'Insight_Domain'|translate|escape:'html'}"
{literal}}{/literal};
</script> </script>
\ No newline at end of file
<div id="Insight_NoFrame">
{capture name="link"}index.php?module=Insight&action=startInsightSession&idsite={$idSite}&period={$period}&date={$date}{/capture}
{capture name="linkTag"}<a id="Insight_Link" href="{$smarty.capture.link}" target="_blank">{/capture}
{'Insight_NoFrameModeText'|translate|escape:'html'|sprintf:'<br />':$smarty.capture.linkTag:'</a>'}
<script type="text/javascript">
window.open('{$smarty.capture.link}', '_newtab');
</script>
</div>
\ No newline at end of file
var Piwik_Insight = (function() { var Piwik_Insight = (function() {
var $container, $iframe, $sidebar, $main, $location; var $container, $iframe, $sidebar, $main, $location, $loading;
var isFullScreen = false; var isFullScreen = false;
...@@ -10,8 +10,7 @@ var Piwik_Insight = (function() { ...@@ -10,8 +10,7 @@ var Piwik_Insight = (function() {
function loadSidebar(currentUrl) { function loadSidebar(currentUrl) {
$sidebar.hide(); $sidebar.hide();
$location.html('&nbsp;'); $location.html('&nbsp;');
$loading.show();
// TODO show loading message
iframeDomain = currentUrl.match(/http(s)?:\/\/(www\.)?([^\/]*)/i)[3]; iframeDomain = currentUrl.match(/http(s)?:\/\/(www\.)?([^\/]*)/i)[3];
...@@ -27,16 +26,17 @@ var Piwik_Insight = (function() { ...@@ -27,16 +26,17 @@ var Piwik_Insight = (function() {
$responseLocation.remove(); $responseLocation.remove();
$location.find('span').hover(function() { $location.find('span').hover(function() {
// TODO translate
if (iframeDomain) { if (iframeDomain) {
// use addBreakpointsToUrl because it also encoded html entities // use addBreakpointsToUrl because it also encoded html entities
Piwik_Tooltip.show('<b>Domain:</b> ' + piwikHelper.addBreakpointsToUrl(iframeDomain), 'Insight_Tooltip'); Piwik_Tooltip.show('<b>' + Piwik_Insight_Translations.domain + ':</b> ' +
piwikHelper.addBreakpointsToUrl(iframeDomain), 'Insight_Tooltip');
} }
}, function() { }, function() {
Piwik_Tooltip.hide(); Piwik_Tooltip.hide();
}); });
$sidebar.empty().append($response).show(); $sidebar.empty().append($response).show();
$loading.hide();
var $fullScreen = $sidebar.find('a.Insight_FullScreen'); var $fullScreen = $sidebar.find('a.Insight_FullScreen');
$fullScreen.click(function() { $fullScreen.click(function() {
...@@ -84,6 +84,7 @@ var Piwik_Insight = (function() { ...@@ -84,6 +84,7 @@ var Piwik_Insight = (function() {
$sidebar = $('#Insight_Sidebar'); $sidebar = $('#Insight_Sidebar');
$location = $('#Insight_Location'); $location = $('#Insight_Location');
$main = $('#Insight_Main'); $main = $('#Insight_Main');
$loading = $('#Insight_Loading');
adjustHeight(); adjustHeight();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter