mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Added more relation editing fields to frameworktest
This commit is contained in:
parent
08c22fbbf2
commit
660fd19a49
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
class RelationFieldsTestPage extends TestPage {
|
||||
static $has_one = array(
|
||||
"FavouriteItem" => "TestCTFItem",
|
||||
);
|
||||
static $has_many = array(
|
||||
"Items" => "TestCTFItem",
|
||||
);
|
||||
static $many_many = array(
|
||||
"CheckboxSet" => "TestCategory",
|
||||
);
|
||||
static $has_may = array(
|
||||
"Items" => "TestCTFItem",
|
||||
);
|
||||
|
||||
function getCMSFields() {
|
||||
$fields = parent::getCMSFields();
|
||||
@ -14,10 +17,27 @@ class RelationFieldsTestPage extends TestPage {
|
||||
$fields->addFieldToTab("Root.Content.CheckboxSet",
|
||||
new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
||||
|
||||
/*
|
||||
$fields->addFieldToTab("Root.Content.ComplexTableField",
|
||||
new ComplexTableField($this, "Items", "TestCTFItem", array(
|
||||
"Title" => "Item Title",
|
||||
"Author" => "Item Author")));
|
||||
*/
|
||||
|
||||
$fields->addFieldToTab("Root.Content.HasOneComplexTableField",
|
||||
new HasOneComplexTableField($this, "FavouriteItem", "TestCTFItem", array(
|
||||
"Title" => "Item Title",
|
||||
"Author" => "Item Author")));
|
||||
|
||||
$fields->addFieldToTab("Root.Content.HasManyComplexTableField",
|
||||
new HasManyComplexTableField($this, "Items", "TestCTFItem", array(
|
||||
"Title" => "Item Title",
|
||||
"Author" => "Item Author")));
|
||||
|
||||
$fields->addFieldToTab("Root.Content.ManyManyComplexTableField",
|
||||
new ManyManyComplexTableField($this, "CheckboxSet", "TestCategory", array(
|
||||
"Title" => "Item Title")));
|
||||
|
||||
|
||||
// $fields->addFieldToTab("Root.Tests.ComplexTableField",
|
||||
// new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
||||
|
Loading…
Reference in New Issue
Block a user