From b2aa86140a67dc9cf6ea928e94e7f57279d3ecc5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 6 May 2009 00:13:52 +0000 Subject: [PATCH] API CHANGE: Made ModelAdmin's configuration statics public rather than protected, so that they can be accessed with Object::get_static() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@76124 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ModelAdmin.php | 10 +++++----- tests/ModelAdminTest.php | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index 7f8284b6..ee0ccf9e 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -36,7 +36,7 @@ abstract class ModelAdmin extends LeftAndMain { * * @var array|string */ - protected static $managed_models = null; + public static $managed_models = null; /** * More actions are dynamically added in {@link defineMethods()} below. @@ -55,12 +55,12 @@ abstract class ModelAdmin extends LeftAndMain { /** * @param string $collection_controller_class Override for controller class */ - protected static $collection_controller_class = "ModelAdmin_CollectionController"; + public static $collection_controller_class = "ModelAdmin_CollectionController"; /** * @param string $collection_controller_class Override for controller class */ - protected static $record_controller_class = "ModelAdmin_RecordController"; + public static $record_controller_class = "ModelAdmin_RecordController"; /** * Forward control to the default action handler @@ -87,14 +87,14 @@ abstract class ModelAdmin extends LeftAndMain { * * @var array */ - protected static $model_importers = null; + public static $model_importers = null; /** * Amount of results showing on a single page. * * @var int */ - protected static $page_length = 30; + public static $page_length = 30; /** * Class name of the form field used for the results list. Overloading this in subclasses diff --git a/tests/ModelAdminTest.php b/tests/ModelAdminTest.php index a5ae5252..91990bc3 100644 --- a/tests/ModelAdminTest.php +++ b/tests/ModelAdminTest.php @@ -7,8 +7,6 @@ class ModelAdminTest extends FunctionalTest { $this->autoFollowRedirection = false; $this->logInAs('admin'); $this->assertTrue((bool)Permission::check("ADMIN")); - - Debug::message($this->get('ModelAdminTest_Admin')->getBody()); $this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode()); } } @@ -16,7 +14,7 @@ class ModelAdminTest extends FunctionalTest { class ModelAdminTest_Admin extends ModelAdmin { static $url_segment = 'testadmin'; - protected static $managed_models = array( + public static $managed_models = array( 'ModelAdminTest_Contact', ); }