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
This commit is contained in:
Sam Minnee 2009-05-06 00:13:52 +00:00
parent 5f8839b6d8
commit b2aa86140a
2 changed files with 6 additions and 8 deletions

View File

@ -36,7 +36,7 @@ abstract class ModelAdmin extends LeftAndMain {
* *
* @var array|string * @var array|string
*/ */
protected static $managed_models = null; public static $managed_models = null;
/** /**
* More actions are dynamically added in {@link defineMethods()} below. * 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 * @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 * @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 * Forward control to the default action handler
@ -87,14 +87,14 @@ abstract class ModelAdmin extends LeftAndMain {
* *
* @var array * @var array
*/ */
protected static $model_importers = null; public static $model_importers = null;
/** /**
* Amount of results showing on a single page. * Amount of results showing on a single page.
* *
* @var int * @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 * Class name of the form field used for the results list. Overloading this in subclasses

View File

@ -7,8 +7,6 @@ class ModelAdminTest extends FunctionalTest {
$this->autoFollowRedirection = false; $this->autoFollowRedirection = false;
$this->logInAs('admin'); $this->logInAs('admin');
$this->assertTrue((bool)Permission::check("ADMIN")); $this->assertTrue((bool)Permission::check("ADMIN"));
Debug::message($this->get('ModelAdminTest_Admin')->getBody());
$this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode()); $this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode());
} }
} }
@ -16,7 +14,7 @@ class ModelAdminTest extends FunctionalTest {
class ModelAdminTest_Admin extends ModelAdmin { class ModelAdminTest_Admin extends ModelAdmin {
static $url_segment = 'testadmin'; static $url_segment = 'testadmin';
protected static $managed_models = array( public static $managed_models = array(
'ModelAdminTest_Contact', 'ModelAdminTest_Contact',
); );
} }