public function updateCMSFields(FieldList $fields) { $fields->AddFieldToTab('Root.Main', new CountryDropdownField('CountryCode', _t('LibPhoneNumberExtension.CountryCode', 'Country'))); $fields->AddFieldToTab('Root.Main', $phonefield = new LibPhoneNumberField('PhoneNumber', _t('LibPhoneNumberExtension.PhoneNumber', 'Phone'))); $phonefield->setCountryField('CountryCode'); $fields->AddFieldToTab('Root.Main', $mobilephonefield = new LibPhoneNumberField('MobilePhoneNumber', _t('LibPhoneNumberExtension.MobilePhoneNumber', 'Mobile Phone'))); $mobilephonefield->setCountryField('CountryCode'); return $fields; }
public function updateCMSFields(FieldList $fields) { $tabName = 'Root.Pricing'; if (class_exists("DataObjectOneFieldUpdateController")) { $link = DataObjectOneFieldUpdateController::popup_link($this->owner->ClassName, "Price", $where = "", $sort = "Price ASC ", $linkText = "Check all prices..."); $fields->AddFieldToTab($tabName, new HeaderField("MetaTitleFixesHeader", "Quick review", 3)); $fields->AddFieldToTab($tabName, new LiteralField("MetaTitleFixes", $link . ".<br /><br /><br />")); } // move price field under new 'Pricing' tab // $priceField = $fields->fieldByName('Root.Details.Price'); // $fields->remove($priceField); $fields->addFieldsToTab($tabName, array(new HeaderField("ComplexPricesHeader", "Alternative Pricing", 3), new LiteralField("ComplexPricesExplanation", "<p>Please enter <i>alternative</i> pricing below. You can enter a price per <a href=\"admin/security/\">security group</a> and/or per country.</p>"), $this->complexPricesHasManyTable())); }
/** * Add cms field for Color db field * @return FieldList */ public function updateCMSFields(FieldList $fields) { $color = $this->owner->Color; $pallete = $this->dominantColorPalette(); $options = array(); $options[$color] = $color; foreach ($pallete as $color) { $options[$color] = $color; } $fields->AddFieldToTab('Root.Main', ColorPaletteField::create($name = 'Color', $title = 'Color', $source = $options, $value = $this->owner->Color)); }