qhoxie: fixed prototype 1.5.x issues for plotting, drops 1.4.x for stats page only, rework of stats admin css

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42127 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 16:24:45 +00:00
parent bdb4e5ae65
commit b3da227764
4 changed files with 141 additions and 19 deletions

View File

@ -11,6 +11,53 @@ class StatisticsAdmin extends LeftAndMain {
public function init() { public function init() {
parent::init(); parent::init();
//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');
Requirements::javascript("jsparty/SWFUpload/SWFUpload.js");
Requirements::javascript("cms/javascript/Upload.js");
Requirements::javascript("sapphire/javascript/Security_login.js");
Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
//Load statistics requirements
Requirements::javascript("jsparty/plotr.js"); Requirements::javascript("jsparty/plotr.js");
Requirements::javascript("jsparty/tablesort.js"); Requirements::javascript("jsparty/tablesort.js");
Requirements::javascript("cms/javascript/StatisticsAdmin.js"); Requirements::javascript("cms/javascript/StatisticsAdmin.js");
@ -26,11 +73,10 @@ class StatisticsAdmin extends LeftAndMain {
* Form that will be shown when we open one of the items * Form that will be shown when we open one of the items
*/ */
public function EditForm() { public function EditForm() {
return $this->Trend(); return $this->showAll();
} }
function Trend() { function Trend() {
return Statistics::TrendChart(array('Member', 'SiteTree', 'Group'), 'day', 'mchart', 'Line', 'red'); return Statistics::TrendChart(array('Member', 'SiteTree', 'Group'), 'day', 'mchart', 'Line', 'red');
} }
@ -52,8 +98,11 @@ class StatisticsAdmin extends LeftAndMain {
return Statistics::UserRecordTable(); return Statistics::UserRecordTable();
} }
public function overview($params) { function showAll() {
return $this->BrowserPie(); return $this->BrowserPie() .
$this->Trend() .
$this->UserTable() .
$this->ViewTable();
} }
} }

View File

@ -123,3 +123,26 @@ td.sized3
{ {
background-color: #A0BDF7; background-color: #A0BDF7;
} }
ul.tree li#stoverview a {
background-image: url(../images/treeicons/task-file.gif);
}
ul.tree li#stusers a {
background-image: url(../images/treeicons/multi-user.gif);
}
ul.tree li#stviews a {
background-image: url(../images/treeicons/preferences-file.gif);
}
ul.tree li#sttrends a {
background-image: url(../images/treeicons/element-file.gif);
}
ul.tree li#stbrowsers a {
background-image: url(../images/treeicons/reports-file.png);
}

View File

@ -38,6 +38,62 @@ showCT = function() {
} }
Event.observe(window, 'load', function() { overview = function() {
var stob = $('sitetree').observeMethod('SelectionChanged', showCT()); $('browserchart') ? $('browserchart').show() : null;
}); $('trendchart') ? $('trendchart').show() : null;
$('usertable') ? $('usertable').show() : null;
$('viewtable') ? $('viewtable').show() : null;
}
users = function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').show() : null;
$('viewtable') ? $('viewtable').hide() : null;
}
views = function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
$('viewtable') ? $('viewtable').show() : null;
}
trends = function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').show() : null;
$('usertable') ? $('usertable').hide() : null;
$('viewtable') ? $('viewtable').hide() : null;
}
browsers = function() {
$('browserchart') ? $('browserchart').show() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
$('viewtable') ? $('viewtable').hide() : null;
}
SiteTreeNode.prototype.onselect = function() {
switch(this.id) {
case 'statsroot' :
break;
case 'stoverview' :
overview();
break;
case 'stusers' :
users();
break;
case 'stviews' :
views();
break;
case 'sttrends' :
trends();
break;
case 'stbrowsers' :
browsers();
break;
default :
console.log('Unrecognized option ' + this.id);
}
};

View File

@ -1,20 +1,14 @@
<style>
ul.tree li.ReportType span.ReportType a {
background-image: url(cms/images/treeicons/sent-folder.png);
font-weight: bold;
margin: 0pt;
}
</style>
<h2>Statistics</h2> <h2>Statistics</h2>
<div id="treepanes"> <div id="treepanes">
<div id="sitetree_holder"> <div id="sitetree_holder">
<ul id="sitetree" class="tree unformatted"> <ul id="sitetree" class="tree unformatted">
<li class="Root"><a href="#">Report Types</a> <li class="Root" id="statsroot"><a>Report Types</a>
<li id="1"><a href="$baseURL/admin/statistics/overview">Overview</a></li> <li id="stoverview"><a href="$baseURL/admin/statistics/overview">Overview</a></li>
<li id="1"><a href="$baseURL/admin/statistics/users">Users</a></li> <li id="stusers"><a href="$baseURL/admin/statistics/users">Users</a></li>
<li id="stviews"><a href="$baseURL/admin/statistics/views">Views</a></li>
<li id="sttrends"><a href="$baseURL/admin/statistics/trends">Trends</a></li>
<li id="stbrowsers"><a href="$baseURL/admin/statistics/browsers">Browsers</a></li>
</li> </li>
</ul> </ul>
</div> </div>