From 1b5c8ee6a8cfb8953631988ed6f2355f54b130ea Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 15 Sep 2007 20:23:50 +0000 Subject: [PATCH] qhoxie: basics of tabular data for stats (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41923 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/StatisticsAdmin.php | 38 +++++++---------- css/StatisticsAdmin.css | 44 ++++++++++++++++++++ images/statistics/bg_header.jpg | Bin 0 -> 1792 bytes templates/Includes/StatisticsAdmin_Graph.ss | 44 ++++++++++++++++++++ templates/Includes/StatisticsAdmin_left.ss | 5 +-- templates/Includes/StatisticsAdmin_right.ss | 24 ++++++++++- 6 files changed, 126 insertions(+), 29 deletions(-) create mode 100644 css/StatisticsAdmin.css create mode 100644 images/statistics/bg_header.jpg create mode 100644 templates/Includes/StatisticsAdmin_Graph.ss 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 0000000000000000000000000000000000000000..10dbd74e8acdbe80927dce4af7f5ad0b6d1dcf08 GIT binary patch literal 1792 zcmex=R-tZb|xz{bJG4g_o*9GqNST$~&{V890g0&u{{ z%)-LP#>T_J!6U@S!zUyHk`WOE%L_s%0VoC6gTnZKfI*OhL79nznNg5|Nsy6Qkn#T! zh6)BoFaWv}1{hhGnK&V$j4&}E&Bz3FumDgw2P4q^KzWFqFk|9HCg#a3q9KNkjf#P+ zf`t)sdG=REXwFh_;TAQ zXY)=|Jzv2yau2kvUJji!pLXA=q# zNMMr@An8Peb^1T51_NnswV^_~Ae`iI1OxVTk@iz-zyHKj>DQM=&A;uNE#Hy+cK&z! zZKZKh#T(PRbV3((i&iW;8m9r`L_X>k{g$!l=sYkl6vz{aSbbDX3&s@#s*HlEgmMC1 zyMU%V>IQN5R)Gx^`|=8#BB1FYML?^Exrgc z9M0AG=-Ra>FliCY7`XHA)rBp;{M1Mzz3ie$yp%lf$F~l zWgLvaYQw6Vj@CNn-Pirk5N-bV)qjRuwfzG3!G7SiRG+}}`U-nl!zb2H3>>U)SQwu$ zTQR)7!ahNpL(%yJ8)F3H0tepT4fzflg7XVB1Q-~2Ua@8fFxNeZPf(vA=di%v&SA|v zmiz`y7L7`Va}Cy|j8C|L1|ca~`+|kx{tmtaL5wb+80S_syt`mlv;A+*{qL*)ZaKGK z;N`df48^~vIr}+ture__FuY-4PwM=^G{IVggMmr?!Kx)p4GiiJxGn*0X1v3|_f~^} z;Q|8(gKdNH0tN=jJB!Q@h;TxcGcbJ9FkxU~;7{Or!MKz`wnMgy#bK2}Lx95nn*d13 B)&>9o literal 0 HcmV?d00001 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 %> + +