本文整理汇总了PHP中FieldList::removeFieldsFromTab方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::removeFieldsFromTab方法的具体用法?PHP FieldList::removeFieldsFromTab怎么用?PHP FieldList::removeFieldsFromTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::removeFieldsFromTab方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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->addFieldToTab("Root.Newsletter", new LiteralField("ListExplanation", "<p class=\"message warning\">\n\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</p>"));
}
}
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce-newsletter-campaign-monitor,代码行数:15,代码来源:NewsletterCampaignMonitorSignupDecoratorConfigFixes.php
示例2: testRemoveMultipleFieldsFromTab
/**
* Test removing an array of fields from a tab in a set.
*/
public function testRemoveMultipleFieldsFromTab()
{
$fields = new FieldList();
$tab = new Tab('Root');
$fields->push($tab);
/* We add an array of fields, using addFieldsToTab() */
$fields->addFieldsToTab('Root', array(new TextField('Name', 'Your name'), new EmailField('Email', 'Email address'), new NumericField('Number', 'Insert a number')));
/* We have 3 fields inside the tab, which we just created */
$this->assertEquals(3, $tab->Fields()->Count());
/* We remove the 3 fields from the tab */
$fields->removeFieldsFromTab('Root', array('Name', 'Email', 'Number'));
/* We have no fields in the tab now */
$this->assertEquals(0, $tab->Fields()->Count());
}