/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Create the FieldList and push the Root TabSet on to it. $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Order Status"), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("The name of your custom order status. i.e. Pending, Awaiting Stock."), TextareaField::create("Content", "Friendly Description")->setRightTitle("This will be shown to your customers. What do you wish to tell them about this status?"))))); return $fields; }
/** * @return FieldList */ public function getCMSFields() { /** ========================================= * @var FieldList $fields * @var FieldGroup $settings * @var UploadField $image * @var GridFieldConfig_RelationEditor $config * @var GridField $gridField ===========================================*/ $fields = FieldList::create(TabSet::create('Root')); $fields->addfieldToTab('Root.Main', $title = TextField::create('Title')); $title->setRightTitle('Title used in the cms as a visual cue for this piece of content.'); $fields->addFieldToTab('Root.Main', $settings = FieldGroup::create(array(CheckboxField::create('IsFullWidth', 'Container full width')))); $settings->setTitle('Settings'); $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Style')); $fields->addFieldToTab('Root.Main', DesignField::create('Style', 'Container', '.container', array('padding-top' => 'TextField', 'padding-bottom' => 'TextField', 'margin-top' => 'TextField', 'margin-bottom' => 'TextField', 'color' => 'ColorField', 'background' => 'ColorField'))); $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Background (optional)', 4)); $fields->addFieldToTab('Root.Main', $image = UploadField::create('Image', _t('PageBuilderContainer.IMAGE', 'Image'))); $image->setAllowedExtensions(array('jpeg', 'jpg', 'gif', 'png')); $image->setFolderName('Uploads/site-builder/containers'); $fields->addFieldToTab('Root.Main', DropdownField::create('BackgroundType', 'Type', $this->dbObject('BackgroundType')->enumValues())); $config = GridFieldConfig_RelationEditor::create(10); $config->addComponent(GridFieldOrderableRows::create('SortOrder'))->addComponent(new GridFieldDeleteAction()); $gridField = GridField::create('Items', 'Items', $this->Items(), $config); $gridField->addExtraClass('hide'); $fields->addFieldToTab('Root.Main', $gridField); return $fields; }
public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab('Root', Tab::create("GoogleAnalytics", _t('GoogleAnalyzer.TABTITLE', "Google Analytics"))); $fields->addFieldToTab("Root.GoogleAnalytics", TabSet::create("Stats", _t('GoogleAnalyzer.STATS', "Stats"))); $fields->addFieldToTab('Root.GoogleAnalytics.Stats', Tab::create("Performance", _t('GoogleAnalyzer.PERFORMANCE', "Performance"))); $fields->addFieldToTab("Root.GoogleAnalytics.Stats.Performance", new GooglePerformanceChart($this->owner)); }
public function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title'), HTMLEditorField::create('Description'), $upload = UploadField::create('DownloadFile', 'Download File'))); $upload->setFolderName('downloads'); return $fields; }
/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Create the FieldList and push the Root TabSet on to it. $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Tax Zone"), CompositeField::create(DropdownField::create("Enabled", "Enable this zone?", array("1" => "Yes", "2" => "No"))->setRightTitle($this->SystemCreated == 1 && $this->exists() ? "DISABLED: You can not disable the default tax zone." : "If enabled your store will use the rates defined in this zone for customers in the selected country.")->setDisabled($this->SystemCreated == 1 && $this->exists() ? true : false), !$this->exists() ? CountryDropdownField::create("Title", "Country")->setRightTitle($this->SystemCreated == 1 && $this->exists() ? "DISABLED: You can not select a country as this zone applies to all countries." : "Select the country this zone applies to.")->setDisabled($this->SystemCreated == 1 && $this->exists() ? true : false) : "", $this->exists() ? GridField::create("TaxZones_TaxRates", "Tax Rates within the '" . $this->Title . "' Tax Zone", $this->TaxRates(), GridFieldConfig_RecordEditor::create()) : "")))); return $fields; }
public function getCMSFields() { if ($this->ID == 0) { $categorydropdown = TextField::create('CategoryDisclaimer')->setTitle('Category')->setDisabled(true)->setValue('You can assign a category once you have saved the record for the first time.'); } else { $categories = ListCategory::get()->filter("ListPageID", "{$this->ListPageID}")->sort("Category ASC"); $map = $categories ? $categories->map('ID', 'Category', 'Please Select') : array(); if ($map) { $categorydropdown = new DropdownField('ListCategoryID', 'Category', $map); $categorydropdown->setEmptyString("-- Please Select --"); } else { $categorydropdown = new DropdownField('ListCategoryID', 'Category', $map); $categorydropdown->setEmptyString("There are no categories created yet"); } } $ImageField = UploadField::create('Photo')->setDescription('(Allowed filetypes: jpg, jpeg, png, gif)'); $ImageField->folderName = 'ListPage'; $ImageField->getValidator()->allowedExtensions = array('jpg', 'jpeg', 'gif', 'png'); $DocumentField = UploadField::create('Resource')->setTitle('Resource/Document')->setDescription('(Allowed filetypes: pdf, doc, docx, txt, ppt, or pptx)'); $DocumentField->folderName = "ListPage"; $DocumentField->getValidator()->allowedExtensions = array('pdf', 'doc', 'docx', 'txt', 'ppt', 'pptx'); $LinkField = TextField::create('Link')->setTitle('Link URL'); $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldsToTab('Root.Main', array($categorydropdown, TextField::create('Title'), OptionSetField::create('LinkType')->setTitle('')->setSource($this->dbObject('LinkType')->enumValues()), TextField::create('Link')->setTitle('Link URL')->displayIf('LinkType')->isEqualTo('Link')->andIf('LinkType')->isNotEqualTo('Resource')->end(), DisplayLogicWrapper::create($DocumentField)->displayIf('LinkType')->isEqualTo('Resource')->andIf('LinkType')->isNotEqualTo('Link')->end(), $ImageField, HTMLEditorField::create('Content'))); return $fields; }
/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Create the FieldList and push the Root TabSet on to it. $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Tax Class"), CompositeField::create(TextField::create("Title", "Class Name")->setRightTitle("i.e. Zero Rate, Standard Rate."))))); return $fields; }
/** * @return FieldList */ public function getCMSFields() { // Get NotifiedOn implementors $types = ClassInfo::implementorsOf('NotifiedOn'); $types = array_combine($types, $types); unset($types['NotifyOnThis']); if (!$types) { $types = array(); } array_unshift($types, ''); // Available keywords $keywords = $this->getKeywords(); if (count($keywords)) { $availableKeywords = '<div class="field"><div class="middleColumn"><p><u>Available Keywords:</u> </p><ul><li>$' . implode('</li><li>$', $keywords) . '</li></ul></div></div>'; } else { $availableKeywords = "Available keywords will be shown if you select a NotifyOnClass"; } // Identifiers $identifiers = $this->config()->get('identifiers'); if (count($identifiers)) { $identifiers = array_combine($identifiers, $identifiers); } $fields = FieldList::create(); $relevantMsg = 'Relevant for (note: this notification will only be sent if the context of raising the notification is of this type)'; $fields->push(TabSet::create('Root', Tab::create('Main', DropdownField::create('Identifier', _t('SystemNotification.IDENTIFIER', 'Identifier'), $identifiers), TextField::create('Title', _t('SystemNotification.TITLE', 'Title')), TextField::create('Description', _t('SystemNotification.DESCRIPTION', 'Description')), DropdownField::create('NotifyOnClass', _t('SystemNotification.NOTIFY_ON_CLASS', $relevantMsg), $types), TextField::create('CustomTemplate', _t('SystemNotification.TEMPLATE', 'Template (Optional)'))->setAttribute('placeholder', $this->config()->get('default_template')), LiteralField::create('AvailableKeywords', $availableKeywords)))); if ($this->config()->html_notifications) { $fields->insertBefore(HTMLEditorField::create('NotificationHTML', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords'); } else { $fields->insertBefore(TextareaField::create('NotificationText', _t('SystemNotification.TEXT', 'Text')), 'AvailableKeywords'); } return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', new TextField('Title')); $fields->addFieldToTab('Root.Main', new CurrencyField('Price')); return $fields; }
/** * @param FieldList $fields */ public function updateCMSFields(FieldList $fields) { /** ========================================= * @var TextareaField $address * @var TextareaField $postalAddress * @var TextField $mailChimpAPI * @var TextareaField $mailChimpSuccessMessage ===========================================*/ if (!$fields->fieldByName('Root.Settings')) { $fields->addFieldToTab('Root', TabSet::create('Settings')); } /** ----------------------------------------- * Details * ----------------------------------------*/ $address = TextareaField::create('Address', 'Address'); $address->setRows(8); $postalAddress = TextareaField::create('PostalAddress', 'Postal Address'); $postalAddress->setRows(8); $fields->findOrMakeTab('Root.Settings.Details'); $fields->addFieldsToTab('Root.Settings.Details', array(HeaderField::create('', 'Company Details'), Textfield::create('Phone', 'Phone Number'), Textfield::create('Email', 'Public Email Address'), $address, $postalAddress, TextField::create('Facebook', 'Facebook'), TextField::create('LinkedIn', 'LinkedIn'), TextField::create('Pinterest', 'Pinterest'), TextField::create('TwitterHandle', 'Twitter Handle'))); /** ----------------------------------------- * Subscription * ----------------------------------------*/ $mailChimpAPI = TextField::create('MailChimpAPI', 'API Key'); $mailChimpSuccessMessage = TextareaField::create('MailChimpSuccessMessage', 'Success Message (optional)'); $mailChimpAPI->setRightTitle('<a href="https://us9.admin.mailchimp.com/account/api-key-popup/" target="_blank"><i>How do I get my MailChimp API Key?</i></a>'); $mailChimpSuccessMessage->setRows(2)->setRightTitle('Message displayed when a user has successfully subscribed to a list.'); $fields->findOrMakeTab('Root.Settings.Subscription', 'Subscription'); $fields->addFieldsToTab('Root.Settings.Subscription', array(HeaderField::create('', 'Newsletter Subscription'), LiteralField::create('', '<p>The API key, and list ID are necessary for the Newsletter Subscription form to function.</p>'), $mailChimpAPI, TextField::create('MailChimpListID', 'List ID'), $mailChimpSuccessMessage)); }
public function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', new DropdownField('Type', 'Type', $this->dbObject('Type')->enumValues())); $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name')); $fields->addFieldToTab('Root.Main', new TextareaField('Description', 'Description')); $fields->addFieldToTab('Root.Main', new TextareaField('Address', 'Address')); $fields->addFieldToTab('Root.Main', new TextField('Latitude', 'Latitude')); $fields->addFieldToTab('Root.Main', new TextField('Longitude', 'Longitude')); $fields->addFieldToTab('Root.Main', new TextField('LocationMessage', 'Message to display for this location')); $fields->addFieldToTab('Root.Main', new TextField('Website', 'Website')); $fields->addFieldToTab('Root.Main', new TextField('BookingLink', 'BookingLink')); $start_date = new DatetimeField('BookingStartDate', 'Booking Block - Start Date'); $start_date->getDateField()->setConfig('showcalendar', true); $start_date->setConfig('dateformat', 'dd/MM/yyyy'); $fields->addFieldToTab('Root.Main', $start_date); $end_date = new DatetimeField('BookingEndDate', 'Booking Block - End Date'); $end_date->getDateField()->setConfig('showcalendar', true); $end_date->setConfig('dateformat', 'dd/MM/yyyy'); $fields->addFieldToTab('Root.Main', $end_date); $fields->addFieldToTab('Root.Main', new TextField('InRangeBookingGraphic', 'URL of graphic of an in range stay')); $fields->addFieldToTab('Root.Main', new TextField('OutOfRangeBookingGraphic', 'URL of graphic of an out of range stay')); $fields->addFieldToTab('Root.Main', new CheckboxField('IsSoldOut', 'This location is <strong>sold out</strong> (applies to hotels only)')); $fields->addFieldToTab('Root.Main', new CheckboxField('DisplayOnSite', 'Show this location on the website. Will be hidden if unchecked.')); $fields->addFieldToTab('Root.Main', new CheckboxField('DetailsPage', 'Send people to a details page first?')); $fields->addFieldToTab('Root.Main', new TextField('DistanceFromVenue', 'Distance From Venue')); $fields->addFieldToTab('Root.Main', new TextField('PublicTransitInstructions', 'Public Transit Instructions')); return $fields; }
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; }
function getCMSFields() { $fields = FieldList::create(TabSet::create(Root)); $fields->addFieldToTab("Root.Main", TextField::create('Name', 'Series Name')); // $fields->addFieldToTab("Root.Main", UploadField::create('Icon', 'Series Icon')); return $fields; }
public function updateCMSFields(FieldList $fields) { $fields->insertBefore($shoptab = Tab::create('Shop', 'Shop'), 'Access'); $fields->addFieldsToTab("Root.Shop", TabSet::create("ShopTabs", $maintab = Tab::create("Main", TreeDropdownField::create('TermsPageID', _t("ShopConfig.TERMSPAGE", 'Terms and Conditions Page'), 'SiteTree'), TreeDropdownField::create("CustomerGroupID", _t("ShopConfig.CUSTOMERGROUP", "Group to add new customers to"), "Group"), UploadField::create('DefaultProductImage', _t('ShopConfig.DEFAULTIMAGE', 'Default Product Image'))), $countriestab = Tab::create("Countries", CheckboxSetField::create('AllowedCountries', _t('ShopConfig.ALLOWED_COUNTRIES', 'Allowed Ordering and Shipping Countries'), self::config()->iso_3166_country_codes)))); $fields->removeByName("CreateTopLevelGroups"); $countriestab->setTitle(_t('ShopConfig.ALLOWED_COUNTRIES_TAB_TITLE', "Allowed Countries")); }
/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Create the FieldList and push the Root TabSet on to it. $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create($this->SystemName), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("This is the name your customers would see against this courier."), DropdownField::create("Enabled", "Enable this courier?", array("0" => "No", "1" => "Yes"))->setEmptyString("(Select one)")->setRightTitle("Can customers use this courier?"))))); return $fields; }
/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Create the FieldList and push the Root TabSet on to it. $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Currency"), CompositeField::create(DropdownField::create("Enabled", "Enable Currency?", array("1" => "Yes", "2" => "No"))->setRightTitle($this->SystemCreated == 1 ? "DISABLED: You can not disable the default currency." : "Select the country this zone applies to.")->setDisabled($this->SystemCreated == 1 ? true : false), TextField::create("Title", "Currency Name")->setRightTitle("i.e. Great British Pound."), TextField::create("Code", "Currency Code")->setRightTitle("i.e. GBP, USD, EUR."), TextField::create("ExchangeRate", "Exchange Rate")->setRightTitle("i.e. Your new currency is USD, a conversion rate of 1.53 may apply against the local currency."), TextField::create("Symbol", "Currency Symbol")->setRightTitle("i.e. £, \$, €."), DropdownField::create("SymbolLocation", "Symbol Location", array("1" => "On the left, i.e. \$1.00", "2" => "On the right, i.e. 1.00\$", "3" => "Display the currency code instead, i.e. 1 USD."))->setRightTitle("Where should the currency symbol be placed?"), TextField::create("DecimalSeperator", "Decimal Separator")->setRightTitle("What decimal separator does this currency use?"), TextField::create("ThousandsSeparator", "Thousands Separator")->setRightTitle("What thousands separator does this currency use?"), NumericField::create("DecimalPlaces", "Decimal Places")->setRightTitle("How many decimal places does this currency use?"))))); return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', new UploadField('Image')); $fields->addFieldToTab('Root.Main', $caption = new HtmlEditorField('Caption')); $caption->setRows(15); return $fields; }
/** * Get the fields that are sent to the CMS. In * your extensions: updateCMSFields($fields) * * @return FieldList */ public function getCMSFields() { /** @var FieldList $fields */ $fields = FieldList::create(TabSet::create('Root', Tab::create('Main'), Tab::create('Settings'))); $fields->addFieldToTab('Root.Settings', TextField::create('GoogleFontAPI')); $this->extend('updateCMSFields', $fields); return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', new TextField('Title', 'Title')); $fields->addFieldToTab('Root.Main', new TextField('Lat', 'Lat')); $fields->addFieldToTab('Root.Main', new TextField('Long', 'Long')); return $fields; }
public function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title'), TextareaField::create('Description'), DropdownField::create('CategoryID', 'Category')->setSource(DirectoryCategory::get()->map('ID', 'Title'))->setEmptyString('-- Select a category --'), TextField::create('Manager'), TextareaField::create('Address'), TextField::create('City'), CountryDropdownField::create('Country'), TextField::create('Website'), TextField::create('Email'), TextField::create('Phone'), DateField::create('Date')->setConfig('showcalendar', true)->setConfig('dateformat', 'd MMMM yyyy'))); $fields->addFieldToTab('Root.Photos', $upload = UploadField::create('Photo', 'Photo')); $upload->getValidator()->setAllowedExtensions(array('png', 'jpeg', 'jpg', 'gif')); $upload->setFolderName('directory-photos'); return $fields; }
public function createNext7DaysTab() { $sevenDaysTab = Tab::create('Next7Days', 'Next 7 Days', $days = TabSet::create('Days')); for ($i = 0; $i < 7; $i++) { $data = $this->getFieldsForEventDay($i); $days->push(Tab::create("Plus{$i}Days", $data['TabTitle'])->setChildren($data['Fields'])); } return $sevenDaysTab; }
public function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); if ($this->SchedID) { return $fields->tab('SchedData')->readonly('Title')->readonly('Description')->readonly('EventStart')->readonly('EventEnd')->readonly('EventKey')->readonly('EventType')->readonly('Goers')->readonly('SchedID')->readonly('InviteOnly')->readonly('Seats')->readonly('Venue')->readonly('VenueID')->tab('EditableData')->checkbox('DisplayOnSite')->text('YouTubeID')->dropdown('CategoryID', 'Category', PresentationCategory::get()->map('ID', 'Title'))->listbox('PresentationSpeakers')->configure()->setSource(PresentationSpeaker::get()->map('ID', 'Title')->toArray())->setMultiple(true)->end()->imageUpload('VideoThumbnail')->upload('RelatedMedia')->tag('Tags', 'Tags', Tag::get(), $this->Tags()); } else { return $fields->text('Title')->dropdown('CategoryID', 'Category', PresentationCategory::get()->map('ID', 'Title'))->tag('Tags', 'Tags', Tag::get(), $this->Tags())->date('EventStart')->configure()->setConfig('showcalendar', true)->end()->date('EventEnd')->configure()->setConfig('showcalendar', true)->end()->htmlEditor('Description')->checkbox('InviteOnly')->numeric('Seats')->text('Venue')->text('YouTubeID')->imageUpload('VideoThumbnail')->upload('RelatedMedia')->checkbox('DisplayOnSite'); } }
public function getCMSFields() { $fields = FieldList::create(); $fields->push(TabSet::create('Root', $mainTab = new Tab('Main'))); $mainTab->setTitle(_t('SiteTree.TABMAIN', "Main")); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title', _t('Block.TITLE', 'Title')))); $this->extend('updateCMSFields', $fields); return $fields; }
public function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title'), TextareaField::create('Description'), CurrencyField::create('PricePerNight', 'Price (per night)'), DropdownField::create('Bedrooms')->setSource(ArrayLib::valuekey(range(1, 10))), DropdownField::create('Bathrooms')->setSource(ArrayLib::valuekey(range(1, 10))), DropdownField::create('RegionID', 'Region')->setSource(Region::get()->map('ID', 'Title'))->setEmptyString('-- Select a region --'), CheckboxField::create('FeaturedOnHomepage', 'Feature on homepage'))); $fields->addFieldToTab('Root.Photos', $upload = UploadField::create('PrimaryPhoto', 'Primary photo')); $upload->getValidator()->setAllowedExtensions(array('png', 'jpeg', 'jpg', 'gif')); $upload->setFolderName('property-photos'); return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', $image = new UploadField('Image')); $image->setFolderName('Uploads/portfolio'); $fields->addFieldToTab('Root.Main', new CheckboxField('TextRight', 'Display the content on the right hand side')); $fields->addFieldToTab('Root.Main', new HtmlEditorField('Content')); return $fields; }
function getCMSFields() { $fields = FieldList::create(TabSet::create('Root')); $fields->addFieldToTab('Root.Main', new ReadonlyField('FirstName')); $fields->addFieldToTab('Root.Main', new ReadonlyField('LastName')); $fields->addFieldToTab('Root.Main', new ReadonlyField('Email')); $fields->addFieldToTab('Root.Main', new ReadonlyField('Phone')); $fields->addFieldToTab('Root.Main', new ReadonlyField('Message')); return $fields; }
/** * @param FieldList $fields */ public function updateCMSFields(FieldList $fields) { if (!$fields->fieldByName('Root.Settings')) { $fields->addFieldToTab('Root', TabSet::create('Settings')); } /** ----------------------------------------- * Details * ----------------------------------------*/ $fields->findOrMakeTab('Root.Settings.OpenGraph'); $fields->addFieldsToTab('Root.Settings.OpenGraph', array(HeaderField::create('', 'OOpen Graph'), UploadField::create('DefaultOpenGraphImage', 'Default Facebook Share Image'))); }
/** * getCMSFields * Construct the FieldList used in the CMS. To provide a * smarter UI we don't use the scaffolding provided by * parent::getCMSFields. * * @return FieldList */ public function getCMSFields() { Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css'); //Product Item not yet created $select_product_item = Tab::create("Item", HeaderField::create("Add Order Item"), CompositeField::create(DropdownField::create("OriginalProductID", "Select Product", Product::get()->sort("Title ASC")->map())->setEmptyString("(Select a product)"))); //Product Item has been created $edit_product_item = Tab::create("Item", HeaderField::create("Order Item"), CompositeField::create(ReadonlyField::create("Title", "Product")->setRightTitle("You will need to remove this item and add another should you wish to change the product."), ReadonlyField::create("SKU", "SKU"), FieldGroup::create(NumericField::create("Price", "Cost per item"), DropdownField::create("Discounted", "Is this the sale price?", array("0" => "No", "1" => "Yes")), NumericField::create("Quantity", "Quantity ordered"))->setTitle("Pricing (" . Product::getDefaultCurrency() . ") "), ReadonlyField::create("SubTotal", "Subtotal (" . Product::getDefaultCurrency() . ")", StoreCurrency::convertToCurrency($this->Price * $this->Quantity)), ReadonlyField::create("TAX", $this->TaxClassName . " (" . Product::getDefaultCurrency() . ")", $this->calculateItemTax())->setRightTitle($this->TaxCalculation == 1 ? "Subtotal is inclusive of this tax." : "Subtotal is exclusive of this tax."), ReadonlyField::create("Total", "Total (" . Product::getDefaultCurrency() . ")", $this->TaxCalculation == 1 ? StoreCurrency::convertToCurrency($this->Price * $this->Quantity) : StoreCurrency::convertToCurrency($this->Price * $this->Quantity + $this->calculateItemTax())))); //Create the FieldList and push the either of the above Tabs to the Root TabSet based on if Product Item exists yet or not. $fields = FieldList::create($root = TabSet::create('Root', $this->exists() ? $edit_product_item : $select_product_item)); return $fields; }
/** * @param FieldList $fields */ public function updateCMSFields(FieldList $fields) { if (!$fields->fieldByName('Root.Settings')) { $fields->addFieldToTab('Root', TabSet::create('Settings')); } /** ----------------------------------------- * Details * ----------------------------------------*/ $fields->findOrMakeTab('Root.Settings.SEO'); $fields->addFieldsToTab('Root.Settings.SEO', array(HeaderField::create('', 'SEO Settings'), TextField::create('DefaultSEOMetaTitle', 'Default Meta Title Addition')->setRightTitle('This is additional copy that will be automatically added to all of your pages\' meta titles.'), OptionsetField::create('DefaultSEOMetaTitlePosition', 'Default Meta Title Position', array('before' => 'Prepend to the Meta Title', 'after' => 'Append to the Meta Title')))); }
/** * @param FieldList $fields */ public function updateCMSFields(FieldList $fields) { if (!$fields->fieldByName('Root.Settings')) { $fields->addFieldToTab('Root', TabSet::create('Settings')); } /** ----------------------------------------- * Details * ----------------------------------------*/ $fields->findOrMakeTab('Root.Settings.TwitterCards'); $fields->addFieldsToTab('Root.Settings.TwitterCards', array(HeaderField::create('', 'Twitter Cards'), Textfield::create('DefaultTwitterHandle', 'Default Twitter Handle'), UploadField::create('DefaultTwitterImage', 'Default Twitter Card Image'))); }