diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-10-08 09:38:27 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-10-08 09:38:27 +0400 |
commit | d713a864d250f6b5f6edf05129d73f3b109c1a33 (patch) | |
tree | 43d3eda911e26e9935fb1a7e7f33db3e8287309b /plugins | |
parent | aa6de241fe398ea578524dfe11f18c44fe6e7013 (diff) |
Merged
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/CoreHome.php | 1 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 17 | ||||
-rw-r--r-- | plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig | 4 | ||||
-rw-r--r-- | plugins/Provider/Visitor.php | 2 | ||||
-rw-r--r-- | plugins/Provider/functions.php | 2 |
5 files changed, 22 insertions, 4 deletions
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index e06e8cf0ac..a2f5195fa3 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -249,5 +249,6 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'General_YourChangesHaveBeenSaved'; $translationKeys[] = 'CoreHome_UndoPivotBySubtable'; $translationKeys[] = 'CoreHome_PivotBySubtable'; + $translationKeys[] = 'General_LearnMore'; } } diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 205ec70023..a65ffd8519 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -312,6 +312,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { self.handleColumnHighlighting(domElem); self.handleExpandFooter(domElem); self.setFixWidthToMakeEllipsisWork(domElem); + self.handleSummaryRow(domElem); }, setFixWidthToMakeEllipsisWork: function (domElem) { @@ -1700,6 +1701,22 @@ $.extend(DataTable.prototype, UIControl.prototype, { }); }, + handleSummaryRow: function (domElem) { + var details = _pk_translate('General_LearnMore', [' (<a href="http://piwik.org/faq/how-to/faq_54/" target="_blank">', '</a>)']); + + domElem.find('tr.summaryRow').each(function () { + var labelSpan = $(this).find('.label .value'); + var defaultLabel = labelSpan.text(); + + $(this).hover(function() { + labelSpan.html(defaultLabel + details); + }, + function() { + labelSpan.text(defaultLabel); + }); + }); + }, + // also used in action data table doHandleRowActions: function (trs) { var self = this; diff --git a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig index ab2ed7a702..f6fe938c6a 100644 --- a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig +++ b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig @@ -18,7 +18,7 @@ {% else %} {%- for rowId, row in dataTable.getRows() -%} {%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%} - {%- set isSummaryRow = (rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW')) -%} + {%- set isSummaryRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') -%} {%- set shouldHighlightRow = isSummaryRow and properties.highlight_summary_row -%} {# display this row if it doesn't have a subtable or if we don't replace the row with the subtable #} @@ -29,7 +29,7 @@ {% if showRow %} <tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %} - class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}" + class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}{% if isSummaryRow %} summaryRow{% endif %}" {% if rowHasSubtable %}title="{{ 'CoreHome_ClickRowToExpandOrContract'|translate }}"{% endif %}> {% for column in properties.columns_to_display %} <td> diff --git a/plugins/Provider/Visitor.php b/plugins/Provider/Visitor.php index 0efbb92eb3..757ac19783 100644 --- a/plugins/Provider/Visitor.php +++ b/plugins/Provider/Visitor.php @@ -23,7 +23,7 @@ class Visitor public function getProvider() { - if (isset($this->details['location_provider'])) { + if (!isset($this->details['location_provider'])) { return $this->details['location_provider']; } else { return Piwik::translate('General_Unknown'); diff --git a/plugins/Provider/functions.php b/plugins/Provider/functions.php index df549160d8..3e2c4a2da8 100644 --- a/plugins/Provider/functions.php +++ b/plugins/Provider/functions.php @@ -38,7 +38,7 @@ function getHostnameName($in) function getHostnameUrl($in) { if ($in == DataTable::LABEL_SUMMARY_ROW || empty($in) || strtolower($in) === 'ip') { - return false; + return null; } // if the name looks like it can be used in a URL, use it in one, otherwise link to startpage |