public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName(array('SortOrder', 'Pic', 'UID'));
     $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('Visible', _t('FacebookPost.VISIBLE', 'Is visible?')), DatetimeField_Readonly::create('Date', _t('FacebookPost.DATE', 'Posted on')), NumericField_Readonly::create('Likes', _t('FacebookPost.LIKES', 'Likes')), HtmlEditorField::create('Message', _t('FacebookPost.MESSAGE', 'Text'))->setRows(10)));
     return $fields;
 }
コード例 #2
0
 private function Fields()
 {
     return FieldList::create(TextField::create('Title'), TextField::create('Subtitle'), CheckboxField::create("IsTrue"), CheckboxSetField::create('CheckboxSet', 'Options', array('Opt1' => 'Opt1', 'Opt2' => 'Opt2', 'Opt3' => 'Opt3', 'Opt4' => 'Opt4', 'Opt5' => 'Opt5')), DropdownField::create('DDP', 'Choose an item', array('ITEM1' => 'Item 1', 'ITEM2' => 'Item 2', 'ITEM3' => 'Item 3', 'ITEM4' => 'Item 4', 'ITEM5' => 'Item 5'))->setEmptyString('(Select one)'), GroupedDropdownField::create('DDP2', 'Choose an item', array('Group1' => array('ITEM1' => 'Item 1', 'ITEM2' => 'Item 2', 'ITEM3' => 'Item 3', 'ITEM4' => 'Item 4', 'ITEM5' => 'Item 5'), 'Group2' => array('ITEM6' => 'Item 6', 'ITEM7' => 'Item 7', 'ITEM8' => 'Item 8', 'ITEM9' => 'Item 9', 'ITEM0' => 'Item 0')))->setEmptyString('(Select one)'), ListboxField::create('lbf', 'Choose items', array('ITEM1' => 'Item 1', 'ITEM2' => 'Item 2', 'ITEM3' => 'Item 3', 'ITEM4' => 'Item 4', 'ITEM5' => 'Item 5'), 'ITEM3'), LookupField::create('lf', 'Look up field', array('ITEM1' => 'Item 1', 'ITEM2' => 'Item 2', 'ITEM3' => 'Item 3', 'ITEM4' => 'Item 4', 'ITEM5' => 'Item 5'), 'ITEM3')->setEmptyString('(Select one)'), NullableField::create(TextField::create("nf", "Field 1", "abc")), NullableField::create(CheckBoxField::create("nf2", "Field 1", "abc")), NumericField::create("nf3", "NumericField", 10), NumericField_Readonly::create('NFR1', 'NumericField_Readonly'), OptionsetField::create($name = "op", $title = "OptionsetField", $source = array("1" => "Option 1", "2" => "Option 2", "3" => "Option 3", "4" => "Option 4", "5" => "Option 5"), $value = "3"), ReadonlyField::create('rf1', 'read only field', 'value'), TextareaField::create($name = "description", $title = "Description", $value = "This is the default description"), DateField::create('datefield', 'Date Field')->setConfig('showcalendar', true), TimeField::create('timeField', 'Time Field', '12am'));
 }