diff --git a/code/StatisticsAdmin.php b/code/StatisticsAdmin.php index 159e339d..8adda630 100644 --- a/code/StatisticsAdmin.php +++ b/code/StatisticsAdmin.php @@ -8,9 +8,12 @@ class StatisticsAdmin extends LeftAndMain { * Initialisation method called before accessing any functionality that BulkLoaderAdmin has to offer */ public function init() { - //Requirements::javascript('cms/javascript/StatisticsAdmin_left.js'); - //Requirements::javascript('cms/javascript/StatisticsAdmin_right.js'); parent::init(); + + Requirements::javascript("jsparty/plotr.js"); + Requirements::javascript("jsparty/tablekit.js"); + + Requirements::css("cms/css/StatisticsAdmin.css"); } public function Link($action=null) { @@ -20,15 +23,8 @@ class StatisticsAdmin extends LeftAndMain { /** * Form that will be shown when we open one of the items */ - public function getEditForm($id = null) { - return new Form($this, "EditForm", - new FieldSet( - new ReadonlyField('id #',$id) - ), - new FieldSet( - new FormAction('go') - ) - ); + public function EditForm() { + } function getSiteTreeFor($className) { @@ -59,19 +55,13 @@ class StatisticsAdmin extends LeftAndMain { return $this->getSiteTreeFor("SiteTree"); } - public function versions() { - /*$pageID = $this->urlParams['ID']; - //$pageID = "1"; - $page = $this->getRecord($pageID); - if($page) { - $versions = $page->allVersions($_REQUEST['unpublished'] ? "" : "`SiteTree_versions`.WasPublished = 1"); - return array( - 'Versions' => $versions, - ); - } else { - return "Can't find page #$pageID"; - }*/ - + function UserCount($date = null) { + $allUsers = DataObject::get('Member'); + return $allUsers->TotalItems(); + } + + function UserTableRecords() { + return DataObject::get('Member'); } } diff --git a/css/StatisticsAdmin.css b/css/StatisticsAdmin.css new file mode 100644 index 00000000..89ee75a1 --- /dev/null +++ b/css/StatisticsAdmin.css @@ -0,0 +1,44 @@ +table.statstable { + border-collapse: collapse; + width: 90%; + margin: 20px 0 20px 0; + font-size: 12px; + +} + +.statstable td,.statstable th { + padding: 0.2em; + border: 1px solid #CCC; + +} + +.statstable th { + background: #CAE8EA url(../images/statistics/bg_header.jpg) no-repeat; + +} + +.statstable td.id { + background: #CAE8EA url(../images/statistics/bg_header.jpg) no-repeat; + +} + +.statstable th.nobg { + background: #fff; + border-top: none; + border-left: none; +} + +.statstable thead,.statstable tfoot { + background-color: #DDD; + +} + +.statstable tr.rowodd { + background-color: #fff; + +} + +.statstable tr.roweven { + background-color: #F0FBFD; + +} diff --git a/images/statistics/bg_header.jpg b/images/statistics/bg_header.jpg new file mode 100644 index 00000000..10dbd74e Binary files /dev/null and b/images/statistics/bg_header.jpg differ diff --git a/templates/Includes/StatisticsAdmin_Graph.ss b/templates/Includes/StatisticsAdmin_Graph.ss new file mode 100644 index 00000000..901a0f71 --- /dev/null +++ b/templates/Includes/StatisticsAdmin_Graph.ss @@ -0,0 +1,44 @@ + diff --git a/templates/Includes/StatisticsAdmin_left.ss b/templates/Includes/StatisticsAdmin_left.ss index 6f5069d5..79e10dea 100644 --- a/templates/Includes/StatisticsAdmin_left.ss +++ b/templates/Includes/StatisticsAdmin_left.ss @@ -3,9 +3,8 @@
diff --git a/templates/Includes/StatisticsAdmin_right.ss b/templates/Includes/StatisticsAdmin_right.ss index 4638749e..63781778 100644 --- a/templates/Includes/StatisticsAdmin_right.ss +++ b/templates/Includes/StatisticsAdmin_right.ss @@ -3,9 +3,29 @@ <% if EditForm %> $EditForm <% else %> -
-

Welcome to the $ApplicationName statistics section. Please choose a specific report from the left.

+ +

Total users: $UserCount

+ + + <% if UserTableRecords %> + + + + + + <% control UserTableRecords %> + + <% end_control %> + +
EmailType
$Iteration$Email$ClassName
+ <% else %> +

No tabular data available!

+ <% end_if %> + +
<% end_if %> + +