public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     $conf = GridFieldConfig_RelationEditor::create(10);
     $conf->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab($tab, new GridField('ExampleLoopingItems', 'Items', $this->ExampleLoopingItems(), $conf));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     $field = new UploadField('Image');
     $field->setAllowedMaxFileNumber(1);
     $field->getValidator()->setAllowedMaxFileSize(4 * 1024 * 1024);
     $field->setFolderName('Uploads/10-image-setwidth/');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     $field = new TextField('FirstName');
     $fields->addFieldToTab($tab, $field);
     $field = new TextField('LastName');
     $fields->addFieldToTab($tab, $field);
     $field = new TextField('Greeting');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('ActiveItemID');
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     // only need this field if there are items to choose from
     if (count($this->ExampleDataModelItems()) > 0) {
         $field = new DropdownField('ActiveItemID', 'Active Item');
         $field->setSource($this->ExampleDataModelItems()->map('ID', 'FirstName')->toArray());
         $field->setEmptyString('Select one');
         $fields->addFieldToTab($tab, $field);
     }
     $conf = GridFieldConfig_RelationEditor::create(10);
     $fields->addFieldToTab($tab, new GridField('ExampleDataModel', 'DataModels', $this->ExampleDataModelItems(), $conf));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     // VARIABLE
     $tab = 'Root.Examples.Variable';
     $field = new TextField('ExampleVariableTitle');
     $fields->addFieldToTab($tab, $field);
     $field = new HTMLEditorField('ExampleVariablePrompt');
     $fields->addFieldToTab($tab, $field);
     $field = new TextField('ExampleVariable');
     $fields->addFieldToTab($tab, $field);
     // IF
     $tab = 'Root.Examples.IfCondition';
     $field = new TextField('ExampleIfConditionTitle');
     $fields->addFieldToTab($tab, $field);
     $field = new HTMLEditorField('ExampleIfConditionPrompt');
     $fields->addFieldToTab($tab, $field);
     $field = new CheckboxField('ExampleIfConditionToggle');
     $fields->addFieldToTab($tab, $field);
     $field = new TextareaField('ExampleIfConditionContent');
     $fields->addFieldToTab($tab, $field);
     // IF/ELSE
     $tab = 'Root.Examples.IfElseCondition';
     $field = new TextField('ExampleIfElseConditionTitle');
     $fields->addFieldToTab($tab, $field);
     $field = new HTMLEditorField('ExampleIfElseConditionPrompt');
     $fields->addFieldToTab($tab, $field);
     $field = new CheckboxField('ExampleIfElseConditionToggle');
     $fields->addFieldToTab($tab, $field);
     $field = new TextareaField('ExampleIfElseConditionToggleTrueContent');
     $fields->addFieldToTab($tab, $field);
     $field = new TextareaField('ExampleIfElseConditionToggleFalseContent');
     $fields->addFieldToTab($tab, $field);
     // Looping
     $tab = 'Root.Examples.Looping';
     $field = new TextField('ExampleLoopingTitle');
     $fields->addFieldToTab($tab, $field);
     $field = new HTMLEditorField('ExampleLoopingPrompt');
     $fields->addFieldToTab($tab, $field);
     $conf = GridFieldConfig_RelationEditor::create(10);
     $conf->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab($tab, new GridField('ExampleLoopingItems', 'Items', $this->ExampleLoopingItems(), $conf));
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     // only need this field if there are items to choose from
     if (count($this->Directives()) > 0) {
         $field = new DropdownField('ActiveDirectiveID', 'Active Directive');
         $field->setSource($this->Directives()->map('ID', 'Name')->toArray());
         $field->setEmptyString('Select one');
         $fields->addFieldToTab($tab, $field);
     }
     $conf = GridFieldConfig_RelationEditor::create(10);
     $conf->removeComponentsByType('GridFieldAddNewButton');
     $conf->addComponent(new GridFieldDeleteAction());
     $conf->addComponent(new GridFieldAddNewMultiClass());
     $conf->getComponentByType('GridFieldAddNewMultiClass')->setClasses($this->getAvailableDirectiveClasses());
     $conf->removeComponentsByType('GridFieldPaginator');
     $conf->removeComponentsByType('GridFieldPageCount');
     $field = new GridField('AngularDirective', 'Directives', $this->Directives(), $conf);
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $tab = 'Root.Main';
     $tab = 'Root.Examples';
     $tab = 'Root.Examples.Color';
     $field = new HtmlEditorField('ColorPrompt');
     $fields->addFieldToTab($tab, $field);
     $data = DataObject::get('Color');
     $field = new DropdownField('MyColorID', 'My Color');
     $field->setSource($data->map('ID', 'Name')->toArray());
     $field->setEmptyString('Select one');
     $fields->addFieldToTab($tab, $field);
     $tab = 'Root.Examples.Icon';
     $field = new HtmlEditorField('IconPrompt');
     $fields->addFieldToTab($tab, $field);
     $data = DataObject::get('Icon');
     $field = new DropdownField('MyIconID', 'My Icon');
     $field->setSource($data->map('ID', 'Name')->toArray());
     $field->setEmptyString('Select one');
     $fields->addFieldToTab($tab, $field);
     return $fields;
 }