qhoxie: stats admin organization

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42129 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 16:29:04 +00:00
parent 3090ae956d
commit e4fedc6bad
2 changed files with 34 additions and 5 deletions

View File

@ -73,9 +73,16 @@ class StatisticsAdmin extends LeftAndMain {
* Form that will be shown when we open one of the items
*/
public function EditForm() {
return $this->showAll();
return "<div id=\"bovs\">\n
<h1>Select a report type from the left for a detailed look at site statistics</h1>\n\n" .
$this->RecentViews() .
"\n\n</div>\n\n" .
$this->showAll();
}
function RecentViews() {
return Statistics::getRecentViews();
}
function Trend() {
return Statistics::TrendChart(array('PageView', 'Member', 'SiteTree'), 'day', 'mchart', 'Line', 'red');
@ -112,6 +119,22 @@ class StatisticsAdmin extends LeftAndMain {
$this->ViewTable();
}
public function viewcsv() {
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=viewreport.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo Statistics::getViewCSV();
}
public function usercsv() {
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=userreport.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo Statistics::getUserCSV();
}
}
?>

View File

@ -39,12 +39,13 @@ showCT = function() {
overview = function() {
$('browserchart') ? $('browserchart').show() : null;
$('trendchart') ? $('trendchart').show() : null;
$('usertable') ? $('usertable').show() : null;
$('viewtable') ? $('viewtable').show() : null;
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
$('viewtable') ? $('viewtable').hide() : null;
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').show() : null;
}
users = function() {
@ -54,6 +55,7 @@ users = function() {
$('viewtable') ? $('viewtable').hide() : null;
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').show() : null;
$('bovs') ? $('bovs').hide() : null;
}
views = function() {
@ -63,6 +65,7 @@ views = function() {
$('viewtable') ? $('viewtable').show() : null;
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
trends = function() {
@ -72,6 +75,7 @@ trends = function() {
$('viewtable') ? $('viewtable').hide() : null;
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
browsers = function() {
@ -81,6 +85,7 @@ browsers = function() {
$('viewtable') ? $('viewtable').hide() : null;
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
os = function() {
@ -90,6 +95,7 @@ os = function() {
$('viewtable') ? $('viewtable').hide() : null;
$('oschart') ? $('oschart').show() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}