当前位置: 首页>>代码示例>>PHP>>正文


PHP GridFieldConfig_RecordEditor::addComponent方法代码示例

本文整理汇总了PHP中GridFieldConfig_RecordEditor::addComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP GridFieldConfig_RecordEditor::addComponent方法的具体用法?PHP GridFieldConfig_RecordEditor::addComponent怎么用?PHP GridFieldConfig_RecordEditor::addComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridFieldConfig_RecordEditor的用法示例。


在下文中一共展示了GridFieldConfig_RecordEditor::addComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     foreach (['primary', 'secondary'] as $lower) {
         $upper = ucfirst($lower);
         $config = $this->owner->config()->get("{$lower}_gallery");
         if (is_null($config) || isset($config['enabled']) && $config['enabled'] === false) {
             continue;
         }
         $config['title'] = isset($config['title']) ? $config['title'] : "{$upper} Gallery";
         $config['folder'] = isset($config['folder']) ? $config['folder'] : "{$upper}-Gallery-Images";
         $GridFieldConfig = new GridFieldConfig_RecordEditor();
         $GridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
         $GridFieldConfig->addComponent($bulkUploadConfig = new GridFieldBulkUpload());
         $GridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
         $GridFieldConfig->addComponent(new GridFieldGalleryTheme('Image'));
         $bulkUploadConfig->setUfSetup('setFolderName', "Images/{$config['folder']}");
         $GridField = new GridField("{$upper}GalleryGridField", $config['title'], $this->owner->{"{$upper}GalleryImages"}(), $GridFieldConfig);
         /** @var TabSet $rootTab */
         //We need to repush Metadata to ensure it is the last tab
         $rootTab = $fields->fieldByName('Root');
         $rootTab->push($tab = Tab::create("{$upper}Gallery"));
         if ($rootTab->fieldByName('Metadata')) {
             $metaChildren = $rootTab->fieldByName('Metadata')->getChildren();
             $rootTab->removeByName('Metadata');
             $rootTab->push(Tab::create('Metadata')->setChildren($metaChildren));
         }
         $tab->setTitle($config['title']);
         $fields->addFieldToTab("Root.{$upper}Gallery", $GridField);
     }
 }
开发者ID:helpfulrobot,项目名称:webfox-silverstripe-gallery,代码行数:30,代码来源:GalleryExtension.php

示例2: __construct

 public function __construct($name, $title = null, SS_List $dataList = null)
 {
     parent::__construct($name, $title, $dataList);
     $config = new GridFieldConfig_RecordEditor();
     $config->removeComponentsByType('GridFieldDeleteAction');
     $config->removeComponentsByType('GridFieldDetailForm');
     $config->addComponent(new PageHolderGridFieldDetailForm());
     $config->addComponent(new GridFieldPageHistoryButton(), 'GridFieldPageCount');
     $this->setConfig($config);
 }
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-pageholder,代码行数:10,代码来源:PageHolderGridField.php

