BUGFIX: More fixes renaming SSReport to SS_Report (from r98218)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105856 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-05-28 02:35:56 +00:00
parent 0cecb21f50
commit 850a9a9f6a
4 changed files with 21 additions and 25 deletions

View File

@ -639,7 +639,7 @@ JS;
* @return Array * @return Array
*/ */
function SideReports() { function SideReports() {
return SSReport::get_reports('SideReport'); return SS_Report::get_reports('SideReport');
} }
/** /**

View File

@ -35,7 +35,7 @@
* Showing reports to the user * Showing reports to the user
* =========================== * ===========================
* *
* Right now, all subclasses of SSReport will be shown in the ReportAdmin. However, we are planning * Right now, all subclasses of SS_Report will be shown in the ReportAdmin. However, we are planning
* on adding an explicit registration mechanism, so that you can decide which reports go in the * on adding an explicit registration mechanism, so that you can decide which reports go in the
* report admin, and which go elsewhere (such as the side panel in the CMS). * report admin, and which go elsewhere (such as the side panel in the CMS).
* *
@ -44,7 +44,7 @@
*/ */
class SS_Report extends ViewableData { class SS_Report extends ViewableData {
/** /**
* Report registry populated by {@link SSReport::register()} * Report registry populated by {@link SS_Report::register()}
*/ */
private static $registered_reports = array(); private static $registered_reports = array();
@ -107,7 +107,7 @@ class SS_Report extends ViewableData {
*/ */
function sourceQuery($params) { function sourceQuery($params) {
if($this->hasMethod('sourceRecords')) { if($this->hasMethod('sourceRecords')) {
$query = new SSReport_FakeQuery($this, 'sourceRecords', $params); $query = new SS_Report_FakeQuery($this, 'sourceRecords', $params);
$query->setSortColumnMethod('sortColumns'); $query->setSortColumnMethod('sortColumns');
return $query; return $query;
} else { } else {
@ -163,7 +163,7 @@ class SS_Report extends ViewableData {
* data objects. * data objects.
* *
* @uses getReportField() to render a table, or similar field for the report. This * @uses getReportField() to render a table, or similar field for the report. This
* method should be defined on the SSReport subclasses. * method should be defined on the SS_Report subclasses.
* *
* @return FieldSet * @return FieldSet
*/ */
@ -296,8 +296,8 @@ class SS_Report extends ViewableData {
* The default value is zero. * The default value is zero.
*/ */
static function register($list, $reportClass, $priority = 0) { static function register($list, $reportClass, $priority = 0) {
if(strpos($reportClass, '(') === false && (!class_exists($reportClass) || !is_subclass_of($reportClass,'SSReport'))) { if(strpos($reportClass, '(') === false && (!class_exists($reportClass) || !is_subclass_of($reportClass,'SS_Report'))) {
user_error("SSReport::register(): '$reportClass' is not a subclass of SSReport", E_USER_WARNING); user_error("SS_Report::register(): '$reportClass' is not a subclass of SS_Report", E_USER_WARNING);
return; return;
} }
@ -312,8 +312,8 @@ class SS_Report extends ViewableData {
} }
/** /**
* Return the SSReport objects making up the given list. * Return the SS_Report objects making up the given list.
* @return An array of SSReport objects * @return An array of SS_Report objects
*/ */
static function get_reports($list) { static function get_reports($list) {
$output = array(); $output = array();
@ -349,17 +349,17 @@ class SS_Report extends ViewableData {
* Use it like this: * Use it like this:
* *
* function sourceQuery($params) { * function sourceQuery($params) {
* return new SSReport_FakeQuery($this, 'sourceRecords', $params) * return new SS_Report_FakeQuery($this, 'sourceRecords', $params)
* } * }
* function sourceRecords($params, $sort, $limit) { * function sourceRecords($params, $sort, $limit) {
* // Do some stuff * // Do some stuff
* // Return a DataObjectSet of actual objects. * // Return a DataObjectSet of actual objects.
* } * }
* *
* This object is used by the default implementation of sourceQuery() on SSReport, to make use of * This object is used by the default implementation of sourceQuery() on SS_Report, to make use of
* a sourceReords() method if one exists. * a sourceReords() method if one exists.
*/ */
class SSReport_FakeQuery extends SQLQuery { class SS_Report_FakeQuery extends SQLQuery {
public $orderby; public $orderby;
public $limit; public $limit;
@ -410,20 +410,20 @@ class SSReport_FakeQuery extends SQLQuery {
} }
/** /**
* SSReportWrapper is a base class for creating report wappers. * SS_ReportWrapper is a base class for creating report wappers.
* *
* Wrappers encapsulate an existing report to alter their behaviour - they are implementations of * Wrappers encapsulate an existing report to alter their behaviour - they are implementations of
* the standard GoF decorator pattern. * the standard GoF decorator pattern.
* *
* This base class ensure that, by default, wrappers behave in the same way as the report that is * This base class ensure that, by default, wrappers behave in the same way as the report that is
* being wrapped. You should override any methods that need to behave differently in your subclass * being wrapped. You should override any methods that need to behave differently in your subclass
* of SSReportWrapper. * of SS_ReportWrapper.
* *
* It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and * It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and
* {@link afterQuery()} * {@link afterQuery()}
*/ */
abstract class SSReportWrapper extends SSReport { abstract class SS_ReportWrapper extends SS_Report {
protected $baseReport; protected $baseReport;
function __construct($baseReport) { function __construct($baseReport) {

View File

@ -74,7 +74,7 @@ class ReportAdmin extends LeftAndMain {
/** /**
* Get the current report * Get the current report
* *
* @return SSReport * @return SS_Report
*/ */
public function CurrentReport() { public function CurrentReport() {
$id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentReport'); $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentReport');

View File

@ -102,7 +102,7 @@ class SideReportView extends ViewableData {
* *
* This report wrapper will use sideReportColumns() for the report columns, instead of columns(). * This report wrapper will use sideReportColumns() for the report columns, instead of columns().
*/ */
class SideReportWrapper extends SSReportWrapper { class SideReportWrapper extends SS_ReportWrapper {
function columns() { function columns() {
if($this->baseReport->hasMethod('sideReportColumns')) { if($this->baseReport->hasMethod('sideReportColumns')) {
return $this->baseReport->sideReportColumns(); return $this->baseReport->sideReportColumns();
@ -174,10 +174,6 @@ class SideReport_RecentlyEdited extends SS_Report {
} }
} }
/**
* @package cms
* @subpackage content
*/
class SideReport_ToDo extends SS_Report { class SideReport_ToDo extends SS_Report {
function title() { function title() {
return _t('SideReport.TODO',"Pages with To Do items"); return _t('SideReport.TODO',"Pages with To Do items");
@ -188,17 +184,17 @@ class SideReport_ToDo extends SS_Report {
function sort() { function sort() {
return 0; return 0;
} }
function records($params = null) { function sourceRecords($params = null) {
return DataObject::get("SiteTree", "\"SiteTree\".\"ToDo\" IS NOT NULL AND \"SiteTree\".\"ToDo\" <> ''", "\"SiteTree\".\"LastEdited\" DESC"); return DataObject::get("SiteTree", "\"SiteTree\".\"ToDo\" IS NOT NULL AND \"SiteTree\".\"ToDo\" <> ''", "\"SiteTree\".\"LastEdited\" DESC");
} }
function fieldsToShow() { function columns() {
return array( return array(
"Title" => array( "Title" => array(
"source" => array("NestedTitle", array("2")), "title" => "Title", // todo: use NestedTitle(2)
"link" => true, "link" => true,
), ),
"ToDo" => array( "ToDo" => array(
"source" => "ToDo", "title" => "ToDo",
"newline" => true, "newline" => true,
), ),
); );