forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs matomo-org#4041, matomo-org#3317, allow visualization ID to be w…
…hole class name, allow footer icons to be customized per report/visualization, made visitor log a new visualization and removed the datatable_template display property.
- Loading branch information
Benaka Moorthi
committed
Sep 18, 2013
1 parent
c22a40a
commit c0768bf
Showing
18 changed files
with
409 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Piwik - Open source web analytics | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
* | ||
* @category Piwik_Plugins | ||
* @package Live | ||
*/ | ||
namespace Piwik\Plugins\Live; | ||
|
||
use Piwik\View; | ||
use Piwik\DataTableVisualization; | ||
|
||
/** | ||
* A special DataTable visualization for the Live.getLastVisitsDetails API method. | ||
*/ | ||
class VisitorLog extends DataTableVisualization | ||
{ | ||
static public $clientSideParameters = array( | ||
'filter_limit', | ||
'filter_offset', | ||
'filter_sort_column', | ||
'filter_sort_order', | ||
); | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct($view) | ||
{ | ||
$view->datatable_js_type = 'VisitorLog'; | ||
} | ||
|
||
/** | ||
* Renders this visualization. | ||
* | ||
* @param DataTable $dataTable | ||
* @param array $properties View Properties. | ||
* @return string | ||
*/ | ||
public function render($dataTable, $properties, $javascriptVariablesToSet) | ||
{ | ||
$view = new View("@Live/_dataTableViz_visitorLog.twig"); | ||
$view->properties = $properties; | ||
$view->dataTable = $dataTable; | ||
$view->javascriptVariablesToSet = $javascriptVariablesToSet; | ||
return $view->render(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* Piwik - Web Analytics | ||
* | ||
* Visitor profile popup control. | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
*/ | ||
|
||
(function ($, require) { | ||
|
||
var exports = require('piwik/UI'), | ||
DataTable = exports.DataTable, | ||
dataTablePrototype = DataTable.prototype; | ||
|
||
/** | ||
* DataTable UI class for jqPlot graph datatable visualizations. | ||
* | ||
* @constructor | ||
*/ | ||
exports.VisitorLog = function (element) { | ||
DataTable.call(this, element); | ||
}; | ||
|
||
$.extend(exports.VisitorLog.prototype, dataTablePrototype, { | ||
|
||
/** | ||
* Initializes this class. | ||
*/ | ||
init: function () { | ||
dataTablePrototype.init.call(this); | ||
|
||
// Replace duplicated page views by a NX count instead of using too much vertical space | ||
$("ol.visitorLog").each(function () { | ||
var prevelement; | ||
var prevhtml; | ||
var counter = 0; | ||
$(this).find("li").each(function () { | ||
counter++; | ||
$(this).val(counter); | ||
var current = $(this).html(); | ||
if (current == prevhtml) { | ||
var repeat = prevelement.find(".repeat"); | ||
if (repeat.length) { | ||
repeat.html((parseInt(repeat.html()) + 1) + "x"); | ||
} else { | ||
prevelement.append($("<em>2x</em>").attr({'class': 'repeat', 'title': _pk_translate('Live_PageRefreshed')})); | ||
} | ||
$(this).hide(); | ||
} else { | ||
prevhtml = current; | ||
prevelement = $(this); | ||
} | ||
|
||
$(this).tooltip({ | ||
track: true, | ||
show: false, | ||
hide: false, | ||
content: function() { | ||
var title = $(this).attr('title'); | ||
return $('<a>').text( title ).html().replace(/\n/g, '<br />'); | ||
}, | ||
tooltipClass: 'small' | ||
}); | ||
}); | ||
}); | ||
|
||
// launch visitor profile on visitor profile link click | ||
this.$element.on('click', '.visitor-log-visitor-profile-link', function (e) { | ||
e.preventDefault(); | ||
broadcast.propagateNewPopoverParameter('visitorProfile', $(this).attr('data-visitor-id')); | ||
return false; | ||
}); | ||
}, | ||
}); | ||
|
||
})(jQuery, require); |
Oops, something went wrong.