示例3: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $badge = new UploadField('Badge', _t('ScoutGroup.BADGE', 'Badge'));
     $badge->setFolderName('group/badge');
     $badge->setRightTitle(_t('ScoutGroup.BADGE_HELP', 'The badge/logo/emblem of the Group'))->addExtraClass('help');
     $fields->addFieldToTab('Root.Info', $badge);
     $necker = new UploadField('Necker', _t('ScoutGroup.NECKER', 'Necker'));
     $necker->setFolderName('group/necker');
     $necker->setRightTitle(_t('ScoutGroup.NECKER_HELP', 'The neckerchief the Group'))->addExtraClass('help');
     $fields->addFieldToTab('Root.Info', $necker);
     $fields->addFieldToTab('Root.Info', new TextField('NeckerDescription', _t('ScoutGroup.NECKERDESCRIPTION', 'Neckerchief Description')));
     $fields->addFieldToTab('Root.Social', new TextField('TwitterUser', _t('ScoutGroup.TWITTERUSER', 'Twitter User')));
     $fields->addFieldToTab('Root.Social', new TextField('FacebookPage', _t('ScoutGroup.FACEBOOKPAGE', 'Facebook Page')));
     $fields->addFieldToTab('Root.Social', new TextField('GooglePage', _t('ScoutGroup.GOOGLEPAGE', 'Google Page')));
     $fields->addFieldToTab('Root.Contact', new TextField('Address1', _t('ScoutGroup.ADDRESS1', 'Address 1')));
     $fields->addFieldToTab('Root.Contact', new TextField('Address2', _t('ScoutGroup.ADDRESS2', 'Address 2')));
     $fields->addFieldToTab('Root.Contact', new TextField('Address3', _t('ScoutGroup.ADDRESS3', 'Address 3')));
     $fields->addFieldToTab('Root.Contact', new TextField('Town', _t('ScoutGroup.TOWN', 'Town')));
     $fields->addFieldToTab('Root.Contact', new TextField('Postcode', _t('ScoutGroup.POSTCODE', 'Post Code')));
     $fields->addFieldToTab('Root.Contact', new TextField('Phone', _t('ScoutGroup.PHONE', 'Phone #')));
     $fields->addFieldToTab('Root.Contact', new TextField('Email', _t('ScoutGroup.EMAIL', 'Email Address')));
     $fields->addFieldToTab('Root.Contact', new TextField('CharityNumber', _t('ScoutGroup.CHARITYNUMBER', 'CharityNumber')));
     $sectionGridConfig = new GridFieldConfig_RecordEditor();
     $sectionGridConfig->addComponent(new GridFieldSortableRows('SortOrder'));
     $sectionGrid = new GridField('Sections', 'Sections', $this->Sections(), $sectionGridConfig);
     $fields->addFieldToTab('Root.Sections', $sectionGrid);
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:phpboyscout-silverstripe-scouts,代码行数:30,代码来源:ScoutGroup.php

