diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2009-05-31 15:31:14 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2009-05-31 15:31:14 +0400 |
commit | adb2d7a006149fa391a436844e7561453393169a (patch) | |
tree | e67cbf2d1f837dffeaaacdb98f7fa237a3312241 /core/DataTable/Filter/MetadataCallbackReplace.php | |
parent | 0b89c780eb817c1daa12ae986a6e4260b7d23d30 (diff) |
- on a rainy sunday night, implented one of the most requested feature which was little work and should make a lot of users happy!
fixes #747
adding links on both sub tables for search engines and keywords linking directly to the search engine page for this keyword
added definition for the main search engines (approx 15) users can contribute more if they like; if a definition, eg. "search?q={k}" for Google is not found, then we simply link to the search engine homepage.
updated FAQ on how to add a search engine see http://piwik.org/faq/general/#faq_39
added tests to check that the search engine file is defined properly
- renamed queuefilter to queueFilter for consistency
git-svn-id: http://dev.piwik.org/svn/trunk@1158 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/MetadataCallbackReplace.php')
-rw-r--r-- | core/DataTable/Filter/MetadataCallbackReplace.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/core/DataTable/Filter/MetadataCallbackReplace.php b/core/DataTable/Filter/MetadataCallbackReplace.php new file mode 100644 index 0000000000..cf3d071b1a --- /dev/null +++ b/core/DataTable/Filter/MetadataCallbackReplace.php @@ -0,0 +1,35 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later + * @version $Id$ + * + * @package Piwik_DataTable + */ + +/** + * Replace a metadata value with a new value resulting + * from the function called with the metadata's value + * + * @package Piwik_DataTable + * @subpackage Piwik_DataTable_Filter + */ +class Piwik_DataTable_Filter_MetadataCallbackReplace extends Piwik_DataTable_Filter_ColumnCallbackReplace +{ + public function __construct( $table, $metadataToFilter, $functionToApply, $functionParameters = null ) + { + parent::__construct($table, $metadataToFilter, $functionToApply, $functionParameters); + } + + protected function setElementToReplace($row, $metadataToFilter, $newValue) + { + $row->setMetadata($metadataToFilter, $newValue); + } + + protected function getElementToReplace($row, $metadataToFilter) + { + return $row->getMetadata($metadataToFilter); + } +} |