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:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2008-11-21 21:10:02 +0300
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2008-11-21 21:10:02 +0300
commit9b86be897b8ba44278debf7e93e4f133541414e2 (patch)
treef7c60a9a0159325d64aa3bfaf4c5d4fb58a6418d
parent9abd41fedc8c615e927bf1a055e58b27869fc35e (diff)
- not showing the icon "more data" for some reports
- excluding *.db from svn - still needs work (refactoring the viewdatatable show VS enabled notion + i18n of icon etc.)
-rw-r--r--core/API/ResponseBuilder.php4
-rw-r--r--core/ViewDataTable.php39
-rw-r--r--core/ViewDataTable/Html.php17
-rw-r--r--misc/TODO2
-rw-r--r--plugins/Actions/Controller.php2
-rw-r--r--plugins/CoreHome/templates/datatable.js12
-rw-r--r--plugins/CoreHome/templates/datatable.tpl2
-rw-r--r--plugins/CoreHome/templates/datatable_footer.tpl17
-rw-r--r--plugins/Referers/Controller.php2
-rw-r--r--plugins/UserSettings/Controller.php1
-rw-r--r--plugins/VisitorInterest/Controller.php2
11 files changed, 57 insertions, 43 deletions
diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php
index d60f141c85..cb2d0edebe 100644
--- a/core/API/ResponseBuilder.php
+++ b/core/API/ResponseBuilder.php
@@ -167,9 +167,7 @@ class Piwik_API_ResponseBuilder
'filter_offset' => array('integer', '0'),
'filter_limit' => array('integer', Zend_Registry::get('config')->General->dataTable_default_limit),
),
- 'SafeDecodeLabel' => array(
- 'filter_safe_decode_label' => array('integer')
- ),
+ 'SafeDecodeLabel' => array(),
);
return $genericFilters;
diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php
index e19a2056ed..7943078d07 100644
--- a/core/ViewDataTable.php
+++ b/core/ViewDataTable.php
@@ -84,6 +84,14 @@ abstract class Piwik_ViewDataTable
*/
protected $JSexcludeLowPopulation = true;
+
+ /**
+ * Defines if we show the "Show all columns" icon under the table
+ *
+ * @var bool
+ */
+ protected $JSshowAllColumns = true;
+
/**
* Defines if we include the footer after the dataTable output.
* The footer contains all the extra features like the search box, the links Next/Previous, the icons to export in several formats, etc.
@@ -287,7 +295,6 @@ abstract class Piwik_ViewDataTable
$this->showFooter = Piwik_Common::getRequestVar('showDataTableFooter', true);
$this->variablesDefault['filter_excludelowpop_default'] = 'false';
$this->variablesDefault['filter_excludelowpop_value_default'] = 'false';
- $this->setSafeDecodeLabel();
}
/**
@@ -385,7 +392,6 @@ abstract class Piwik_ViewDataTable
'filter_exact_column',
'disable_generic_filters',
'disable_queued_filters',
- 'filter_safe_decode_label',
'filter_add_columns_when_show_all_columns',
);
foreach($toSetEventually as $varToSet)
@@ -542,7 +548,8 @@ abstract class Piwik_ViewDataTable
$javascriptVariablesToSet['show_search'] = $this->getSearchBox();
$javascriptVariablesToSet['show_offset_information'] = $this->getOffsetInformation();
$javascriptVariablesToSet['show_exclude_low_population'] = $this->getExcludeLowPopulation();
- $javascriptVariablesToSet['showAllColumns'] = $this->getShowAllColumns();
+ $javascriptVariablesToSet['showingAllColumns'] = $this->getShowingAllColumns();
+ $javascriptVariablesToSet['show_show_all_columns'] = $this->getShowAllColumns();
// we escape the values that will be displayed in the javascript footer of each datatable
// to make sure there is malicious code injected (the value are already htmlspecialchar'ed as they
@@ -680,6 +687,22 @@ abstract class Piwik_ViewDataTable
}
/**
+ * Whether or not to show the "View more data" icon
+ *
+ * @return void
+ */
+ public function disableShowAllColumns()
+ {
+ $this->JSshowAllColumns = false;
+ }
+
+ public function getShowAllColumns()
+ {
+ return $this->JSshowAllColumns;
+ }
+
+
+ /**
* @see disableExcludeLowPopulation()
*
* @return bool|string If this parameter is enabled or not
@@ -779,16 +802,6 @@ abstract class Piwik_ViewDataTable
}
/**
- * The 'label' column in the datatable will be safely url decoded.
- *
- * @return void
- */
- public function setSafeDecodeLabel()
- {
- $this->variablesDefault['filter_safe_decode_label'] = '1';
- }
-
- /**
* Sets a custom parameter, that will be printed in the javascript array associated with each datatable
*
* @param string parameter name
diff --git a/core/ViewDataTable/Html.php b/core/ViewDataTable/Html.php
index 8aec913d6b..6aa28bdb9f 100644
--- a/core/ViewDataTable/Html.php
+++ b/core/ViewDataTable/Html.php
@@ -56,10 +56,10 @@ class Piwik_ViewDataTable_Html extends Piwik_ViewDataTable
$this->dataTableTemplate = 'CoreHome/templates/datatable.tpl';
$this->variablesDefault['enable_sort'] = '1';
- $this->variablesDefault['showAllColumns'] = '0';
- if(Piwik_Common::getRequestVar('showAllColumns', '0', 'string') == '1')
+ $this->variablesDefault['showingAllColumns'] = '0';
+ if(Piwik_Common::getRequestVar('showingAllColumns', '0', 'string') == '1')
{
- $this->setShowAllColumns();
+ $this->setShowingAllColumns();
}
// load general columns translations
@@ -82,7 +82,7 @@ class Piwik_ViewDataTable_Html extends Piwik_ViewDataTable
$this->loadDataTableFromAPI();
- if($this->getShowAllColumns())
+ if($this->getShowingAllColumns())
{
$this->setColumnsToDisplay(array('label',
'nb_visits',
@@ -121,7 +121,6 @@ class Piwik_ViewDataTable_Html extends Piwik_ViewDataTable
{
$nbColumns = count($this->columnsToDisplay);
}
-
$view->nbColumns = $nbColumns;
$view->id = $this->getUniqIdTable();
@@ -255,15 +254,15 @@ class Piwik_ViewDataTable_Html extends Piwik_ViewDataTable
return $this->setRecursiveLoadDataTableIfSearchingForPattern();
}
- protected function setShowAllColumns()
+ protected function setShowingAllColumns()
{
$this->variablesDefault['filter_add_columns_when_show_all_columns'] = '1';
- $this->variablesDefault['showAllColumns'] = '1';
+ $this->variablesDefault['showingAllColumns'] = '1';
}
- protected function getShowAllColumns()
+ protected function getShowingAllColumns()
{
- return $this->variablesDefault['showAllColumns'];
+ return $this->variablesDefault['showingAllColumns'];
}
/**
diff --git a/misc/TODO b/misc/TODO
index 5d15ddf42a..7a1eec718d 100644
--- a/misc/TODO
+++ b/misc/TODO
@@ -12,7 +12,7 @@ UI fixes + adjustements
Following up show all columns new UI element
====
-- disable show icon all columns for some reports, ie. Visits per visit duration, and downloads/outlinks
+- there should be 2 different things: enable a datatable feature, and whether or not it's currently used (filters)
- disable show icon in some iframes and/or dashboard
- exclude low population broken!
- default sorting order icon is not shown anymore
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index 3721819752..07eca64d88 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -17,6 +17,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
$view->disableExcludeLowPopulation();
$view->setLimit( 15 );
$view->disableSort();
+ $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}
@@ -72,6 +73,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
$view->disableExcludeLowPopulation();
$view->setLimit( 15 );
$view->disableSort();
+ $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}
diff --git a/plugins/CoreHome/templates/datatable.js b/plugins/CoreHome/templates/datatable.js
index 81499c479f..971e6fbebc 100644
--- a/plugins/CoreHome/templates/datatable.js
+++ b/plugins/CoreHome/templates/datatable.js
@@ -510,12 +510,12 @@ dataTable.prototype =
}
);
- $('#showAllColumns', domElem)
+ $('#showingAllColumns', domElem)
.show()
.click(
function(){
self.param.viewDataTable = 'table';
- self.param.showAllColumns = $('img', this).attr('id') == 'showAllColumns' ? '1' : '0';
+ self.param.showingAllColumns = $('img', this).attr('id') == 'showingAllColumns' ? '1' : '0';
self.reloadAjaxDataTable();
}
);
@@ -568,11 +568,11 @@ dataTable.prototype =
imgToPrepend = '<img width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="'+self.param.pathToPiwik+'themes/default/images/link.gif" /> ';
}
var urlToLink = $('#urlLink',this).html();
- if( urlToLink.match("javascript:") )
+ if( urlToLink.match("javascript:") )
{
- $(this).html( '<a href="#" onClick="' + urlToLink.replace("javascript:","") + '">' + imgToPrepend + $(this).html() + '</a>');
- }
- else
+ $(this).html( '<a href="#" onClick="' + urlToLink.replace("javascript:","") + '">' + imgToPrepend + $(this).html() + '</a>');
+ }
+ else
{
$(this).html( '<a target="_blank" href="' + urlToLink + '">' + imgToPrepend + $(this).html() + '</a>');
}
diff --git a/plugins/CoreHome/templates/datatable.tpl b/plugins/CoreHome/templates/datatable.tpl
index 7fa2363943..3f1e93ffde 100644
--- a/plugins/CoreHome/templates/datatable.tpl
+++ b/plugins/CoreHome/templates/datatable.tpl
@@ -1,5 +1,5 @@
<div id="{$id}">
- <div class="{if $javascriptVariablesToSet.showAllColumns}dataTableAllColumnsWrapper{else}dataTableWrapper{/if}">
+ <div class="{if $javascriptVariablesToSet.showingAllColumns}dataTableAllColumnsWrapper{else}dataTableWrapper{/if}">
{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
{$arrayDataTable.message}
{else}
diff --git a/plugins/CoreHome/templates/datatable_footer.tpl b/plugins/CoreHome/templates/datatable_footer.tpl
index f64b4ea782..9df67f46a5 100644
--- a/plugins/CoreHome/templates/datatable_footer.tpl
+++ b/plugins/CoreHome/templates/datatable_footer.tpl
@@ -1,4 +1,4 @@
-{if $javascriptVariablesToSet.showAllColumns
+{if $javascriptVariablesToSet.showingAllColumns
|| (isset($javascriptVariablesToSet.viewDataTable) && $javascriptVariablesToSet.viewDataTable != 'table')}
{assign var=showSimpleTableIcon value=true}
{/if}
@@ -30,14 +30,15 @@
<span id="exportDataTableShow" style="display:none;padding-left:4px;">
<img src="{$piwikUrl}plugins/CoreHome/templates/images/more.png" />
</span>
-
- <span id="showAllColumns" style="display:none;float:right;padding-right:4px;border-right:1px solid #82A1D2;">
- {if isset($showSimpleTableIcon)}
- <img id="hideAllColumns" title="Display normal table" src="{$piwikUrl}themes/default/images/table.png" />
- {else}
- <img id="showAllColumns" title="Display more data" src="{$piwikUrl}themes/default/images/table_more.png" />
+ {if $javascriptVariablesToSet.show_show_all_columns}
+ <span id="showingAllColumns" style="display:none;float:right;padding-right:4px;border-right:1px solid #82A1D2;">
+ {if isset($showSimpleTableIcon)}
+ <img id="hidingAllColumns" title="Display normal table" src="{$piwikUrl}themes/default/images/table.png" />
+ {else}
+ <img id="showingAllColumns" title="Display more data" src="{$piwikUrl}themes/default/images/table_more.png" />
+ {/if}
+ </span>
{/if}
- </span>
</span>
<span id="loadingDataTable"><img src="{$piwikUrl}themes/default/images/loading-blue.gif" /> {'General_LoadingData'|translate}</span>
diff --git a/plugins/Referers/Controller.php b/plugins/Referers/Controller.php
index 9d7676ece4..31025d9e00 100644
--- a/plugins/Referers/Controller.php
+++ b/plugins/Referers/Controller.php
@@ -75,7 +75,6 @@ class Piwik_Referers_Controller extends Piwik_Controller
'getSearchEnginesFromKeywordId'
);
$view->disableExcludeLowPopulation();
-
$view->setColumnsToDisplay( array('label','nb_visits') );
return $this->renderView($view, $fetch);
@@ -147,7 +146,6 @@ class Piwik_Referers_Controller extends Piwik_Controller
$view->setColumnsToDisplay( array('label','nb_visits') );
$view->setLimit(10);
$view->setGraphLimit(12);
-
return $this->renderView($view, $fetch);
}
diff --git a/plugins/UserSettings/Controller.php b/plugins/UserSettings/Controller.php
index 03b9e8c7c1..f0fa7c7645 100644
--- a/plugins/UserSettings/Controller.php
+++ b/plugins/UserSettings/Controller.php
@@ -85,6 +85,7 @@ class Piwik_UserSettings_Controller extends Piwik_Controller
$view->disableExcludeLowPopulation();
$view->disableSort();
$view->disableOffsetInformation();
+ $view->disableShowAllColumns();
$view->setColumnsToDisplay( array('label','nb_visits') );
$view->setSortedColumn( 'nb_visits' );
diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php
index 98390339a5..65d426863a 100644
--- a/plugins/VisitorInterest/Controller.php
+++ b/plugins/VisitorInterest/Controller.php
@@ -22,6 +22,7 @@ class Piwik_VisitorInterest_Controller extends Piwik_Controller
$view->disableExcludeLowPopulation();
$view->disableOffsetInformation();
$view->disableSearchBox();
+ $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}
@@ -38,6 +39,7 @@ class Piwik_VisitorInterest_Controller extends Piwik_Controller
$view->disableOffsetInformation();
$view->disableSearchBox();
$view->disableSort();
+ $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}