本文整理汇总了PHP中FieldList::removeByName方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::removeByName方法的具体用法?PHP FieldList::removeByName怎么用?PHP FieldList::removeByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::removeByName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateCMSFields
function updateCMSFields(FieldList $fields)
{
$fields->removeByName("SummaryContent");
$fields->removeByName("SummaryImage");
$summary_fields = ToggleCompositeField::create('Summary', 'Summary Info.', array(TextareaField::create("SummaryContent", $this->owner->fieldLabel('SummaryContent')), UploadField::create("SummaryImage", $this->owner->fieldLabel('SummaryImage'))))->setHeadingLevel(4);
$fields->addFieldToTab('Root.Main', $summary_fields, 'Metadata');
}
示例2: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeByName("IsSpam");
$fields->removeByName("URL");
$fields->addFieldToTab("Root.Main", new ReadonlyField("Email"), "Moderated");
$fields->addFieldToTab("Root.Main", new ReadonlyField("ParentTitle", "Blog Post"), "Name");
}
示例3: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($this->owner->Schema()->Name != 'AGLS') {
$fields->removeByName('Scheme');
$fields->removeByName('Lang');
}
}
示例4: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$logo = $fields->dataFieldByName('Logo');
$fields->removeByName('ParentID');
$fields->removeByName('Sort');
$fields->insertAfter($logo, 'Title');
}
示例5: updateFrontendFields
public function updateFrontendFields(FieldList $fields)
{
$fields->removeByName('MasterNode');
$fields->removeByName('ContentID');
$fields->removeByName('OriginalID');
$fields->removeByName('LastEditedUTC');
}
示例6: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeFieldFromTab("Root.Main", "MenuTitle");
$fields->addFieldToTab('Root.Main', new LiteralField("manage", "<a style='margin-bottom:15px' class='backlink ss-ui-button cms-panel-link ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-state-hover ui-state-active' data-icon='back' href='" . Director::absoluteBaseURL() . "admin/pages/edit/show/" . $this->owner->Parent()->ID . "' role='button' aria-disabled='false'><span class='ui-button-icon-primary ui-icon btn-icon-back'></span><span style='padding-left:5px' >\n\t\t\tManage Posts\n\t\t</span></a>"), 'Title');
$image = $fields->dataFieldByName("FeaturedImage");
if ($image) {
$image->setFolderName('Managed/BlogPosts/Featured');
$image->setCanPreviewFolder(false);
}
// Get config options for using tags / categories
$use_categories = Config::inst()->get("Blog", 'use_categories');
$use_tags = Config::inst()->get("Blog", 'use_tags');
$use_featured_image = Config::inst()->get("Blog", 'use_featured_image');
// Adds message below tags/categories fields if none exist telling user where to create them
if (!$this->owner->Parent()->Categories()->count() && $use_categories) {
$cats = $fields->dataFieldByName("Categories");
$cats->setRightTitle("You must first add categories via the <strong>Blog Options</strong> tab on the <a href='admin/pages/edit/show/" . $this->owner->Parent()->ID . "'>main Blog page</a>.");
}
if (!$this->owner->Parent()->Tags()->count() && $use_tags) {
$cats = $fields->dataFieldByName("Tags");
$cats->setRightTitle("You must first add tags via the <strong>Blog Options</strong> tab on the <a href='admin/pages/edit/show/" . $this->owner->Parent()->ID . "'>main Blog page</a>.");
}
// Hide tags/categories fields if turned off in config
if (!$use_categories) {
$fields->removeByName("Categories");
}
if (!$use_tags) {
$fields->removeByName("Tags");
}
if (!$use_featured_image && !$this->owner->FeaturedImage()->exists()) {
$fields->removeFieldFromTab("Root.Main", "FeaturedImage");
}
// Need to add proper support for this, removing for now, needs to play nicely with my "Disply Full Posts" option:
$fields->removeFieldFromTab("Root.Main", "CustomSummary");
}
示例7: updateCMSFields
/**
* standard SS method
* @param Object - $fields (FieldList)
* @return Object - FieldList
*/
function updateCMSFields(FieldList $fields)
{
$additionalWhereForDefault = "";
$fields->removeByName("ExcludedFrom");
$fields->removeByName("AdditionalTax");
$tabName = "Root.Tax";
if ($this->owner instanceof ProductVariation) {
$fields->addFieldToTab($tabName, new LiteralField("SeeProductForAdditionalTax", _t("GSTTaxModifier.SEE_PARENT", "See parent Product for Additional Tax")));
} else {
//additional taxes
$additionalOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 1));
if ($additionalOptions->count()) {
$additionalOptionsList = $additionalOptions->map()->toArray();
$fields->addFieldToTab($tabName, new CheckboxSetField("AdditionalTax", _t("GSTTaxMofidifier.ADDITIONAL_TAXES", "Additional taxes ..."), $additionalOptionsList));
}
}
if ($this->owner instanceof ProductVariation) {
$fields->addFieldToTab($tabName, new LiteralField("SeeProductForExcludedFrom", _t("GSTTaxModifier.SEE_PARRENT", "See parent product for excluded taxes")));
} else {
//excluded options
$excludedOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 0));
if ($excludedOptions->count()) {
$excludedOptionsList = $excludedOptions->map()->toArray();
$fields->addFieldToTab($tabName, new CheckboxSetField("ExcludedFrom", _t("GSTTaxMofidifier.EXCLUDE_TAXES", "Taxes that do not apply ..."), $excludedOptionsList));
$additionalWhereForDefault = " \"GSTTaxModifierOptions\".\"ID\" NOT IN (" . implode(", ", $excludedOptions->map("ID", "ID")->toArray()) . ")";
}
}
//default options
$defaultOptions = GSTTaxModifierOptions::get()->filter(array("DoesNotApplyToAllProducts" => 0))->where($additionalWhereForDefault);
if ($defaultOptions->count()) {
$fields->addFieldToTab($tabName, new ReadonlyField("AlwaysApplies", "+ " . implode(", ", $defaultOptions->map()->toArray()) . "."));
}
}
示例8: updateSettingsFields
public function updateSettingsFields(FieldList $fields)
{
//removing view settings
$fields->removeByName("CanViewType");
$fields->removeByName("ViewerGroups");
//adding view settings displaying the custom hard coded view settings
$groups = $this->owner->DictatedViewerGroups();
$groupsStr = '';
if ($groups) {
foreach ($groups as $g) {
$groupsStr .= "{$g->Title}, ";
}
$groupsStr = rtrim($groupsStr, ', ');
} else {
$groupsStr = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
}
$fields->addFieldToTab('Root', LiteralField::create('CanViewTypeExpl', '
<div class="field fieldgroup fieldgroup">
<label class="left">' . _t('SiteTree.ACCESSHEADER', "Who can view this page?") . '</label>
<div class="middleColumn fieldgroup ">
<p>
<em>' . $groupsStr . '</em>
</p>
</div>
</div>
'), 'CanEditType');
}
示例9: updateCMSFields
/**
* Adds our SEO Meta fields to the page field list
*
* @since version 1.0.0
*
* @param string $fields The current FieldList object
*
* @return object Return the FieldList object
**/
public function updateCMSFields(FieldList $fields)
{
$fields->removeByName('HeadTags');
$fields->removeByName('SitemapImages');
if (!$this->owner instanceof Page) {
$fields->addFieldToTab('Root.Page', HeaderField::create('Page'));
$fields->addFieldToTab('Root.Page', TextField::create('Title', 'Page name'));
}
$fields->addFieldToTab('Root.PageSEO', $this->preview());
$fields->addFieldToTab('Root.PageSEO', TextField::create('MetaTitle'));
$fields->addFieldToTab('Root.PageSEO', TextareaField::create('MetaDescription'));
$fields->addFieldToTab('Root.PageSEO', HeaderField::create(false, 'Indexing', 2));
$fields->addFieldToTab('Root.PageSEO', TextField::create('Canonical'));
$fields->addFieldToTab('Root.PageSEO', DropdownField::create('Robots', 'Robots', SEO_FieldValues::IndexRules()));
$fields->addFieldToTab('Root.PageSEO', NumericField::create('Priority'));
$fields->addFieldToTab('Root.PageSEO', DropdownField::create('ChangeFrequency', 'Change Frequency', SEO_FieldValues::SitemapChangeFrequency()));
$fields->addFieldToTab('Root.PageSEO', CheckboxField::create('SitemapHide', 'Hide in sitemap? (XML and HTML)'));
$fields->addFieldToTab('Root.PageSEO', HeaderField::create('Social Meta'));
$fields->addFieldToTab('Root.PageSEO', CheckboxField::create('HideSocial', 'Hide Social Meta?'));
$fields->addFieldToTab('Root.PageSEO', DropdownField::create('OGtype', 'Open Graph Type', SEO_FieldValues::OGtype()));
$fields->addFieldToTab('Root.PageSEO', DropdownField::create('OGlocale', 'Open Graph Locale', SEO_FieldValues::OGlocale()));
$fields->addFieldToTab('Root.PageSEO', DropdownField::create('TwitterCard', 'Twitter Card', SEO_FieldValues::TwitterCardTypes()));
$fields->addFieldToTab('Root.PageSEO', $this->SharingImage());
$fields->addFieldToTab('Root.PageSEO', HeaderField::create('Other Meta Tags'));
$fields->addFieldToTab('Root.PageSEO', $this->OtherHeadTags());
$fields->addFieldToTab('Root.PageSEO', HeaderField::create('Sitemap Images'));
$fields->addFieldToTab('Root.PageSEO', $this->SitemapImagesGrid());
$fields->addFieldToTab('Root.PageSEO', LiteralField::create(false, '<br><br>Silverstripe SEO v1.0'));
return $fields;
}
示例10: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->removeByName('Country');
$fields->removeByName("DefaultShippingAddressID");
$fields->removeByName("DefaultBillingAddressID");
$fields->addFieldToTab('Root.Main', DropdownField::create('Country', _t('Address.db_Country', 'Country'), SiteConfig::current_site_config()->getCountriesList()));
}
示例11: updateCMSFields
/**
* Allow other admins to turn off 2FA if it is set & admins_can_disable is set in the config.
* 2FA in general is managed in the user's own profile.
*
* @param \FieldList $fields
*/
public function updateCMSFields(\FieldList $fields)
{
$fields->removeByName('TOTPToken');
$fields->removeByName('BackupTokens');
if (!(\Config::inst()->get(__CLASS__, 'admins_can_disable') && $this->owner->Has2FA && \Permission::check('ADMIN'))) {
$fields->removeByName('Has2FA');
}
}
示例12: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->insertBefore(new CheckboxField('GenerateMetaData', _t('MetaManager.GENERATEMETADATA', 'Generate Meta-data automatically from the page content'), $this->owner->GenerateMetaData), 'MetaDescription');
if (self::$hide_extra_meta == 1) {
$fields->removeByName('ExtraMeta');
$fields->removeByName('ExtraMeta_original');
}
}
示例13: updateCMSFields
/**
* This method holds the functionality to complete the oauth flow through the CMS
*
* @param $fields FieldList
**/
public function updateCMSFields(FieldList $fields)
{
// Remove fields that may have been added elsewhere.
$fields->removeByName("FacebookUser");
$fields->removeByName("FacebookUserID");
$fields->removeByName("FacebookAccessToken");
// Add our new fields.
$fields->addFieldsToTab("Root.Main", ToggleCompositeField::create('FacebookUser', 'Facebook User', array(TextField::create("FacebookUserID", "User ID"), TextField::create("FacebookAccessToken", "Access Token")))->setHeadingLevel(4));
}
示例14: updateCMSFields
/**
* Fields to display this {@link Payment} in the CMS, removed some of the
* unnecessary fields.
*
* @see DataObjectDecorator::updateCMSFields()
* @return FieldList
*/
function updateCMSFields(FieldList $fields)
{
$fields->removeByName('OrderID');
$fields->removeByName('HTTPStatus');
$fields->removeByName('Amount');
$str = $this->owner->dbObject('Amount')->Nice();
$fields->insertBefore(TextField::create('Amount_', 'Amount', $str), 'Method');
return $fields;
}
示例15: updateCMSFields
/**
* Add extra fields to a File object if in SEO Admin
*
* @since version 1.0.0
*
* @param object $fields The current FieldList object
*
* @return object
**/
public function updateCMSFields(FieldList $fields)
{
if (Controller::curr() instanceof SEO_ModelAdmin) {
$fields->removeByName('Name');
$fields->removeByName('ParentID');
$fields->removeByName('OwnerID');
}
return $fields;
}