示例4: updateCMSFields

 /**
  * @param FieldList $fields
  * @return FieldList|void
  */
 public function updateCMSFields(FieldList $fields)
 {
     $oldFields = $fields->toArray();
     foreach ($oldFields as $field) {
         $fields->remove($field);
     }
     $fields->push(new TextField("Title", "Title"));
     $fields->push(new HtmlEditorField("Summary", "Summary"));
     $fields->push(new HtmlEditorField("Description", "Description"));
     $fields->push(new MemberAutoCompleteField("Curator", "Curator"));
     $fields->push($ddl = new DropdownField('ReleaseID', 'Release', OpenStackRelease::get()->map("ID", "Name")));
     $ddl->setEmptyString('-- Select a Release --');
     if ($this->owner->ID > 0) {
         $components_config = new GridFieldConfig_RelationEditor(100);
         $components = new GridField("OpenStackComponents", "Supported Release Components", $this->owner->OpenStackComponents(), $components_config);
         $components_config->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchList($this->getAllowedComponents());
         $components_config->removeComponentsByType('GridFieldAddNewButton');
         //$components_config->addComponent(new GridFieldSortableRows('OpenStackSampleConfig_OpenStackComponents.Order'));
         $fields->push($components);
         $fields->push($ddl = new DropdownField('TypeID', 'Type', OpenStackSampleConfigurationType::get()->filter('ReleaseID', $this->owner->ReleaseID)->map("ID", "Type")));
         $ddl->setEmptyString('-- Select a Configuration Type --');
         $related_notes_config = new GridFieldConfig_RecordEditor(100);
         $related_notes = new GridField("RelatedNotes", "Related Notes", $this->owner->RelatedNotes(), $related_notes_config);
         $related_notes_config->addComponent(new GridFieldSortableRows('Order'));
         $fields->push($related_notes);
     }
     return $fields;
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:32,代码来源:OpenStackSampleConfigAdminUI.php

示例5: updateCMSFields

 /**
  * @param FieldList $fields
  * @return FieldList|void
  */
 public function updateCMSFields(FieldList $fields)
 {
     $oldFields = $fields->toArray();
     foreach ($oldFields as $field) {
         $fields->remove($field);
     }
     $fields->push(new LiteralField("Title", "<h2>OpenStack Component</h2>"));
     $fields->push(new TextField("Name", "Name"));
     $fields->push(new TextField("CodeName", "Code Name"));
     $fields->push(new TextField("Description", "Description"));
     $fields->push(new CheckboxField('SupportsVersioning', 'Supports Versioning?'));
     $fields->push(new CheckboxField('SupportsExtensions', 'Supports Extensions?'));
     $fields->push(new CheckboxField('IsCoreService', 'Is Core Service?'));
     $fields->push(new DropdownField('IconClass', 'Font Awesome Icon CSS Class', $this->owner->dbObject('IconClass')->enumValues()));
     $fields->push(new DropdownField('Use', 'OpenStack Usage', $this->owner->dbObject('Use')->enumValues()));
     if ($this->owner->getSupportsVersioning()) {
         $versions_config = new GridFieldConfig_RecordEditor();
         $versions = new GridField("Versions", "Versions", $this->owner->Versions(), $versions_config);
         $fields->push($versions);
     }
     $config = new GridFieldConfig_RecordEditor();
     $config->addComponent(new GridFieldSortableRows('Order'));
     $related_content = new GridField("RelatedContent", "RelatedContent", $this->owner->RelatedContent(), $config);
     $fields->push($related_content);
     return $fields;
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:30,代码来源:OpenStackComponentAdminUI.php

示例6: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->fieldByName('Root')->removeByName("DistanceFares");
     if ($this->isInDB()) {
         $fields->addFieldToTab("Root.Main", $gridfield = GridField::create("DistanceFares", "Fares", $this->DistanceFares(), $config = new GridFieldConfig_RecordEditor()));
         $config->removeComponentsByType("GridFieldDataColumns");
         $config->removeComponentsByType("GridFieldEditButton");
         $config->removeComponentsByType("GridFieldDeleteAction");
         $config->removeComponentsByType("GridFieldAddNewButton");
         $config->addComponent($cols = new GridFieldEditableColumns());
         $config->addComponent(new GridFieldDeleteAction());
         $config->addComponent($addnew = new GridFieldAddNewInlineButton());
         $addnew->setTitle($addnew->getTitle() . " Fare");
         if ($greatest = $this->greatestCostDistance()) {
             $fields->insertAfter(LiteralField::create("costnote", "<p class=\"message\">Distances beyond the greatest specified distance will be cost " . $this->greatestCostDistance()->dbObject("Cost")->Nice() . " (the most expensive fare)</p>"), "DistanceFares");
         }
     }
     return $fields;
 }
开发者ID:burnbright,项目名称:silverstripe-shop-shipping,代码行数:20,代码来源:DistanceShippingMethod.php

示例7: updateCMSFields

 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     $items = $this->owner->FeaturedItems();
     $gridCfg = new GridFieldConfig_RecordEditor(1000);
     // we use RecordEditor instead of RelationEditor so it deletes instead of unlinks
     if (class_exists('GridFieldOrderableRows') && !$items instanceof UnsavedRelationList) {
         $gridCfg->addComponent(new GridFieldOrderableRows('Sort'));
     }
     $grid = new GridField('FeaturedItems', 'Featured Items', $items, $gridCfg);
     $fields->addFieldToTab('Root.FeaturedItems', $grid);
 }
开发者ID:markguinn,项目名称:silverstripe-featureditems,代码行数:14,代码来源:HasFeaturedItems.php

