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:
-rw-r--r--core/DataTable/Filter/ColumnCallbackReplace.php11
-rw-r--r--core/DataTable/Filter/ReplaceSummaryRowLabel.php5
-rw-r--r--core/ViewDataTable.php14
-rw-r--r--core/ViewDataTable/HtmlTable/AllColumns.php5
-rw-r--r--lang/en.php4
-rw-r--r--libs/jquery/tooltip/___jquery.tooltip.js (renamed from libs/jquery/tooltip/_jquery.tooltip.js)5
-rw-r--r--libs/jquery/truncate/jquery.truncate.js43
-rw-r--r--misc/TODO39
-rw-r--r--plugins/Actions/API.php1
-rw-r--r--plugins/Actions/Controller.php16
-rw-r--r--plugins/CoreHome/templates/datatable.css29
-rw-r--r--plugins/CoreHome/templates/datatable.js147
-rw-r--r--plugins/CoreHome/templates/datatable.tpl4
-rw-r--r--plugins/CoreHome/templates/datatable_actions.tpl4
-rw-r--r--plugins/CoreHome/templates/datatable_actions_recursive.tpl8
-rw-r--r--plugins/CoreHome/templates/datatable_footer.tpl8
-rw-r--r--plugins/Referers/API.php2
-rw-r--r--plugins/Referers/Controller.php2
-rw-r--r--plugins/Referers/functions.php12
-rw-r--r--plugins/VisitTime/Controller.php4
20 files changed, 193 insertions, 170 deletions
diff --git a/core/DataTable/Filter/ColumnCallbackReplace.php b/core/DataTable/Filter/ColumnCallbackReplace.php
index 63d3671f24..ec296cb50e 100644
--- a/core/DataTable/Filter/ColumnCallbackReplace.php
+++ b/core/DataTable/Filter/ColumnCallbackReplace.php
@@ -21,10 +21,11 @@ class Piwik_DataTable_Filter_ColumnCallbackReplace extends Piwik_DataTable_Filte
private $columnToFilter;
private $functionToApply;
- public function __construct( $table, $columnToFilter, $functionToApply )
+ public function __construct( $table, $columnToFilter, $functionToApply, $functionParameters = null )
{
parent::__construct($table);
$this->functionToApply = $functionToApply;
+ $this->functionParameters = $functionParameters;
$this->columnToFilter = $columnToFilter;
$this->filter();
}
@@ -33,8 +34,12 @@ class Piwik_DataTable_Filter_ColumnCallbackReplace extends Piwik_DataTable_Filte
{
foreach($this->table->getRows() as $key => $row)
{
- $oldValue = $row->getColumn($this->columnToFilter);
- $newValue = call_user_func( $this->functionToApply, $oldValue);
+ $parameters = array($row->getColumn($this->columnToFilter));
+ if(!is_null($this->functionParameters))
+ {
+ $parameters = array_merge($parameters, $this->functionParameters);
+ }
+ $newValue = call_user_func_array( $this->functionToApply, $parameters);
$row->setColumn($this->columnToFilter, $newValue);
}
}
diff --git a/core/DataTable/Filter/ReplaceSummaryRowLabel.php b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
index ed3b627ddc..1edc20f2b9 100644
--- a/core/DataTable/Filter/ReplaceSummaryRowLabel.php
+++ b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
@@ -29,9 +29,10 @@ class Piwik_DataTable_Filter_ReplaceSummaryRowLabel extends Piwik_DataTable_Filt
protected function filter()
{
- foreach($this->table->getRows() as $row)
+ $rows = $this->table->getRows();
+ foreach($rows as $row)
{
- if($row->getColumn('label') === Piwik_DataTable::LABEL_SUMMARY_ROW)
+ if($row->getColumn('label') == Piwik_DataTable::LABEL_SUMMARY_ROW)
{
$row->setColumn('label', $this->newLabel);
break;
diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php
index e25b227ef1..224e627e60 100644
--- a/core/ViewDataTable.php
+++ b/core/ViewDataTable.php
@@ -487,9 +487,6 @@ abstract class Piwik_ViewDataTable
$javascriptVariablesToSet['actionToLoadTheSubTable'] = $this->actionToLoadTheSubTable;
}
-// var_dump($this->variablesDefault);
-// var_dump($javascriptVariablesToSet); exit;
-
if($this->dataTable)
{
$javascriptVariablesToSet['totalRows'] = $this->dataTable->getRowsCountBeforeLimitFilter();
@@ -641,15 +638,8 @@ abstract class Piwik_ViewDataTable
$columnName = Piwik_Archive::INDEX_NB_VISITS;
}
- // column to use to enable low population exclusion if != false
- $this->variablesDefault['filter_excludelowpop_default']
- = $this->variablesDefault['filter_excludelowpop']
- = $columnName;
-
- // the minimum value a row must have to be returned
- $this->variablesDefault['filter_excludelowpop_value_default']
- = $this->variablesDefault['filter_excludelowpop_value']
- = $minValue;
+ $this->variablesDefault['filter_excludelowpop'] = $columnName;
+ $this->variablesDefault['filter_excludelowpop_value'] = $minValue;
}
/**
diff --git a/core/ViewDataTable/HtmlTable/AllColumns.php b/core/ViewDataTable/HtmlTable/AllColumns.php
index 539b456362..9ea33f5a85 100644
--- a/core/ViewDataTable/HtmlTable/AllColumns.php
+++ b/core/ViewDataTable/HtmlTable/AllColumns.php
@@ -20,6 +20,11 @@ class Piwik_ViewDataTable_HtmlTable_AllColumns extends Piwik_ViewDataTable_HtmlT
protected function handleLowPopulation()
{
+ if(Piwik_Common::getRequestVar('filter_excludelowpop', '0', 'string' ) == '0')
+ {
+ return;
+ }
+
require_once "VisitsSummary/Controller.php";
$visits = Piwik_VisitsSummary_Controller::getVisits();
$visitsThreshold = floor( self::LOW_POPULATION_THRESHOLD_PERCENTAGE_VISIT * $visits);
diff --git a/lang/en.php b/lang/en.php
index 77e6ae05e9..4f8f10b89c 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -44,10 +44,14 @@ $translations = array(
'General_ColumnActionsPerVisit' => 'Actions per Visit',
'General_ColumnAvgTimeOnSite' => 'Avg. Time on Site',
'General_ColumnBounceRate' => 'Bounce Rate',
+ 'General_ColumnPageviews' => 'Pageviews',
+ 'General_ColumnUniquePageviews' => 'Unique Pageviews',
'General_Save' => 'Save',
'General_Website' => 'Website',
'General_NoDataForGraph' => 'No data for this graph',
'General_NoDataForTagCloud' => 'No data for this tag cloud.',
+ 'General_DisplayNormalTable' => 'Display normal table',
+ 'General_DisplayMoreData' => 'Display more data',
'General_PiwikIsACollaborativeProject' => "%s Piwik %s is a collaborative project and still Beta. %s If you want to help, please %s contact us!%s.",
'General_YouAreCurrentlyViewingDemoOfPiwik' => "You are currently viewing the demo of %s; %sdownload%s the full version! Check out %s",
'CorePluginsAdmin_Plugins' => 'Plugins',
diff --git a/libs/jquery/tooltip/_jquery.tooltip.js b/libs/jquery/tooltip/___jquery.tooltip.js
index cf3c6e9b28..ac75e68407 100644
--- a/libs/jquery/tooltip/_jquery.tooltip.js
+++ b/libs/jquery/tooltip/___jquery.tooltip.js
@@ -210,7 +210,7 @@
tID = setTimeout(show, this.tSettings.delay);
else
show();
-
+
// if selected, update the helper position when the mouse moves
track = !!this.tSettings.track;
$('body').bind('mousemove', update);
@@ -277,8 +277,7 @@
*/
function update(event) {
if($.Tooltip.blocked)
- return;
-
+ return true;
// stop updating when tracking is disabled and the tooltip is visible
if ( !track && helper.parent.is(":visible")) {
$('body').unbind('mousemove', update)
diff --git a/libs/jquery/truncate/jquery.truncate.js b/libs/jquery/truncate/jquery.truncate.js
index 0c4a9f326a..634513ab5c 100644
--- a/libs/jquery/truncate/jquery.truncate.js
+++ b/libs/jquery/truncate/jquery.truncate.js
@@ -1,29 +1,26 @@
-
jQuery.fn.truncate = function(max) {
return this.each(
function() {
var trail='...';
- if(jQuery(this).children().length==0) {
- v=jQuery.trim(jQuery(this).text());
- while(max<v.length) {
- c=v.charAt(max);
- newStringTruncated=v.substring(0,max)+trail;
- charToRemove='"';
- regExp=new RegExp("["+charToRemove+"]","g");
- vCleaned = v
- .replace(regExp,"&amp;quot;")
- .replace(/</g, '&amp;lt;')
- .replace(/>/g, '&amp;gt;');
- newStringTruncated = newStringTruncated
- .replace(regExp,"'")
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
- html='<span class="truncated" title="'+vCleaned+'">'+newStringTruncated+'</span>';
- jQuery(this).html(html);
- break;
- max--;
- }
- }
+ v=jQuery.trim(jQuery(this).text());
+ while(max<v.length) {
+ c=v.charAt(max);
+ newStringTruncated=v.substring(0,max)+trail;
+ charToRemove='"';
+ regExp=new RegExp("["+charToRemove+"]","g");
+ vCleaned = v
+ .replace(regExp,"&amp;quot;")
+ .replace(/</g, '&amp;lt;')
+ .replace(/>/g, '&amp;gt;');
+ newStringTruncated = newStringTruncated
+ .replace(regExp,"'")
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;');
+ html='<span class="truncated" title="'+vCleaned+'">'+newStringTruncated+'</span>';
+ jQuery(this).html(html);
+ break;
+ max--;
+ }
}
);
-}; \ No newline at end of file
+};
diff --git a/misc/TODO b/misc/TODO
index 10303e1736..52cf071620 100644
--- a/misc/TODO
+++ b/misc/TODO
@@ -1,7 +1,29 @@
+Following up show all columns new UI element
+====
+- ADD forward of non true show_values to forward when specified from URL to ajax
+- disable show icon in some iframes and/or dashboard
+- do proper CSS factoring
+- clarify 'false' '0' values etc. //convert all JS datatable footer parameter values to '1' or '0'
+- check state of javascript footer (should not have safe_decode and filter_add_columns blah)
+- set custom truncation limit per datatable type (simple VS allColumns, and subtable) ->bug display subtable icon is cut (see truncation limit)
+- Blog post!
+
+Test page
+==========
+- prepare a page with all use cases in iframes?
+- test the actions datatable in this page?
+- test datatable with search disabled
+- test datatable with low population disabled
+- without footer
+- without all columns icon
+
UI fixes + adjustements
====
+- orange box top right
+- keep referers logs lines used for XSXS referer injection attack
- write test to make sure deployement don't include logger in file/db/etc
- write test to check disabled db plugin default
+- show total size in MB in db plugin
- search inside datatable doesnt really work eg. "web analytics" restore regex search
- bounce count should be bounce rate
- idem in 222 times that a returning visit has bounced (left the site after one page)
@@ -10,20 +32,8 @@ UI fixes + adjustements
- WRONG::: 147 sites Internet différents (utilisant 147 différentes adresses)
- see also #421
-Following up show all columns new UI element
-====
-- ADD forward of non true show_values to forward when specified from URL to ajax
-- disable show icon in some iframes and/or dashboard
-- when default is not table, the table icon is not shown below tables (eg. plugins)
-- when default is pie chart (visitors > settings), then shows advanced table icon
-- labels for datatable actions are ugly
-- i18n on title on datatable footer
-- do proper CSS factoring
-- rename exportDataTable div in footerDataTableIcons or similar
-- clarify 'false' '0' values etc. //convert all JS datatable footer parameter values to '1' or '0'
-- check state of javascript footer (should not have safe_decode and filter_add_columns blah)
-- set custom truncation limit per datatable type (simple VS allColumns, and subtable) ->bug display subtable icon is cut (see truncation limit)
-- Blog post!
+check phpmyvisites piwik analytics sur delicious
+check analytics books
high priority features
====
@@ -45,7 +55,6 @@ UI elements:
website
====
-- after download redirect to install guide
- 404 more useful
- provide changelog + rss feed for new versions
- www.piwik.org/demo/ is 404
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php
index 42996b7a53..f26cd2fd42 100644
--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -51,6 +51,7 @@ class Piwik_Actions_API extends Piwik_Apiable
$dataTable = $archive->getDataTable($name, $idSubtable);
}
$dataTable->queueFilter('Piwik_DataTable_Filter_ReplaceSummaryRowLabel');
+ $dataTable->queueFilter('Piwik_DataTable_Filter_ReplaceColumnNames');
return $dataTable;
}
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index 07eca64d88..4957756f3c 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -1,9 +1,8 @@
<?php
-
require_once "ViewDataTable.php";
+
class Piwik_Actions_Controller extends Piwik_Controller
{
-
function getDownloads($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -21,6 +20,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
+
function getDownloadsSubDataTable($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -39,7 +39,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
-
function getActions($fetch = false)
{
$view = $this->getActionsView( $this->pluginName,
@@ -49,6 +48,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
+
function getActionsSubDataTable($fetch = false)
{
$view = $this->getActionsView( $this->pluginName,
@@ -59,7 +59,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
-
function getOutlinks($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -77,6 +76,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
+
function getOutlinksSubDataTable($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -95,7 +95,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
return $this->renderView($view, $fetch);
}
-
function index()
{
$view = new Piwik_View('Actions/index.tpl');
@@ -118,6 +117,8 @@ class Piwik_Actions_Controller extends Piwik_Controller
$currentMethod,
$methodToCall,
$subMethod );
+ $view->setColumnTranslation('nb_hits', Piwik_Translate('General_ColumnPageviews'));
+ $view->setColumnTranslation('nb_uniq_visitors', Piwik_Translate('General_ColumnUniquePageviews'));
$view->setTemplate('CoreHome/templates/datatable_actions.tpl');
if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
@@ -156,10 +157,8 @@ class Piwik_Actions_Controller extends Piwik_Controller
if($currentlySearching)
{
$phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->getDataTable());
-// var_dump($phpArrayRecursive);exit;
$view->getView()->arrayDataTable = $phpArrayRecursive;
}
-// var_dump( $view->view->arrayDataTable);exit;
return $view;
}
@@ -194,7 +193,4 @@ class Piwik_Actions_Controller extends Piwik_Controller
}
return $table;
}
-
-
-
}
diff --git a/plugins/CoreHome/templates/datatable.css b/plugins/CoreHome/templates/datatable.css
index fc9bba5bee..ba79738bc8 100644
--- a/plugins/CoreHome/templates/datatable.css
+++ b/plugins/CoreHome/templates/datatable.css
@@ -20,6 +20,13 @@
width: 535px;
}
+.subdataTableWrapper{
+ width: 95%;
+}
+.subdataTableAllColumnsWrapper {
+ width: 95%;
+}
+
.dataTableActionsWrapper {
width: 500px;
}
@@ -71,7 +78,7 @@ table.dataTable th {
border-top: 1px solid #C1DAD7;
text-align: left;
padding: 6px 6px 6px 12px;
- background: #D4E3ED url(images/bg_header.jpg) no-repeat;
+ background: #D4E3ED url(images/bg_header.jpg) repeat-x;
}
table.dataTable th.columnSorted {
@@ -136,7 +143,6 @@ table.dataTable td #urlLink {
/* SUBDATATABLE */ /* a datatable inside another datatable */
table.subDataTable {
background: #FFFFFF;
- width: 95%;
margin: 10px;
}
@@ -168,7 +174,6 @@ table.subDataTable td {
}
table.subDataTable td,table.subDataTable td a {
- padding: 0.3em 1em;
color: #615B53;
}
@@ -183,6 +188,9 @@ table.subDataTable td.label {
table.subDataTable td.labelodd,table.subDataTable td.labelodd a {
background: #ffffff;
}
+table.subDataTable td.label {
+ padding: 1px;
+}
/* misc SPAN and DIV */
table thead div {
@@ -259,11 +267,11 @@ table thead div {
display: none;
}
-.subDataTable #exportDataTable {
+.subDataTable #dataTableFooterIcons {
height: 0px;
}
-#exportDataTable {
+#dataTableFooterIcons {
float: right;
height: 18px;
}
@@ -272,11 +280,11 @@ table thead div {
float: right;
}
-#exportDataTableShow {
+#dataTableFooterIconsShow {
float: right;
}
-#exportDataTable,#exportDataTable a {
+#dataTableFooterIcons,#dataTableFooterIcons a {
text-decoration: none;
color: #8894B1;
font-size:0.9em;
@@ -293,15 +301,18 @@ table thead div {
padding: 0.5em;
}
+#tooltip h3 {
+ margin:0;
+ padding:0;
+}
#tooltip {
position: absolute;
z-index: 3000;
border: 1px solid #111;
background-color: #eee;
- padding-left: 5px;
- padding-right: 5px;
opacity: 0.85;
font-size: 0.7em;
+ padding:7px;
}
/* Actions table */
diff --git a/plugins/CoreHome/templates/datatable.js b/plugins/CoreHome/templates/datatable.js
index 29e2f87ce3..4187feef72 100644
--- a/plugins/CoreHome/templates/datatable.js
+++ b/plugins/CoreHome/templates/datatable.js
@@ -255,13 +255,19 @@ dataTable.prototype =
.each(
function()
{
+ if(typeof self.param.filter_excludelowpop == 'undefined')
+ {
+ self.param.filter_excludelowpop = 0;
+ }
if(Number(self.param.filter_excludelowpop) != 0)
{
string = _pk_translate('CoreHome_IncludeAllPopulation');
+ self.param.filter_excludelowpop = 1;
}
else
{
string = _pk_translate('CoreHome_ExcludeLowPopulation');
+ self.param.filter_excludelowpop = 0;
}
$(this).html(string);
}
@@ -270,18 +276,8 @@ dataTable.prototype =
.click(
function()
{
- if(Number(self.param.filter_excludelowpop) != 0)
- {
- self.param.filter_excludelowpop = 0;
- self.param.filter_excludelowpop_value = 0;
- }
- else
- {
- self.param.filter_excludelowpop = self.param.filter_excludelowpop_default;
- self.param.filter_excludelowpop_value = self.param.filter_excludelowpop_value_default;
- }
+ self.param.filter_excludelowpop = 1 - self.param.filter_excludelowpop;
self.param.filter_offset = 0;
-
self.reloadAjaxDataTable(true, callbackSuccess);
}
);
@@ -443,7 +439,7 @@ dataTable.prototype =
}
// When the (+) image is hovered, the export buttons are displayed
- $('#exportDataTableShow', domElem)
+ $('#dataTableFooterIconsShow', domElem)
.show()
.hover( function() {
$(this).fadeOut('slow');
@@ -454,7 +450,7 @@ dataTable.prototype =
//timeout object used to hide the datatable export buttons
var timeout = null;
- $('#exportDataTable', domElem)
+ $('#dataTableFooterIcons', domElem)
.hover( function() {
//display 'hand' cursor
$(this).css({ cursor: "pointer"});
@@ -474,7 +470,7 @@ dataTable.prototype =
var dom = this;
timeout = setTimeout(function(){
$('#exportToFormat', dom).fadeOut('fast', function(){ //queue the two actions
- $('#exportDataTableShow', dom).show('fast');});
+ $('#dataTableFooterIconsShow', dom).show('fast');});
}, 1000);
}
);
@@ -492,6 +488,9 @@ dataTable.prototype =
.show()
.click(
function(){
+ // we only reset the limit filter, in case switch to table view from cloud view where limit is custom set to 30
+ // this value is stored in config file General->dataTable_default_limit but this is more an edge case so ok to set it to 10
+ delete self.param.filter_limit;
self.param.viewDataTable = self.param.viewDataTable == 'table' ? 'tableAllColumns' : 'table';
self.reloadAjaxDataTable();
}
@@ -521,39 +520,79 @@ dataTable.prototype =
}
);
},
-
- //Apply some miscelleaneous style to the DataTable
- applyCosmetics: function(domElem)
+
+ truncate: function(domElemToTruncate, truncationOffset)
{
var self = this;
- // we truncate the labels columns from the second row
- $("table tr td:first-child", domElem).truncate(30);
- $('.truncated', domElem).Tooltip();
+ if(typeof truncationOffset == 'undefined') {
+ truncationOffset = 0;
+ }
+ var truncationLimit = 30;
+ // in a subtable
+ if(typeof self.param.idSubtable != 'undefined')
+ {
+ truncationLimit = 25;
+ }
+ // when showing all columns
+ if(typeof self.param.idSubtable == 'undefined'
+ && self.param.viewDataTable == 'tableAllColumns')
+ {
+ truncationLimit = 15;
+ }
+ // when showing all columns in a subtable, space is restricted
+ if(self.param.viewDataTable == 'tableAllColumns')
+ {
+ truncationLimit = 10;
+ }
- var imageLinkWidth = 10;
- var imageLinkHeight = 9;
+ truncationLimit += truncationOffset;
+
+ $(domElemToTruncate).truncate(truncationLimit);
+ $('.truncated', domElemToTruncate)
+ .Tooltip();
+ },
+
+ //Apply some miscelleaneous style to the DataTable
+ applyCosmetics: function(domElem)
+ {
+ var self = this;
- // we add a link based on the <span id="urlLink"> present in the column label (the first column)
- // if this span is there, we add the link around the HTML in the TD
- // but we add this link only for the rows that are not clickable already (subDataTable)
- $("tr:not('.subDataTable') td:first-child:has('#urlLink')", domElem).each( function(){
-
- var imgToPrepend = '';
- if( $(this).find('img').length == 0 )
- {
- imgToPrepend = '<img width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="'+piwik.piwik_url+'themes/default/images/link.gif" /> ';
- }
- var urlToLink = $('#urlLink',this).html();
- if( urlToLink.match("javascript:") )
- {
- $(this).html( '<a href="#" onClick="' + urlToLink.replace("javascript:","") + '">' + imgToPrepend + $(this).html() + '</a>');
- }
- else
- {
- $(this).html( '<a target="_blank" href="' + urlToLink + '">' + imgToPrepend + $(this).html() + '</a>');
- }
- });
+ var urlLinkFoundDom = $("tr:not('.subDataTable') td:first-child:has('#urlLink')", domElem);
+ if(urlLinkFoundDom.length == 0)
+ {
+ self.truncate( $("table tr td:first-child", domElem) );
+ }
+ else
+ {
+ var imageLinkWidth = 10;
+ var imageLinkHeight = 9;
+ urlLinkFoundDom.each( function(){
+ // we add a link based on the <span id="urlLink"> present in the column label (the first column)
+ // if this span is there, we add the link around the HTML in the TD
+ // but we add this link only for the rows that are not clickable already (subDataTable)
+ var imgToPrepend = '';
+ if( $(this).find('img').length == 0 )
+ {
+ imgToPrepend = '<img width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="'+piwik.piwik_url+'themes/default/images/link.gif" /> ';
+ }
+ var urlLinkDom = $('#urlLink',this);
+ var urlToLink = $(urlLinkDom).html();
+ $(urlLinkDom).remove();
+
+ var truncationOffsetBecauseImageIsPrepend = -2;
+ self.truncate( $(this), truncationOffsetBecauseImageIsPrepend );
+
+ if( urlToLink.match("javascript:") )
+ {
+ $(this).html( '<a href="#" onClick="' + urlToLink.replace("javascript:","") + '">' + imgToPrepend + $(this).html() + '</a>');
+ }
+ else
+ {
+ $(this).html( '<a target="_blank" href="' + urlToLink + '">' + imgToPrepend + $(this).html() + '</a>');
+ }
+ });
+ }
// Add some styles on the cells even/odd
@@ -565,18 +604,12 @@ dataTable.prototype =
$("tr:even td", domElem).slice(1).addClass('columneven');
// Change cursor on mouse hover if sort is enabled
- if( self.param.enable_sort )
+ if( self.param.enable_sort )
{
- $("th.sortable", domElem).hover(
- function()
- {
- $(this).css({ cursor: "pointer"});
- },
- function()
- {
- $(this).css({ cursor: "auto"});
- }
- );
+ $("th.sortable", domElem)
+ .hover( function() { $(this).css({ cursor: "pointer"}); },
+ function() { $(this).css({ cursor: "auto"});
+ });
}
},
@@ -714,12 +747,8 @@ actionDataTable.prototype =
{
self.onClickActionSubDataTable(this)
})
- .hover(function() {
- $(this).css({ cursor: "pointer"});
- },
- function() {
- $(this).css({ cursor: "auto"});
- }
+ .hover( function() { $(this).css({ cursor: "pointer"}); },
+ function() { $(this).css({ cursor: "auto"}); }
);
}
diff --git a/plugins/CoreHome/templates/datatable.tpl b/plugins/CoreHome/templates/datatable.tpl
index 2dbdc602de..49e233f82e 100644
--- a/plugins/CoreHome/templates/datatable.tpl
+++ b/plugins/CoreHome/templates/datatable.tpl
@@ -1,5 +1,5 @@
<div id="{$id}">
- <div class="{if $javascriptVariablesToSet.viewDataTable=='tableAllColumns'}dataTableAllColumnsWrapper{else}dataTableWrapper{/if}">
+ <div class="{if isset($javascriptVariablesToSet.idSubtable)&& $javascriptVariablesToSet.idSubtable!=0}sub{/if}{if $javascriptVariablesToSet.viewDataTable=='tableAllColumns'}dataTableAllColumnsWrapper{else}dataTableWrapper{/if}">
{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
{$arrayDataTable.message}
{else}
@@ -21,7 +21,7 @@
<tr {if $row.idsubdatatable}class="subDataTable" id="{$row.idsubdatatable}"{/if}>
{foreach from=$dataTableColumns item=column}
<td>
-{if $column.name=='label' && isset($row.metadata.url)}<span id="urlLink">{$row.metadata.url}</span>{/if}
+{if !$row.idsubdatatable && $column.name=='label' && isset($row.metadata.url)}<span id="urlLink">{$row.metadata.url}</span>{/if}
{if $column.name=='label' && isset($row.metadata.logo)}<img {if isset($row.metadata.logoWidth)}width="{$row.metadata.logoWidth}"{/if} {if isset($row.metadata.logoHeight)}height="{$row.metadata.logoHeight}"{/if} src="{$row.metadata.logo}" />{/if}
{* sometimes all columns are not set in the datatable, we assume the value 0 *}
{if isset($row.columns[$column.name])}{$row.columns[$column.name]}{else}0{/if}
diff --git a/plugins/CoreHome/templates/datatable_actions.tpl b/plugins/CoreHome/templates/datatable_actions.tpl
index 33f9592ef1..94341cddff 100644
--- a/plugins/CoreHome/templates/datatable_actions.tpl
+++ b/plugins/CoreHome/templates/datatable_actions.tpl
@@ -10,7 +10,7 @@
<thead>
<tr>
{foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column.name}">{$column.name}</td>
+ <th class="sortable" id="{$column.name}">{$column.displayName}</td>
{/foreach}
</tr>
</thead>
@@ -27,8 +27,6 @@
</tr>
{/foreach}
</tbody>
-
- </tfoot>
</table>
{/if}
diff --git a/plugins/CoreHome/templates/datatable_actions_recursive.tpl b/plugins/CoreHome/templates/datatable_actions_recursive.tpl
index 7d2206bcb5..bcec62eb2c 100644
--- a/plugins/CoreHome/templates/datatable_actions_recursive.tpl
+++ b/plugins/CoreHome/templates/datatable_actions_recursive.tpl
@@ -27,14 +27,6 @@
</tr>
{/foreach}
</tbody>
-
-
- </foot>
- <tr><td colspan="{$dataTableColumns|@count}">
-
- </td>
- </tr>
- </tfoot>
</table>
{/if}
diff --git a/plugins/CoreHome/templates/datatable_footer.tpl b/plugins/CoreHome/templates/datatable_footer.tpl
index 5a68bb1a19..355fbe2a3e 100644
--- a/plugins/CoreHome/templates/datatable_footer.tpl
+++ b/plugins/CoreHome/templates/datatable_footer.tpl
@@ -19,7 +19,7 @@
{if $properties.show_footer_icons}
<div>
- <span id="exportDataTable">
+ <span id="dataTableFooterIcons">
<span id="exportToFormat" style="display:none;padding-left:4px;">
<img width="16" height="16" src="{$piwikUrl}themes/default/images/export.png" title="{'General_Export'|translate}" />
<span id="linksExportToFormat" style="display:none;">
@@ -32,15 +32,15 @@
<a class="viewDataTable" format="graphVerticalBar"><img width="16" height="16" src="{$piwikUrl}themes/default/images/chart_bar.png" title="{'General_VBarGraph'|translate}" /></a>
<a class="viewDataTable" format="graphPie"><img width="16" height="16" src="{$piwikUrl}themes/default/images/chart_pie.png" title="{'General_Piechart'|translate}" /></a>
</span>
- <span id="exportDataTableShow" style="display:none;padding-left:4px;">
+ <span id="dataTableFooterIconsShow" style="display:none;padding-left:4px;">
<img src="{$piwikUrl}plugins/CoreHome/templates/images/more.png" />
</span>
{if $properties.show_table_all_columns}
<span id="tableAllColumnsSwitch" style="display:none;float:right;padding-right:4px;border-right:1px solid #82A1D2;">
{if $javascriptVariablesToSet.viewDataTable != 'table'}
- <img title="Display normal table" src="{$piwikUrl}themes/default/images/table.png" />
+ <img title="{'General_DisplayNormalTable'|translate}" src="{$piwikUrl}themes/default/images/table.png" />
{else}
- <img title="Display more data" src="{$piwikUrl}themes/default/images/table_more.png" />
+ <img title="{'General_DisplayMoreData'|translate}" src="{$piwikUrl}themes/default/images/table_more.png" />
{/if}
</span>
{/if}
diff --git a/plugins/Referers/API.php b/plugins/Referers/API.php
index 4021fb521c..8a5b8b5bca 100644
--- a/plugins/Referers/API.php
+++ b/plugins/Referers/API.php
@@ -102,12 +102,12 @@ class Piwik_Referers_API extends Piwik_Apiable
$dataTable = $this->getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded);
return $dataTable;
}
+
function getUrlsFromWebsiteId($idSite, $period, $date, $idSubtable)
{
$dataTable = $this->getDataTable('Referers_urlByWebsite',$idSite, $period, $date, $expanded = false, $idSubtable);
$dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackAddMetadata', array( 'label', 'url', create_function('$label', 'return $label;')) );
$dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_getPathFromUrl'));
- $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_truncatePath'));
return $dataTable;
}
diff --git a/plugins/Referers/Controller.php b/plugins/Referers/Controller.php
index 1299f50f84..b8df5f1452 100644
--- a/plugins/Referers/Controller.php
+++ b/plugins/Referers/Controller.php
@@ -144,7 +144,6 @@ class Piwik_Referers_Controller extends Piwik_Controller
$view->disableExcludeLowPopulation();
$view->setColumnsToDisplay( array('label','nb_visits') );
$view->setLimit(10);
- $view->setGraphLimit(12);
return $this->renderView($view, $fetch);
}
@@ -188,7 +187,6 @@ class Piwik_Referers_Controller extends Piwik_Controller
$view->disableSearchBox();
$view->disableExcludeLowPopulation();
$view->setColumnsToDisplay( array('label','nb_visits') );
-
return $this->renderView($view, $fetch);
}
diff --git a/plugins/Referers/functions.php b/plugins/Referers/functions.php
index 43a4d3eebc..1d218af35f 100644
--- a/plugins/Referers/functions.php
+++ b/plugins/Referers/functions.php
@@ -9,18 +9,6 @@ function Piwik_getPathFromUrl($url)
return $path;
}
-function Piwik_truncatePath( $path )
-{
- $limit = 27;
- $path = htmlspecialchars_decode($path);
- $len = strlen($path);
- if($len > $limit)
- {
- $path = substr($path, 0, $limit-3) . "...";
- }
- return htmlspecialchars($path);
-}
-
function Piwik_getSearchEngineUrlFromName($name)
{
require_once "DataFiles/SearchEngines.php";
diff --git a/plugins/VisitTime/Controller.php b/plugins/VisitTime/Controller.php
index 5db88b6bdb..d08458a706 100644
--- a/plugins/VisitTime/Controller.php
+++ b/plugins/VisitTime/Controller.php
@@ -17,7 +17,7 @@ class Piwik_VisitTime_Controller extends Piwik_Controller
$view->init( $this->pluginName, __FUNCTION__, "VisitTime.getVisitInformationPerServerTime" );
$view->setColumnsToDisplay( array('label','nb_visits') );
- $view->setSortedColumn( 0, 'asc' );
+ $view->setSortedColumn( 'label', 'asc' );
$view->setLimit( 24 );
$view->setGraphLimit( 24 );
$view->disableSearchBox();
@@ -33,7 +33,7 @@ class Piwik_VisitTime_Controller extends Piwik_Controller
$view->init( $this->pluginName, __FUNCTION__, "VisitTime.getVisitInformationPerLocalTime" );
$view->setColumnsToDisplay( array('label','nb_visits') );
- $view->setSortedColumn( 0, 'asc' );
+ $view->setSortedColumn( 'label', 'asc' );
$view->setLimit( 24 );
$view->setGraphLimit( 24 );
$view->disableSearchBox();