2007-09-14 21:33:51 +02:00
|
|
|
<?php
|
|
|
|
|
2008-01-08 07:41:55 +01:00
|
|
|
/**
|
|
|
|
* @package cms
|
2008-01-10 01:33:49 +01:00
|
|
|
* @subpackage reports
|
2008-01-08 07:41:55 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Statistics section of the CMS
|
2008-01-10 01:33:49 +01:00
|
|
|
* @package cms
|
|
|
|
* @subpackage reports
|
2008-01-08 07:41:55 +01:00
|
|
|
*/
|
2007-09-14 21:33:51 +02:00
|
|
|
class StatisticsAdmin extends LeftAndMain {
|
2007-09-15 02:55:36 +02:00
|
|
|
static $tree_class = "SiteTree";
|
|
|
|
static $subitem_class = "Member";
|
2007-09-16 18:24:02 +02:00
|
|
|
var $charts = array();
|
2007-09-15 02:55:36 +02:00
|
|
|
|
2007-09-14 21:33:51 +02:00
|
|
|
/**
|
|
|
|
* Initialisation method called before accessing any functionality that BulkLoaderAdmin has to offer
|
|
|
|
*/
|
|
|
|
public function init() {
|
|
|
|
parent::init();
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-16 18:24:45 +02:00
|
|
|
//Get rid of prototype 1.4.x
|
|
|
|
Requirements::clear();
|
|
|
|
|
|
|
|
//Load prototype 1.5.x
|
|
|
|
Requirements::javascript("jsparty/prototype15.js");
|
|
|
|
|
|
|
|
//Restore needed requirements
|
|
|
|
Requirements::javascript("jsparty/behaviour.js");
|
|
|
|
Requirements::javascript("jsparty/prototype_improvements.js");
|
|
|
|
Requirements::javascript("jsparty/loader.js");
|
|
|
|
|
|
|
|
Requirements::javascript("jsparty/layout_helpers.js");
|
|
|
|
Requirements::javascript("jsparty/tree/tree.js");
|
|
|
|
Requirements::css("jsparty/tree/tree.css");
|
|
|
|
Requirements::javascript("jsparty/scriptaculous/effects.js");
|
|
|
|
Requirements::javascript("jsparty/scriptaculous/dragdrop.js");
|
|
|
|
|
|
|
|
Requirements::javascript("jsparty/tabstrip/tabstrip.js");
|
|
|
|
Requirements::css("jsparty/tabstrip/tabstrip.css");
|
|
|
|
|
|
|
|
|
|
|
|
Requirements::css("jsparty/greybox/greybox.css");
|
|
|
|
Requirements::javascript("jsparty/greybox/AmiJS.js");
|
|
|
|
Requirements::javascript("jsparty/greybox/greybox.js");
|
|
|
|
|
|
|
|
Requirements::javascript("cms/javascript/LeftAndMain.js");
|
|
|
|
Requirements::javascript("cms/javascript/LeftAndMain_left.js");
|
|
|
|
Requirements::javascript("cms/javascript/LeftAndMain_right.js");
|
|
|
|
|
|
|
|
Requirements::javascript("jsparty/calendar/calendar.js");
|
|
|
|
Requirements::javascript("jsparty/calendar/lang/calendar-en.js");
|
|
|
|
Requirements::javascript("jsparty/calendar/calendar-setup.js");
|
|
|
|
Requirements::css("sapphire/css/CalendarDateField.css");
|
|
|
|
Requirements::css("jsparty/calendar/calendar-win2k-1.css");
|
|
|
|
|
|
|
|
Requirements::javascript('sapphire/javascript/Validator.js');
|
|
|
|
|
|
|
|
Requirements::css("sapphire/css/SubmittedFormReportField.css");
|
|
|
|
|
|
|
|
Requirements::css('cms/css/TinyMCEImageEnhancement.css');
|
2007-11-15 23:30:25 +01:00
|
|
|
Requirements::javascript("jsparty/SWFUpload/SWFUpload.js");
|
2007-09-16 18:24:45 +02:00
|
|
|
Requirements::javascript("cms/javascript/Upload.js");
|
|
|
|
Requirements::javascript("sapphire/javascript/Security_login.js");
|
|
|
|
Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
|
|
|
|
|
|
|
|
|
|
|
|
//Load statistics requirements
|
2007-09-15 22:23:50 +02:00
|
|
|
Requirements::javascript("jsparty/plotr.js");
|
2007-09-16 18:24:02 +02:00
|
|
|
Requirements::javascript("jsparty/tablesort.js");
|
|
|
|
Requirements::javascript("cms/javascript/StatisticsAdmin.js");
|
|
|
|
|
2007-09-15 22:23:50 +02:00
|
|
|
Requirements::css("cms/css/StatisticsAdmin.css");
|
2007-09-14 21:33:51 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-14 21:33:51 +02:00
|
|
|
public function Link($action=null) {
|
|
|
|
return "admin/statistics/$action";
|
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-14 21:33:51 +02:00
|
|
|
/**
|
|
|
|
* Form that will be shown when we open one of the items
|
2007-09-16 18:24:02 +02:00
|
|
|
*/
|
2007-09-15 22:23:50 +02:00
|
|
|
public function EditForm() {
|
2007-11-07 08:44:51 +01:00
|
|
|
return "<div class=\"tab statstab\" id=\"bovs\">\n
|
2008-01-10 04:28:13 +01:00
|
|
|
<h1>"._t('StatisticsAdmin.WELCOME','Select a report type from the left for a detailed look at site statistics')."</h1>\n\n" .
|
2007-09-16 18:29:04 +02:00
|
|
|
$this->RecentViews() .
|
|
|
|
"\n\n</div>\n\n" .
|
|
|
|
$this->showAll();
|
2007-09-16 18:24:02 +02:00
|
|
|
}
|
|
|
|
|
2007-09-16 18:29:04 +02:00
|
|
|
function RecentViews() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::get_recent_views();
|
2007-09-16 18:29:04 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
|
|
|
function Trend() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::trend_chart(array('PageView', 'Member', 'SiteTree'), 'day', 'mchart', 'Line', 'red');
|
2007-09-16 18:24:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function BrowserPie() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::browser_chart();
|
2007-09-14 21:33:51 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-16 18:27:36 +02:00
|
|
|
function OSPie() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::os_chart();
|
2007-09-16 18:27:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function UACPie() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::activity_chart();
|
2007-09-16 18:27:36 +02:00
|
|
|
}
|
|
|
|
|
2007-09-16 18:24:02 +02:00
|
|
|
function UserTable() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::user_record_table();
|
2007-09-15 02:55:36 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
|
|
|
function ViewTable() {
|
2007-10-25 02:37:09 +02:00
|
|
|
return Statistics::get_views('all');
|
2007-09-15 02:55:36 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-16 18:27:36 +02:00
|
|
|
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-16 18:24:45 +02:00
|
|
|
function showAll() {
|
2007-11-07 08:44:51 +01:00
|
|
|
return '<div class="tab statstab">' . $this->BrowserPie() .
|
2007-09-16 18:27:36 +02:00
|
|
|
$this->OSPie() .
|
|
|
|
$this->UACPie() .
|
2007-09-16 18:24:45 +02:00
|
|
|
$this->Trend() .
|
|
|
|
$this->UserTable() .
|
2007-11-07 08:44:51 +01:00
|
|
|
$this->ViewTable() . '</div>';
|
2007-09-15 02:49:54 +02:00
|
|
|
}
|
2007-09-16 18:24:02 +02:00
|
|
|
|
2007-09-16 18:29:04 +02:00
|
|
|
public function viewcsv() {
|
|
|
|
header("Content-type: application/x-msdownload");
|
|
|
|
header("Content-Disposition: attachment; filename=viewreport.csv");
|
|
|
|
header("Pragma: no-cache");
|
|
|
|
header("Expires: 0");
|
2007-10-25 02:37:09 +02:00
|
|
|
echo Statistics::get_view_csv();
|
2007-09-16 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function usercsv() {
|
|
|
|
header("Content-type: application/x-msdownload");
|
|
|
|
header("Content-Disposition: attachment; filename=userreport.csv");
|
|
|
|
header("Pragma: no-cache");
|
|
|
|
header("Expires: 0");
|
2007-10-25 02:37:09 +02:00
|
|
|
echo Statistics::get_user_csv();
|
2007-09-16 18:29:04 +02:00
|
|
|
}
|
|
|
|
|
2007-09-14 21:33:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|