示例8: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertBefore(new Tab('GetInvolved'), 'Settings');
     $fields->insertBefore(new Tab('Events'), 'Settings');
     $fields->insertBefore(new Tab('Collateral'), 'Settings');
     $fields->insertBefore(new Tab('Software'), 'Settings');
     $fields->insertBefore(new Tab('Graphics'), 'Settings');
     $fields->insertBefore(new Tab('Promote'), 'Settings');
     // header
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', new TextField('HeaderTitle', 'Header Title'));
     $fields->addFieldToTab('Root.Main', new HtmlEditorField('HeaderText', 'Header Text'));
     // Get Involved
     $fields->addFieldToTab('Root.GetInvolved', $involved_images = new UploadField('InvolvedImages', 'Involved Images'));
     $involved_images->setFolderName('marketing');
     $fields->addFieldToTab('Root.GetInvolved', new HtmlEditorField('InvolvedText', 'Involved Text', $this->InvolvedText));
     // Events
     $fields->addFieldToTab('Root.Events', new HtmlEditorField('EventsIntroText', 'Events Intro Text', $this->EventsIntroText));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Events', new GridField('SponsorEvents', 'SponsorEvents', $this->SponsorEvents(), $config));
     // Collateral
     $fields->addFieldToTab('Root.Collateral', new HtmlEditorField('CollateralIntroText', 'Collateral Intro Text', $this->CollateralIntroText));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Collateral', new GridField('Collaterals', 'Collaterals', $this->Collaterals(), $config));
     // Software
     $fields->addFieldToTab('Root.Software', new HtmlEditorField('SoftwareIntroText', 'Software Intro Text', $this->SoftwareIntroText));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Software', new GridField('Software', 'Software', $this->Software(), $config));
     // Graphics
     $fields->addFieldToTab('Root.Graphics', new HtmlEditorField('GraphicsIntroText', 'Graphics Intro Text', $this->GraphicsIntroText));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Graphics', new GridField('Stickers', 'Stickers', $this->Stickers(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Graphics', new GridField('TShirts', 'TShirts', $this->TShirts(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Graphics', new GridField('Banners', 'Banners', $this->Banners(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Graphics', new GridField('Videos', 'Videos', $this->Videos(), $config));
     // Promote
     $fields->addFieldToTab('Root.Promote', $about_desc = new HtmlEditorField('PromoteProductIntroText', 'Promote Intro Text', $this->PromoteProductIntroText));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Promote', new GridField('PromoteEvents', 'PromoteEvents', $this->PromoteEvents(), $config));
     return $fields;
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:53,代码来源:MarketingPage.php

示例9: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Content');
     $fields->addFieldsToTab('Root.Main', new TextField('IntroTitle', 'Intro Title'));
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('IntroText', 'Intro Text'));
     $fields->addFieldsToTab('Root.Main', new TextField('IntroTitle2', 'Intro Title 2'));
     $fields->addFieldsToTab('Root.Main', new HtmlEditorField('IntroText2', 'Intro Text 2'));
     $config = new GridFieldConfig_RecordEditor(100);
     $sub_menu = new GridField("SubMenuPages", "SubMenu Pages", $this->SubMenuPages(), $config);
     $config->addComponent(new GridFieldSortableRows('Order'));
     $fields->push($sub_menu);
     return $fields;
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:14,代码来源:SoftwareHomePage.php

示例10: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertBefore(new Tab('About'), 'Settings');
     $fields->insertBefore(new Tab('Host'), 'Settings');
     // header
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', $uploadField = new UploadField('HeaderPics', 'Header Pictures'));
     $uploadField->setAllowedMaxFileNumber(10);
     $uploadField->setFolderName('openstackdays');
     // About
     $fields->addFieldToTab('Root.About', $about_desc = new HtmlEditorField('AboutDescription', 'Intro Text', $this->AboutDescription));
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.About', new GridField('AboutVideos', 'Videos', $this->AboutVideos(), $config));
     // Host
     $fields->addFieldToTab('Root.Host', $host_intro = new HtmlEditorField('HostIntro', 'Intro Text', $this->HostIntro));
     $fields->addFieldToTab('Root.Host', $host_faq = new HtmlEditorField('HostFAQs', 'FAQs', $this->HostFAQs));
     $fields->addFieldToTab('Root.Host', $toolkit_text = new HtmlEditorField('ToolkitDesc', 'Toolkit Text', $this->ToolkitDesc));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('OfficialGuidelines', 'Official Guidelines', $this->OfficialGuidelines(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('PlanningTools', 'Planning Tools', $this->PlanningTools(), $config));
     $fields->addFieldToTab('Root.Host', $artwork_intro = new HtmlEditorField('ArtworkIntro', 'Artwork intro text', $this->ArtworkIntro));
     $artwork_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Artwork', 'Artwork', $this->Artwork(), $config));
     $fields->addFieldToTab('Root.Host', $collateral_intro = new HtmlEditorField('CollateralIntro', 'Collateral intro text', $this->CollateralIntro));
     $collateral_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Collaterals', 'Video / Presentations / Collateral', $this->Collaterals(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Media', 'PR / Media', $this->Media(), $config));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:42,代码来源:OpenStackDaysPage.php

