本文整理汇总了PHP中GridFieldConfig_RelationEditor::removeComponentsByType方法的典型用法代码示例。如果您正苦于以下问题:PHP GridFieldConfig_RelationEditor::removeComponentsByType方法的具体用法?PHP GridFieldConfig_RelationEditor::removeComponentsByType怎么用?PHP GridFieldConfig_RelationEditor::removeComponentsByType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridFieldConfig_RelationEditor
的用法示例。
在下文中一共展示了GridFieldConfig_RelationEditor::removeComponentsByType方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
/**
* @return \FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName('Countries');
if ($this->exists()) {
$fields->addFieldToTab('Root.Countries', new \GridField('Countries', 'Countries in zone', $this->Countries(), $config = new \GridFieldConfig_RelationEditor()));
$config->removeComponentsByType("GridFieldAddNewButton");
$config->removeComponentsByType("GridFieldEditButton");
//GridFieldConfig_RelationEditor
}
return $fields;
}
示例2: 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;
}
示例3: getCMSFields
public function getCMSFields()
{
$fields = FieldList::create(TabSet::create('Root'))->text('Title')->text('Code', 'Code', '', 5)->textarea('Description')->numeric('SessionCount', 'Number of sessions')->numeric('AlternateCount', 'Number of alternates')->checkbox('VotingVisible', "This category is visible to voters")->checkbox('ChairVisible', "This category is visible to track chairs")->hidden('SummitID', 'SummitID');
if ($this->ID > 0) {
//tags
$config = new GridFieldConfig_RelationEditor(100);
$config->removeComponentsByType(new GridFieldDataColumns());
$config->removeComponentsByType(new GridFieldDetailForm());
$completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
$completer->setResultsFormat('$Tag');
$completer->setSearchFields(array('Tag'));
$completer->setSearchList(Tag::get());
$editconf = new GridFieldDetailForm();
$editconf->setFields(FieldList::create(TextField::create('Tag', 'Tag'), DropdownField::create('ManyMany[Group]', 'Group', array('topics' => 'Topics', 'speaker' => 'Speaker', 'openstack projects mentioned' => 'OpenStack Projects Mentioned'))));
$summaryfieldsconf = new GridFieldDataColumns();
$summaryfieldsconf->setDisplayFields(array('Tag' => 'Tag', 'Group' => 'Group'));
$config->addComponent($editconf);
$config->addComponent($summaryfieldsconf, new GridFieldFilterHeader());
$tags = new GridField('AllowedTags', 'Tags', $this->AllowedTags(), $config);
$fields->addFieldToTab('Root.Main', $tags);
// extra questions for call-for-presentations
$config = new GridFieldConfig_RelationEditor();
$config->removeComponentsByType('GridFieldAddNewButton');
$multi_class_selector = new GridFieldAddNewMultiClass();
$multi_class_selector->setClasses(array('TrackTextBoxQuestionTemplate' => 'TextBox', 'TrackCheckBoxQuestionTemplate' => 'CheckBox', 'TrackCheckBoxListQuestionTemplate' => 'CheckBoxList', 'TrackRadioButtonListQuestionTemplate' => 'RadioButtonList', 'TrackDropDownQuestionTemplate' => 'ComboBox', 'TrackLiteralContentQuestionTemplate' => 'Literal'));
$config->addComponent($multi_class_selector);
$questions = new GridField('ExtraQuestions', 'Track Specific Questions', $this->ExtraQuestions(), $config);
$fields->addFieldToTab('Root.Main', $questions);
}
return $fields;
}
示例4: getCMSFields
public function getCMSFields()
{
$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('Name', 'Name'));
$f->addFieldToTab('Root.Main', new ColorField('Color', 'Color'));
if ($this->ID > 0) {
$config = new GridFieldConfig_RelationEditor(100);
$config->removeComponentsByType('GridFieldEditButton');
$config->removeComponentsByType('GridFieldAddNewButton');
$config->addComponent(new GridFieldDeleteAction('unlinkrelation'));
$completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
$completer->setSearchList(PresentationCategory::get()->filter('SummitID', $summit_id));
$categories = new GridField('Categories', 'Presentation Category', $this->Categories(), $config);
$f->addFieldToTab('Root.Main', $categories);
}
$f->addFieldToTab('Root.Main', new HtmlEditorField('Description', 'Description'));
$f->addFieldToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
return $f;
}
示例5: getCMSFields
public function getCMSFields()
{
$f = parent::getCMSFields();
$f->addFieldToTab('Root.Main', $date = new DatetimeField('SubmissionBeginDate', 'Submission Begin Date'));
$date->getDateField()->setConfig('showcalendar', true);
$date->setConfig('dateformat', 'dd/MM/yyyy');
$f->addFieldToTab('Root.Main', $date = new DatetimeField('SubmissionEndDate', 'Submission End Date'));
$date->getDateField()->setConfig('showcalendar', true);
$date->setConfig('dateformat', 'dd/MM/yyyy');
$f->addFieldsToTab('Root.Main', new NumericField('MaxSubmissionAllowedPerUser', 'Max. Submission Allowed Per User'));
if ($this->ID > 0) {
$config = new GridFieldConfig_RelationEditor(100);
$config->removeComponentsByType('GridFieldEditButton');
$config->removeComponentsByType('GridFieldAddNewButton');
$config->addComponent(new GridFieldDeleteAction('unlinkrelation'));
$groups = new GridField('AllowedGroups', 'Allowed Groups', $this->AllowedGroups(), $config);
$f->addFieldToTab('Root.Main', $groups);
}
return $f;
}
示例6: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
// variables
// $config = SiteConfig::current_site_config();
$owner = $this->owner;
//// Authorship
$tab = 'Root.SEO.Authorship';
//
$authorsConfig = new GridFieldConfig_RelationEditor();
$authorsConfig->removeComponentsByType('GridFieldAddNewButton');
//
$fields->addFieldsToTab($tab, array(GridField::create('Authors', 'Authors', $owner->Authors(), $authorsConfig)));
}
开发者ID:Graphiques-Digitale,项目名称:silverstripe-seo-google-plus-authorship,代码行数:13,代码来源:SEO_Authorship_SiteTree_DataExtension.php
示例7: updateCMSFields
/**
* @return FieldList
*/
public function updateCMSFields(FieldList $fields)
{
$tilesConfig = new GridFieldConfig_RelationEditor();
if (class_exists('GridFieldSortableRows')) {
$tilesConfig->addComponent(new GridFieldSortableRows('Sort'));
}
if ($this->owner->HomeTiles()->Count() == $this->owner->config()->HomeTilesLimit) {
$tilesConfig->removeComponentsByType('GridFieldAddNewButton');
}
$slidesGrid = GridField::create('HomeTiles', 'HomeTiles', $this->owner->HomeTiles(), $tilesConfig);
$fields->addFieldToTab('Root.Tiles', $slidesGrid);
return $fields;
}
开发者ID:helpfulrobot,项目名称:plato-creative-plato-silverstripe-hometiles,代码行数:16,代码来源:HomePageTilesExtension.php
示例8: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$galleryConfig = new GridFieldConfig_RelationEditor();
if (class_exists('GridFieldSortableRows')) {
$galleryConfig->addComponent(new GridFieldSortableRows('Sort'));
}
if ($this->owner->GalleryItems()->Count() >= $this->getItemLimit()) {
$galleryConfig->removeComponentsByType('GridFieldAddNewButton');
}
$galleryGrid = GridField::create('GalleryItems', 'GalleryItems', $this->GalleryItems(), $galleryConfig);
$fields->addFieldToTab('Root.Gallery', $galleryGrid);
return $fields;
}
示例9: 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;
}
示例10: getCMSFields
public function getCMSFields()
{
$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', 'Short Description'));
$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');
$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');
$feedback = new GridField('Feedback', 'Feedback', $this->Feedback(), $config);
$f->addFieldToTab('Root.Feedback', $feedback);
}
return $f;
}
示例11: 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;
}
示例12: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
$summit_id = isset($_REQUEST['SummitID']) ? $_REQUEST['SummitID'] : $this->SummitID;
$f = parent::getCMSFields();
$f->removeByName('TypeID');
$f->dropdown('Level', 'Level', $this->dbObject('Level')->enumValues())->dropdown('CategoryID', 'Category', PresentationCategory::get()->map('ID', 'Title'))->listbox('Topics', 'Topics', PresentationTopic::get()->map('ID', 'Title')->toArray())->configure()->setMultiple(true)->end()->text('OtherTopic', 'Other topic')->htmleditor('ProblemAddressed', 'What is the problem or use case you’re addressing in this session?')->htmleditor('AttendeesExpectedLearnt', 'What should attendees expect to learn?')->tab('Preview')->literal('preview', sprintf('<iframe width="%s" height="%s" frameborder="0" src="%s"></iframe>', '100%', '400', Director::absoluteBaseURL() . $this->PreviewLink()));
$f->addFieldToTab('Root.Main', $ddl_type = new DropdownField('TypeID', 'Event Type', SummitEventType::get()->filter(array('SummitID' => $summit_id))->where(" Type ='Presentation' OR Type ='Keynotes' OR Type ='Panel' ")->map('ID', 'Type')));
$ddl_type->setEmptyString('-- Select a Presentation Type --');
if ($this->ID > 0) {
// speakers
$config = new GridFieldConfig_RelationEditor(100);
$config->removeComponentsByType('GridFieldAddNewButton');
$speakers = new GridField('Speakers', 'Speakers', $this->Speakers(), $config);
$f->addFieldToTab('Root.Speakers', $speakers);
$config->getComponentByType('GridFieldAddExistingAutocompleter')->setResultsFormat('$Name - $Member.Email')->setSearchList($this->getAllowedSpeakers());
// moderator
$f->addFieldToTab('Root.Speakers', $ddl_moderator = new DropdownField('ModeratorID', 'Moderator', $this->Speakers()->map('ID', 'Name')));
$ddl_moderator->setEmptyString('-- Select a Moderator --');
$config = GridFieldConfig_RecordEditor::create(100);
$config->removeComponentsByType('GridFieldAddNewButton');
$multi_class_selector = new GridFieldAddNewMultiClass();
$multi_class_selector->setClasses(array('PresentationVideo' => 'Video', 'PresentationSlide' => 'Slide', 'PresentationLink' => 'Link'));
$config->addComponent($multi_class_selector);
$config->addComponent($sort = new GridFieldSortableRows('Order'));
$gridField = new GridField('Materials', 'Materials', $this->Materials(), $config);
$f->addFieldToTab('Root.Materials', $gridField);
}
return $f;
}