mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
qhoxie: additions to left statistics panel
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41855 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
83530f139f
commit
0762c09ba2
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
class StatisticsAdmin extends LeftAndMain {
|
||||
static $tree_class = "SiteTree";
|
||||
static $subitem_class = "Member";
|
||||
|
||||
/**
|
||||
* Initialisation method called before accessing any functionality that BulkLoaderAdmin has to offer
|
||||
*/
|
||||
@ -28,6 +31,34 @@ class StatisticsAdmin extends LeftAndMain {
|
||||
);
|
||||
}
|
||||
|
||||
function getSiteTreeFor($className) {
|
||||
$obj = singleton($className);
|
||||
$obj->markPartialTree();
|
||||
if($p = $this->currentPage()) $obj->markToExpose($p);
|
||||
|
||||
// getChildrenAsUL is a flexible and complex way of traversing the tree
|
||||
$siteTree = $obj->getChildrenAsUL("", '
|
||||
"<li id=\"record-$child->ID\" class=\"" . $child->CMSTreeClasses($extraArg) . "\">" .
|
||||
"<a href=\"" . Director::link(substr($extraArg->Link(),0,-1), "show", $child->ID) . "\" " . (($child->canEdit() || $child->canAddChildren()) ? "" : "class=\"disabled\"") . " title=\"Page type: ".$child->class."\" >" .
|
||||
($child->TreeTitle()) .
|
||||
"</a>"
|
||||
'
|
||||
,$this, true);
|
||||
|
||||
// Wrap the root if needs be.
|
||||
|
||||
$rootLink = $this->Link() . '0';
|
||||
$siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\">Pages</a>"
|
||||
. $siteTree . "</li></ul>";
|
||||
|
||||
|
||||
return $siteTree;
|
||||
}
|
||||
|
||||
public function SiteTreeAsUL() {
|
||||
return $this->getSiteTreeFor("SiteTree");
|
||||
}
|
||||
|
||||
public function versions() {
|
||||
/*$pageID = $this->urlParams['ID'];
|
||||
//$pageID = "1";
|
||||
|
@ -1,59 +1,10 @@
|
||||
<div class="title"><div>Report Types</div></div>
|
||||
|
||||
<div id="treepanes">
|
||||
<div id="sitetree_holder" style="overflow:auto">
|
||||
<% if Items %>
|
||||
<ul id="sitetree" class="tree unformatted">
|
||||
<li id="$ID" class="root Root"><a>Items</a>
|
||||
<ul>
|
||||
<% control Items %>
|
||||
<li id="record-$class">
|
||||
<a href="admin/statistics/show/$ID">$Title</a>
|
||||
</li>
|
||||
<% end_control %>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="sitetree_holder" style="overflow:auto">
|
||||
<ul id="statsleft_tree" class="tree unformatted">
|
||||
<li><a href="$baseURL/admin/showtype/$ID">Overview</a></li>
|
||||
$SiteTreeAsUL
|
||||
</ul>
|
||||
<% end_if %>
|
||||
</div>
|
||||
|
||||
<h2 id="heading_versions">Page Version History</h2>
|
||||
<div class="listpane" id="versions_holder">
|
||||
<p class="pane_actions" id="versions_actions">
|
||||
</p>
|
||||
|
||||
<div class="unitBody">
|
||||
<table id="Versions">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>#</td>
|
||||
<td>When</td>
|
||||
<td>Author</td>
|
||||
<td>Publisher</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% control versions %>
|
||||
<tr id="page-$RecordID-version-$Version" class="$EvenOdd $PublishedClass">
|
||||
<td>$Version</td>
|
||||
<td class="$LastEdited" title="$LastEdited.Ago">$LastEdited.Nice</td>
|
||||
<td>$Author.FirstName $Author.Surname.Initial</td>
|
||||
<td>
|
||||
<% if Published %>
|
||||
<% if Publisher %>
|
||||
$Publisher.FirstName $Publisher.Surname.Initial
|
||||
<% else %>
|
||||
Unknown
|
||||
<% end_if %>
|
||||
<% else %>
|
||||
Not published
|
||||
<% end_if %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end_control %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user