示例11: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     /** @var TabSet $rootTab */
     //We need to repush Metadata to ensure it is the last tab
     $rootTab = $fields->fieldByName('Root');
     $rootTab->push($documentsTab = Tab::create('DocumentCategories'));
     if ($rootTab->fieldByName('Metadata')) {
         $metaChildren = $rootTab->fieldByName('Metadata')->getChildren();
         $rootTab->removeByName('Metadata');
         $rootTab->push(Tab::create('Metadata')->setChildren($metaChildren));
     }
     $DocumentCategoriesConfig = new GridFieldConfig_RecordEditor();
     $DocumentCategoriesConfig->addComponent(new GridFieldSortableRows('SortOrder'));
     $DocumentCategories = new GridField("DocumentCategoriesGridField", "Document Categories", $this->owner->DocumentCategories(), $DocumentCategoriesConfig);
     $fields->addFieldToTab('Root.DocumentCategories', $DocumentCategories);
     $config = $this->owner->config()->get('page_documents');
     if (is_array($config) && isset($config['title'])) {
         $documentsTab->setTitle($config['title']);
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:webfox-silverstripe-page-documents,代码行数:21,代码来源:PageDocumentsExtension.php

示例12: getCMSFields

 public function getCMSFields($params = null)
 {
     $fields = parent::getCMSFields($params);
     //  new FieldSet();
     // tabbed or untabbed
     //		$fields->push(new TabSet("Root", $mainTab = new Tab("Main")));
     //		$mainTab->setTitle(_t('SiteTree.TABMAIN', "Main"));
     $fields->removeByName('Settings');
     $fields->addFieldToTab('Root.Main', new TextField('Title'));
     $fields->addFieldToTab('Root.Main', new TextareaField('Description'));
     if ($this->ID) {
         $config = new GridFieldConfig_RecordEditor();
         $grid = new GridField('ChildReports', 'Child reports', $this->ChildReports(), $config);
         $fields->addFieldToTab('Root.Main', $grid);
         if (class_exists('GridFieldOrderableRows')) {
             $config->addComponent(new GridFieldOrderableRows());
         }
     } else {
         $fields->addFieldToTab('Root.Main', new LiteralField('Notice', 'Please save before adding related reports'));
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:maldicore-advancedreports,代码行数:22,代码来源:CombinedReport.php

示例13: updateCMSFields

 /**
  * @param FieldList $fields
  * @return FieldList|void
  */
 public function updateCMSFields(FieldList $fields)
 {
     $oldFields = $fields->toArray();
     foreach ($oldFields as $field) {
         $fields->remove($field);
     }
     $fields->push(new LiteralField("Title", "<h2>OpenStack Release</h2>"));
     $fields->push(new TextField("Name", "Name"));
     $date = DateField::create('ReleaseDate')->setConfig('showcalendar', true);
     $fields->push($date);
     $date->setTitle('Release Date');
     $fields->push(new TextField("ReleaseNumber", "Release Number"));
     $fields->push(new TextField("ReleaseNotesUrl", "Release Notes Url"));
     $fields->push(new DropdownField('Status', 'Status', $this->owner->dbObject('Status')->enumValues()));
     //components
     if ($this->owner->ID > 0) {
         $components_config = new GridFieldConfig_RelationEditor(100);
         $components = new GridField("OpenStackComponents", "Supported Release Components", $this->owner->OpenStackComponents(), $components_config);
         $components_config->removeComponentsByType('GridFieldAddNewButton');
         $fields->push($components);
         //supported versions
         //only if we have components set
         if ($this->owner->OpenStackComponents()->filter('SupportsVersioning', true)->count() > 0) {
             $supported_versions_config = new GridFieldConfig_RecordEditor(100);
             $dataColumns = $supported_versions_config->getComponentByType('GridFieldDataColumns');
             $dataColumns->setDisplayFields(array('OpenStackComponent.CodeName' => 'Component CodeName', 'OpenStackComponent.Name' => 'Component Name', 'ApiVersion.Version' => 'Api Version'));
             //$supported_versions_config->removeComponentsByType('GridFieldEditButton');
             $supported_versions = new GridField("SupportedApiVersions", "Supported Release Components", $this->owner->SupportedApiVersions(" ReleaseID = {$this->owner->getIdentifier()} AND OpenStackComponent.SupportsVersioning = 1 ")->innerJoin('OpenStackComponent', 'OpenStackComponent.ID = OpenStackReleaseSupportedApiVersion.OpenStackComponentID'), $supported_versions_config);
             $fields->push($supported_versions);
         }
         $config = new GridFieldConfig_RecordEditor(100);
         $config_types = new GridField("SampleConfigurationTypes", "Sample Configuration Types", $this->owner->SampleConfigurationTypes(), $config);
         $config->addComponent(new GridFieldSortableRows('Order'));
         $fields->push($config_types);
     }
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:41,代码来源:OpenStackReleaseAdminUI.php

示例14: getCMSFields

 function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TextField('Name', 'Name'));
     $fields->push(new CheckboxField('ShowGlobe', 'Show Globe'));
     $fields->push($description = new HtmlEditorField('Description'));
     $description->setRows(5);
     $fields->push(new TextField('SortOrder', 'Sort Order'));
     $image = new CustomUploadField('Image', 'Image');
     $image->setFolderName('marketing');
     $image->setAllowedFileCategories('image');
     $image_validator = new Upload_Validator();
     $image_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg'));
     $image->setValidator($image_validator);
     $fields->push($image);
     $files = new UploadField('CollateralFiles', 'Files', $this->CollateralFiles());
     $files->setFolderName('marketing');
     $fields->push($files);
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->push(new GridField('CollateralLinks', 'CollateralLinks', $this->CollateralLinks(), $config));
     $fields->push(new HiddenField('ParentPageID', 'ParentPageID'));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:24,代码来源:MarketingCollateral.php

示例15: getCMSFields

 public function getCMSFields()
 {
     Requirements::customScript("\n        jQuery( document ).ready(function() {\n            jQuery('body').on('change','#Form_ItemEditForm_RSVPTemplateID',\n                function(){\n                    jQuery('#Form_ItemEditForm_action_save').click();\n                }\n            );\n        });");
     $summit_id = isset($_REQUEST['SummitID']) ? $_REQUEST['SummitID'] : $this->SummitID;
     $f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
     $f->addFieldToTab('Root.Main', new TextField('Title', 'Title'));
     $f->addFieldToTab('Root.Main', new HtmlEditorField('Description', 'Description'));
     $f->addFieldToTab('Root.Main', new HtmlEditorField('ShortDescription', 'Abstract'));
     $f->addFieldToTab('Root.Main', new TextField('HeadCount', 'HeadCount'));
     $f->tag('Tags', 'Tags', Tag::get(), $this->Tags())->configure()->setTitleField('Tag')->end();
     $f->addFieldToTab('Root.Main', new CheckboxField('AllowFeedBack', 'Is feedback allowed?'));
     $f->addFieldToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('StartDate', 'Start Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldToTab('Root.Main', $date = new DatetimeField('EndDate', 'End Date'));
     $date->getDateField()->setConfig('showcalendar', true);
     $date->setConfig('dateformat', 'dd/MM/yyyy');
     $f->addFieldsToTab('Root.Main', new ReadonlyField('AvgFeedbackRate', 'AvgFeedbackRate'));
     $locations = SummitAbstractLocation::get()->filter('SummitID', $summit_id)->filter('ClassName', array('SummitVenue', 'SummitVenueRoom', 'SummitExternalLocation'));
     $locations_source = array();
     foreach ($locations as $l) {
         $locations_source[$l->ID] = $l->getFullName();
     }
     $f->addFieldToTab('Root.Main', $ddl_location = new DropdownField('LocationID', 'Location', $locations_source));
     $ddl_location->setEmptyString('-- Select a Location --');
     $f->addFieldToTab('Root.Main', $ddl_location = new DropdownField('TypeID', 'Event Type', SummitEventType::get()->filter('SummitID', $summit_id)->map('ID', 'Type')));
     $ddl_location->setEmptyString('-- Select a Event Type --');
     $f->addFieldToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
     if ($this->ID > 0) {
         // summits types
         $config = new GridFieldConfig_RelationEditor(100);
         $config->removeComponentsByType('GridFieldEditButton');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
         $completer->setSearchList(SummitType::get()->filter('SummitID', $summit_id));
         $summit_types = new GridField('AllowedSummitTypes', 'Summit Types', $this->AllowedSummitTypes(), $config);
         $f->addFieldToTab('Root.Main', $summit_types);
         // sponsors
         $config = new GridFieldConfig_RelationEditor(100);
         $config->removeComponentsByType('GridFieldEditButton');
         $config->removeComponentsByType('GridFieldAddNewButton');
         $sponsors = new GridField('Sponsors', 'Sponsors', $this->Sponsors(), $config);
         $f->addFieldToTab('Root.Sponsors', $sponsors);
         // feedback
         $config = new GridFieldConfig_RecordEditor(100);
         $config->removeComponentsByType('GridFieldAddNewButton');
         $config->addComponent(new GridFieldAjaxRefresh(1000, false));
         $feedback = new GridField('Feedback', 'Feedback', $this->Feedback(), $config);
         $f->addFieldToTab('Root.Feedback', $feedback);
         // rsvp
         $f->addFieldsToTab('Root.RSVP', new TextField('RSVPLink', 'RSVP External Link'));
         $rsvp_template = new DropdownField('RSVPTemplateID', 'Select a Template', RSVPTemplate::get()->filter('SummitID', $summit_id)->map());
         $rsvp_template->setEmptyString('-- View All Templates --');
         $f->addFieldToTab('Root.RSVP', LiteralField::create('AddNew', 'Or add a new custom RSVP Configuration'));
         $f->addFieldToTab('Root.RSVP', $rsvp_template);
         $f->addFieldToTab('Root.RSVP', new NumericField('RSVPMaxUserNumber', 'Max # Number'));
         $f->addFieldToTab('Root.RSVP', new NumericField('RSVPMaxUserWaitListNumber', 'Max # Wait List'));
         $f->addFieldToTab('Root.RSVP', $rsvp_template);
         if ($this->RSVPTemplate()->exists()) {
             $config = new GridFieldConfig_RecordEditor(100);
             $config->removeComponentsByType('GridFieldAddNewButton');
             $config->addComponent(new GridFieldAjaxRefresh(1000, false));
             $rsvps = new GridField('RSVPSubmissions', 'RSVP Submissions', $this->RSVPSubmissions(), $config);
             $f->addFieldToTab('Root.RSVP', $rsvps);
         }
     }
     if ($this->ID > 0) {
         $_REQUEST['SummitEventID'] = $this->ID;
     }
     return $f;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:72,代码来源:SummitEvent.php


注:本文中的GridFieldConfig_RecordEditor::addComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。