2008-10-03 00:05:45 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RelationFieldsTestPage extends TestPage {
|
2009-01-30 06:01:28 +01:00
|
|
|
static $has_one = array(
|
|
|
|
"FavouriteItem" => "TestCTFItem",
|
2008-10-03 00:05:45 +02:00
|
|
|
);
|
2009-01-30 06:01:28 +01:00
|
|
|
static $has_many = array(
|
2008-10-03 00:05:45 +02:00
|
|
|
"Items" => "TestCTFItem",
|
|
|
|
);
|
2009-01-30 06:01:28 +01:00
|
|
|
static $many_many = array(
|
|
|
|
"CheckboxSet" => "TestCategory",
|
|
|
|
);
|
2008-10-03 00:05:45 +02:00
|
|
|
|
|
|
|
function getCMSFields() {
|
|
|
|
$fields = parent::getCMSFields();
|
|
|
|
|
2009-05-15 06:05:09 +02:00
|
|
|
$fields->addFieldToTab("Root.Content.CheckboxSet",
|
2008-10-03 00:05:45 +02:00
|
|
|
new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
|
2009-01-30 06:01:28 +01:00
|
|
|
/*
|
2008-10-03 00:05:45 +02:00
|
|
|
$fields->addFieldToTab("Root.Content.ComplexTableField",
|
|
|
|
new ComplexTableField($this, "Items", "TestCTFItem", array(
|
|
|
|
"Title" => "Item Title",
|
|
|
|
"Author" => "Item Author")));
|
2009-01-30 06:01:28 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
$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")));
|
|
|
|
|
2008-10-03 00:05:45 +02:00
|
|
|
|
|
|
|
// $fields->addFieldToTab("Root.Tests.ComplexTableField",
|
|
|
|
// new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
// $fields->addFieldToTab("Root.Tests.CheckboxSet", new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class RelationFieldsTestPage_Controller extends TestPage_Controller {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|