本文整理汇总了PHP中FieldList::removeFieldFromTab方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::removeFieldFromTab方法的具体用法?PHP FieldList::removeFieldFromTab怎么用?PHP FieldList::removeFieldFromTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::removeFieldFromTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateSettingsFields
public function updateSettingsFields(FieldList $fields)
{
$fields->removeFieldFromTab("Root.Settings", "CanViewType");
$fields->removeFieldFromTab("Root.Settings", "ViewerGroups");
$fields->removeFieldFromTab("Root.Settings", "CanEditType");
$fields->removeFieldFromTab("Root.Settings", "EditorGroups");
}
示例2: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab("Root.Main", "TimeFormat");
$fields->removeFieldFromTab("Root.Main", "DateFormat");
$fields->removeFieldFromTab("Root.Main", "HasConfiguredDashboard");
$fields->removeFieldFromTab("Root.Main", "Locale");
$fields->removeFieldFromTab("Root.Main", "FailedLoginCount");
}
示例3: updateCMSFields
/**
* Adds variations specific fields to the CMS.
*/
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldsToTab('Root.Variations', array(ListboxField::create("VariationAttributeTypes", _t('ProductVariationsExtension.ATTRIBUTES', "Attributes"), ProductAttributeType::get()->map("ID", "Title")->toArray())->setMultiple(true)->setDescription(_t('ProductVariationsExtension.ATTRIBUTES_DESCRIPTION', "These are fields to indicate the way(s) each variation varies. Once selected, they can be edited on each variation.")), GridField::create("Variations", _t('ProductVariationsExtension.VARIATIONS', "Variations"), $this->owner->Variations(), GridFieldConfig_RecordEditor::create())));
if ($this->owner->Variations()->exists()) {
$fields->addFieldToTab('Root.Pricing', LabelField::create('variationspriceinstructinos', _t('ProductVariationsExtension.VARIATIONS_INSTRUCTIONS', "Price - Because you have one or more variations, the price can be set in the \"Variations\" tab.")));
$fields->removeFieldFromTab('Root.Pricing', 'BasePrice');
$fields->removeFieldFromTab('Root.Pricing', 'CostPrice');
$fields->removeFieldFromTab('Root.Main', 'InternalItemID');
}
}
示例4: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab('Root', 'Timezone');
$field = DropdownField::create('Timezone', 'Timezone', $this->getTimezones())->setEmptyString('For NZ, choose Pacific/Auckland');
$fields->addFieldToTab('Root.timezone', $field);
return $fields;
}
示例5: updateCMSFields
/**
* updateCMSFields.
* Update Silverstripe CMS Fields for SEO Module
*
* @param FieldList
* @return none
*/
public function updateCMSFields(FieldList $fields)
{
// exclude SEO tab from some pages
if (in_array($this->owner->getClassName(), Config::inst()->get("SeoObjectExtension", "excluded_page_types"))) {
return;
}
Requirements::css(SEO_DIR . '/css/seo.css');
Requirements::javascript(SEO_DIR . '/javascript/seo.js');
// better do this below in some init method? :
$this->getSEOScoreCalculation();
$this->setSEOScoreTipsUL();
// lets create a new tab on top
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('googlesearchsnippetintro', '<h3>' . _t('SEO.SEOGoogleSearchPreviewTitle', 'Preview google search') . '</h3>'), LiteralField::create('googlesearchsnippet', '<div id="google_search_snippet"></div>'), LiteralField::create('siteconfigtitle', '<div id="ss_siteconfig_title">' . $this->owner->getSiteConfig()->Title . '</div>')));
// move Metadata field from Root.Main to SEO tab for visualising direct impact on search result
$fields->removeFieldFromTab('Root.Main', 'Metadata');
/*$fields->addFieldToTab("Root.SEO", new TabSet('Options',
new Tab('Metadata', _t('SEO.SEOMetaData', 'Meta Data')),
new Tab('HelpAndSEOScore', _t('SEO.SEOHelpAndScore', 'Help and SEO Score'))
));*/
$fields->addFieldsToTab('Root.SEO', array(TextareaField::create("MetaDescription", $this->owner->fieldLabel('MetaDescription'))->setRightTitle(_t('SiteTree.METADESCHELP', "Search engines use this content for displaying search results (although it will not influence their ranking)."))->addExtraClass('help'), TextareaField::create("ExtraMeta", $this->owner->fieldLabel('ExtraMeta'))->setRightTitle(_t('SiteTree.METAEXTRAHELP', "HTML tags for additional meta information. For example <meta name=\"customName\" content=\"your custom content here\" />"))->addExtraClass('help')));
$fields->addFieldsToTab('Root.SEO', array(GoogleSuggestField::create("SEOPageSubject", _t('SEO.SEOPageSubjectTitle', 'Subject of this page (required to view this page SEO score)')), LiteralField::create('', '<div class="message notice"><p>' . _t('SEO.SEOSaveNotice', "After making changes save this page to view the updated SEO score") . '</p></div>'), LiteralField::create('ScoreTitle', '<h4 class="seo_score">' . _t('SEO.SEOScore', 'SEO Score') . '</h4>'), LiteralField::create('Score', $this->getHTMLStars()), LiteralField::create('ScoreClear', '<div class="score_clear"></div>')));
if ($this->checkPageSubjectDefined()) {
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('SimplePageSubjectCheckValues', $this->getHTMLSimplePageSubjectTest())));
}
if ($this->seo_score < 12) {
$fields->addFieldsToTab('Root.SEO', array(LiteralField::create('ScoreTipsTitle', '<h4 class="seo_score">' . _t('SEO.SEOScoreTips', 'SEO Score Tips') . '</h4>'), LiteralField::create('ScoreTips', $this->seo_score_tips)));
}
}
示例6: updateCMSFields
function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab('Root.Members', 'Members');
$fieldList = array('FirstName' => 'Name', 'Surname' => 'Last Name');
$password = new ConfirmedPasswordField('Password', null, null, null, true);
$password->setCanBeEmpty(true);
$detailFormFields = new FieldList(new TabSet("Root", new Tab('Main', 'Main', new HeaderField('MemberDetailsHeader', "Personal Details"), new TextField("FirstName", "First Name"), new TextField("Surname", "Last Name"), new HeaderField('MemberUserDetailsHeader', "User Details"), $password, new TextField("Email", "Email"), new TextField("SecondEmail", "Second Email"), new TextField("Third Email", "Third Email"), new TextField("FoodPreference", "Food Preference"), new TextField("OtherFood", "Other Food"), new TextField("IRCHandle", "IRC Handle"), new TextField("TwitterName", "Twitter Name"), new TextField("LinkedInProfile", "LinkedIn Profile"), new TextField("JobTitle", "Job Title"), new TextField("Role", "Role"), new TextareaField("StatementOfInterest", "Statement Of Interest"), new HtmlEditorField("Bio", "Bio"))));
// make table sortable for foundation-staff and supporting-cast
if ($this->owner->Code == 'openstack-foundation-staff' || $this->owner->Code == 'supporting-cast') {
$config = GridFieldConfig_RelationEditor::create(10);
$config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
$sort = new GridFieldSortableRows('SortOrder');
$config->addComponent($sort);
$config->removeComponentsByType('GridFieldPageCount');
$config->removeComponentsByType('GridFieldPaginator');
$dataColumns = $config->getComponentByType('GridFieldDataColumns');
$dataColumns->setDisplayFields(array('SortOrder' => 'Order', 'FirstName' => 'Name', 'Surname' => 'Surname', 'Email' => 'Email'));
} else {
$config = GridFieldConfig_RelationEditor::create(10);
$config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
}
$manager = new GridField('Members', 'Members', $this->owner->Members(), $config);
$fields->addFieldToTab('Root.Members', $manager);
$fields->push(new HiddenField("GroupEdtion", "GroupEdtion", "1"));
}
示例7: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab("Root.Main", $this->SortFieldForDataObjectSorter());
if (!$this->owner instanceof SiteTree) {
$link = self::dataObjectSorterPopupLink();
$fields->addFieldToTab("Root.Sort", new LiteralField("DataObjectSorterPopupLink", $link));
}
return $fields;
}
示例8: updateCMSFields
/**
* Checks for frontEndAdmin or HTTP_X_FRONT_END_ADMIN and removes the Content
* field from the page.
*
* To ensure saving pages from within the admin panel does not overwrite content saved from the front end editor
* set the X-REMOVE-CONTENT header or frontEndAdmin query string and the content field will be removed here
*
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
$controller = Controller::curr();
$isEditController = $controller instanceof CMSPageEditController;
$xfrontEndAdmin = filter_input(INPUT_SERVER, 'HTTP_X_FRONT_END_ADMIN') == "true";
$frontEndAdmin = $controller->getRequest()->getVar('frontEndAdmin') == "true";
if ($isEditController && ($xfrontEndAdmin || $frontEndAdmin)) {
$fields->removeFieldFromTab("Root.Main", "Content");
}
}
开发者ID:helpfulrobot,项目名称:gdmedia-silverstripe-frontend-admin,代码行数:19,代码来源:FrontendAdminPageExtension.php
示例9: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($themeField = $fields->fieldByName('Root.Main.Theme')) {
$fields->removeFieldFromTab('Root.Main', 'Theme');
$fields->addFieldToTab('Root.Appearance.Main', $themeField);
}
$fields->addFieldsToTab('Root.Appearance.Main', array(UploadField::create('Logo', 'Logo')->setDescription('Upload the site logo')));
// Navigation
$fields->addFieldsToTab('Root.Appearance.Navigation', array(DropdownField::create('NavgationLevel', 'Max navigation level', array(0 => 'Infinite', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9'))));
return $fields;
}
示例10: updateCMSFields
public function updateCMSFields(FieldList $f)
{
$f->addFieldToTab('Root.Main', TextField::create('Phone', 'Phone'));
$f->addFieldToTab('Root.Main', TextField::create('Fax', 'Fax'));
$f->addFieldToTab('Root.Main', TextField::create('Address', 'Address'));
$f->addFieldToTab('Root.Main', TextField::create('City', 'City'));
$f->addFieldToTab('Root.Main', TextField::create('Province', 'Province'));
$f->addFieldToTab('Root.Main', TextField::create('Postal', 'Postal'));
$f->addFieldToTab('Root.Main', EmailField::create('Email', 'Email'));
$f->removeFieldFromTab('Root.Main', 'Theme');
return $f;
}
示例11: updateCMSFields
function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab('Root.Members', 'Members');
$fieldList = array('FirstName' => 'Name', 'Surname' => 'Last Name');
$password = new ConfirmedPasswordField('Password', null, null, null, true);
$password->setCanBeEmpty(true);
$detailFormFields = new FieldList(new TabSet("Root", new Tab('Main', 'Main', new HeaderField('MemberDetailsHeader', "Personal Details"), new TextField("FirstName", "First Name"), new TextField("Surname", "Last Name"), new HeaderField('MemberUserDetailsHeader', "User Details"), $password, new TextField("Email", "Email"), new TextField("SecondEmail", "Second Email"), new TextField("Third Email", "Third Email"), new TextField("FoodPreference", "Food Preference"), new TextField("OtherFood", "Other Food"), new TextField("IRCHandle", "IRC Handle"), new TextField("TwitterName", "Twitter Name"), new TextField("LinkedInProfile", "LinkedIn Profile"), new TextField("JobTitle", "Job Title"), new TextField("Role", "Role"), new TextareaField("StatementOfInterest", "Statement Of Interest"), new HtmlEditorField("Bio", "Bio"))));
$config = GridFieldConfig_RelationEditor::create(10);
$config->getComponentByType('GridFieldDetailForm')->setFields($detailFormFields);
$manager = new GridField('Members', 'Members', $this->owner->Members(), $config);
$fields->addFieldToTab('Root.Members', $manager);
$fields->push(new HiddenField("GroupEdtion", "GroupEdtion", "1"));
}
示例12: testRemoveSingleFieldFromTab
/**
* Test removing a single field from a tab in a set.
*/
public function testRemoveSingleFieldFromTab()
{
$fields = new FieldList();
$tab = new Tab('Root');
$fields->push($tab);
/* We add a field to the "Root" tab */
$fields->addFieldToTab('Root', new TextField('Country'));
/* We have 1 field inside the tab, which is the field we just created */
$this->assertEquals(1, $tab->Fields()->Count());
/* We remove the field from the tab */
$fields->removeFieldFromTab('Root', 'Country');
/* We'll have no fields in the tab now */
$this->assertEquals(0, $tab->Fields()->Count());
}
示例13: updateCMSFields
/**
* {@inheritdoc}
*/
public function updateCMSFields(FieldList $fields)
{
$fields->removeByName('URLSegment');
// Remove the automatically-generated posts tab.
$fields->removeFieldFromTab('Root', 'BlogPosts');
// Construct a better posts tab.
Requirements::css(BLOGGER_DIR . '/css/cms.css');
Requirements::javascript(BLOGGER_DIR . '/js/cms.js');
$tab = new Tab('BlogPosts', 'Blog Posts');
$gridField = new GridField('BlogPosts', 'Blog Posts', $this->owner->BlogPosts(), new GridFieldConfig_BlogPost());
$tab->Fields()->add($gridField);
$fields->addFieldToTab('Root', $tab);
return $fields;
}
示例14: afterUpdateCMSFields
public function afterUpdateCMSFields(FieldList $fields)
{
self::$runs++;
/** @var ToggleCompositeField $metaDataChildren */
$metaDataChildren = $fields->fieldByName('Root.Main.Metadata');
$length = $this->owner->config()->MetaDescriptionLength ?: $this->MetaDescriptionLength;
$metaDataChildren->fieldByName('MetaDescription')->setAttribute('maxlength', $length);
$children = array_merge([$metaTitle = TextField::create('MetaTitle')], $metaDataChildren->getChildren()->toArray());
$fields->removeFieldFromTab('Root.Main', 'Metadata');
$fields->addFieldToTab('Root', Tab::create('Metadata'), 'Content');
//Add META Title tag to METADATA
$fields->addFieldsToTab('Root.Metadata', $children);
$metaTitle->setDescription('Displayed as the tab/window name; Also displayed in search engine result listings as the page title.<br />
Falls back to the Primary Heading field if not provided.');
}
示例15: updateCMSFields
function updateCMSFields(FieldList $fields)
{
$lists = CampaignMonitorSignupPage::get_ready_ones();
if ($lists && $lists->count()) {
$options = array(0 => _t("EcommerceNewsletterCampaignMonitorSignup.PLEASE_SELECT", "-- please select --")) + $lists->map()->toArray();
if ($this->owner->CampaignMonitorSignupPageID) {
$fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options), new TextField("CampaignMonitorSignupHeader", _t("EcommerceNewsletterCampaignMonitorSignup.HEADER", "Header")), new TextField("CampaignMonitorSignupIntro", _t("EcommerceNewsletterCampaignMonitorSignup.INTRO", "Intro")), new TextField("CampaignMonitorSignupLabel", _t("EcommerceNewsletterCampaignMonitorSignup.LABEL", "Label"))));
} else {
$fields->addFieldsToTab("Root.Newsletter", array(new DropdownField("CampaignMonitorSignupPageID", _t("EcommerceNewsletterCampaignMonitorSignup.SIGN_UP_TO", "Sign-up for ..."), $options)));
$fields->removeFieldsFromTab("Root.Main", array("CampaignMonitorSignupHeader", "CampaignMonitorSignupIntro", "CampaignMonitorSignupLabel"));
}
} else {
$fields->addFieldsToTab("Root.Newsletter", array(new LiteralField("ListExplanation", "<p class=\"message warning\">\n\t\t\t\t\t\t" . _t("EcommerceNewsletterCampaignMonitorSignup.RECOMMENDATION_TO_SETUP", "It is recommended you set up a Campaign Monitor Page with a valid list to subscribe to.") . "\n\t\t\t\t\t\t</p>"), new TextField("CampaignMonitorSignupHeader", _t("EcommerceNewsletterCampaignMonitorSignup.HEADER", "Header")), new TextField("CampaignMonitorSignupIntro", _t("EcommerceNewsletterCampaignMonitorSignup.INTRO", "Intro")), new TextField("CampaignMonitorSignupLabel", _t("EcommerceNewsletterCampaignMonitorSignup.LABEL", "Label"))));
$fields->removeFieldFromTab("Root.Main", "CampaignMonitorSignupPageID");
}
}
开发者ID:sunnysideup,项目名称:silverstripe-ecommerce_newsletter_campaign_monitor,代码行数:16,代码来源:NewsletterCampaignMonitorSignupDecoratorConfigFixes.php