function getCMSFields() { $fields = parent::getCMSFields(); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('IndustryName' => 'IndustryName', 'Active' => 'Active')); $industries = new GridField('UserStoriesIndustry', 'User Stories Industry', UserStoriesIndustry::get(), $config); $fields->addFieldsToTab('Root.Industries', $industries); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('UserStory.Title' => 'UserStory', 'UserStoriesIndustry.IndustryName' => 'Industry')); $Featured = new GridField('UserStoriesFeatured', 'User Stories Featured', UserStoriesFeatured::get(), $config); $fields->addFieldsToTab('Root.FeaturedStories', $Featured); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('LinkName' => 'LinkName', 'UserStory.Title' => 'UserStory')); $links = new GridField('UserStoriesLink', 'User Stories Link', UserStoriesLink::get(), $config); $fields->addFieldsToTab('Root.Links', $links); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Topic' => 'Topic')); $topics = new GridField('UserStoriesTopics', 'User Stories Topics', UserStoriesTopics::get(), $config); $fields->addFieldsToTab('Root.Topics', $topics); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('UserStoriesTopics.Topic' => 'Topic', 'LabelTitle' => 'Title')); $TopicsFeatured = new GridField('UserStoriesTopicsFeatured', 'User Stories Topics Featured', UserStoriesTopicsFeatured::get(), $config); $fields->addFieldsToTab('Root.FeaturedOnSlider', $TopicsFeatured); $config = GridFieldConfig_RecordEditor::create(); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Type' => 'Type', 'Content' => 'Content')); $slides = new GridField('UserStoriesSlides', 'User Stories Slides', UserStoriesSlides::get(), $config); $fields->addFieldsToTab('Root.Slides', $slides); return $fields; }
public function getCMSFields() { $DefaultAlbumCoverField = UploadField::create('DefaultAlbumCover'); $DefaultAlbumCoverField->folderName = "PhotoGallery"; $DefaultAlbumCoverField->getValidator()->allowedExtensions = array('jpg', 'jpeg', 'gif', 'png'); $fields = parent::getCMSFields(); $AlbumsGridField = new GridField("PhotoAlbums", "Album", $this->PhotoAlbums(), GridFieldConfig::create()->addComponent(new GridFieldToolbarHeader())->addComponent(new GridFieldAddNewButton('toolbar-header-right'))->addComponent(new GridFieldSortableHeader())->addComponent(new GridFieldDataColumns())->addComponent(new GridFieldPaginator(50))->addComponent(new GridFieldEditButton())->addComponent(new GridFieldDeleteAction())->addComponent(new GridFieldDetailForm())->addComponent(new GridFieldFilterHeader())->addComponent($sortable = new GridFieldSortableRows('SortID'))); if ($this->AlbumDefaultTop == true) { $sortable->setAppendToTop(true); } $fields->addFieldToTab("Root.Albums", $AlbumsGridField); $fields->addFieldToTab("Root.Config", HeaderField::create("Album Settings")); $fields->addFieldToTab("Root.Config", $DefaultAlbumCoverField); $fields->addFieldToTab("Root.Config", SliderField::create('AlbumsPerPage', 'Number of Albums Per Page', 1, 25)); $fields->addFieldToTab("Root.Config", SliderField::create("AlbumThumbnailWidth", "Album Cover Thumbnail Width", 50, 400)); $fields->addFieldToTab("Root.Config", SliderField::create("AlbumThumbnailHeight", "Album Cover Thumbnail Height", 50, 400)); $fields->addFieldToTab("Root.Config", CheckboxField::create("ShowAllPhotoAlbums")->setTitle("Show photo album even if it's empty")); $fields->addFieldToTab("Root.Config", CheckboxField::create("AlbumDefaultTop")->setTitle("Sort new albums to the top by default")); $fields->addFieldToTab("Root.Config", HeaderField::create("Photo Settings")); $fields->addFieldToTab("Root.Config", SliderField::create("PhotosPerPage", "Number of Photos Per Page", 1, 50)); $fields->addFieldToTab("Root.Config", SliderField::create("PhotoThumbnailWidth", "Photo Thumbnail Width", 50, 400)); $fields->addFieldToTab("Root.Config", SliderField::create("PhotoThumbnailHeight", "Photo Thumbnail Height", 50, 400)); $fields->addFieldToTab("Root.Config", SliderField::create("PhotoFullWidth", "Photo Fullsize Width", 400, 1200)); $fields->addFieldToTab("Root.Config", SliderField::create("PhotoFullHeight", "Photo Fullsize Height", 400, 1200)); $fields->addFieldToTab("Root.Config", CheckboxField::create("PhotoDefaultTop")->setTitle("Sort new photos to the top by default")); return $fields; }
/** * Setup the CMS Fields for the User Defined Form * * @return FieldSet */ public function getCMSFields() { $fields = parent::getCMSFields(); // field editor $fields->addFieldToTab("Root.Content."._t('UserDefinedForm.FORM', 'Form'), new FieldEditor("Fields", 'Fields', "", $this )); // view the submissions $fields->addFieldToTab("Root.Content."._t('UserDefinedForm.SUBMISSIONS','Submissions'), new SubmittedFormReportField( "Reports", _t('UserDefinedForm.RECEIVED', 'Received Submissions'), "", $this ) ); // who do we email on submission $emailRecipients = new ComplexTableField( $this, 'EmailRecipients', 'UserDefinedForm_EmailRecipient', array( 'EmailAddress' => 'Email', 'EmailSubject' => 'Subject', 'EmailFrom' => 'From' ), 'getCMSFields_forPopup', "FormID = '$this->ID'" ); $emailRecipients->setAddTitle(_t('UserDefinedForm.AEMAILRECIPIENT', 'A Email Recipient')); $fields->addFieldToTab("Root.Content."._t('UserDefinedForm.EMAILRECIPIENTS', 'Email Recipients'), $emailRecipients); // text to show on complete $onCompleteFieldSet = new FieldSet( new HtmlEditorField( "OnCompleteMessage", _t('UserDefinedForm.ONCOMPLETELABEL', 'Show on completion'),3,"",_t('UserDefinedForm.ONCOMPLETEMESSAGE', $this->OnCompleteMessage), $this ) ); $fields->addFieldsToTab("Root.Content."._t('UserDefinedForm.ONCOMPLETE','On complete'), $onCompleteFieldSet); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); // Main Content tab // Carousel tab $carouselItemsGrid = null; // Manay to many relations can only be established if we have an id. So put a place holder instead of a grid if this is a new object. if ($this->ID == 0) { $carouselItemsGrid = TextField::create("CarouselItems", "Carousel Items")->setDisabled(true)->setValue("Page must be saved once before adding Carousel Items."); } else { $carouselItemsGrid = new GridField('CarouselItems', 'Carousel', $this->CarouselItems()->sort('Archived'), GridFieldConfig_RelationEditor::create()); $carouselItemsGridUploadComponent = new GridFieldBulkUpload("Image"); $carouselItemsGridUploadComponent->setUfSetup("setFolderName", $this->ImageFolder("carousel")); $carouselItemsGrid->setModelClass('CarouselItem')->getConfig()->addComponent($carouselItemsGridUploadComponent)->addComponent(new GridFieldOrderableRows("SortID")); } $fields->addFieldToTab('Root.Carousel', $carouselItemsGrid); // Links $fields->addFieldToTab('Root.Links', new TreeDropdownField('LearnMorePageID', 'Page to link the "Learn More" button to:', 'SiteTree')); $fields->addFieldToTab('Root.Links', new TextField('LearnMoreButtonText', 'Text to display on the "Learn More" button:', 'SiteTree')); $quickLinksGrid = new GridField('Quicklinks', 'Quicklinks', $this->Quicklinks(), GridFieldConfig_RelationEditor::create()); $quickLinksGrid->setModelClass('Quicklink'); $quickLinksFieldGroup = FieldGroup::create($quickLinksGrid)->setTitle('Quick Links'); $quickLinksFieldGroup->setName("QuicklinkGroup"); $fields->addFieldToTab('Root.Links', $quickLinksFieldGroup); $fields->removeByName('Translations'); $fields->removeByName('Import'); $fields->addFieldToTab('Root.Features', ToggleCompositeField::create('FeatureOne', _t('SiteTree.FeatureOne', 'Feature One'), array(new TextField('FeatureOneTitle', 'Title'), new DropdownField('FeatureOneCategory', 'Category', singleton('ExpressHomePage')->dbObject('FeatureOneCategory')->enumValues()), new HTMLEditorField('FeatureOneContent', 'Content'), new TreeDropdownField('FeatureOneLinkID', 'Page to link to', 'SiteTree'), new TextField('FeatureOneButtonText', 'Button text')))->setHeadingLevel(3)); $fields->addFieldToTab('Root.Features', ToggleCompositeField::create('FeatureTwo', _t('SiteTree.FeatureTwo', 'Feature Two'), array(new TextField('FeatureTwoTitle', 'Title'), new DropdownField('FeatureTwoCategory', 'Category', singleton('ExpressHomePage')->dbObject('FeatureTwoCategory')->enumValues()), new HTMLEditorField('FeatureTwoContent', 'Content'), new TreeDropdownField('FeatureTwoLinkID', 'Page to link to', 'SiteTree'), new TextField('FeatureTwoButtonText', 'Button text')))->setHeadingLevel(3)); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Title', 'Content', 'URLSegment', 'MenuTitle')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Phone', 'Phone'), TextField::create('Fax', 'Fax'), TextField::create('Address', 'Address')), 'Metadata'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab("Root.Main", new LiteralField("Desc", "<h2>First Child Redirect Page</h2><p>This page automatically redirects to it's first child page.</p>")); $fields->removeFieldFromTab("Root.Main", "Content"); return $fields; }
function getCMSFields() { $fields = parent::getCMSFields(); $f = new SortableGalleryField('Images', 'My Images'); $fields->addFieldToTab('Root.Images', $f); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.SuccessContent", array(TextField::create("Currency"), TextField::create("SuccessTitle"), HTMLEditorField::create("SuccessContent"))); $fields->addFieldToTab("Root.Invoices", GridField::create("Invoices", "Invoices", $this->Invoices(), GridFieldConfig_RecordEditor::create())); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); // Remove content since this page redirects to first consultation $fields->removeByName('Content'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $manager = new GridField('CommMembers', 'CommMember', $this->CommMembers()); $fields->addFieldToTab("Root.CommMembers", $manager); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('PageBuilder'); /* ========================================= * Images =========================================*/ $fields->addFieldToTab('Root.Main', new UploadField('Image'), 'Content'); /* ========================================= * Menu Item Details =========================================*/ $fields->addFieldToTab('Root.Main', $price = new CurrencyField('Price'), 'Content'); $price->setRightTitle('To add extra price options e.g Small, Large please add a variation under the "Variations" tab above'); $fields->addFieldToTab('Root.Main', $ingredients = new HtmlEditorField('Ingredients'), 'Metadata'); $ingredients->setRows(15); /* ========================================= * Variations =========================================*/ $config = GridFieldConfig_RelationEditor::create(10); $config->addComponent(new GridFieldSortableRows('SortOrder'))->addComponent(new GridFieldDeleteAction()); $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title' => 'Title', 'Price' => 'Price')); $gridField = new GridField('Variations', 'Variations', $this->owner->MenuVariations(), $config); $fields->addFieldToTab('Root.Variations', $gridField); return $fields; }
public function getCMSFields() { $f = parent::getCMSFields(); $homes = Home::get(); $f->addFieldToTab('Root.Homes', new GridField('HomeGrid', 'Homes', $homes, GridFieldConfig_RelationEditor::create())); return $f; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', $image = new UploadField('Image', _t('TestimonialPage.ImageLabel', 'Image')), 'Content'); $image->setFolderName('Uploads/testimonials'); return $fields; }
/** * Setup the CMS Fields for the User Defined Form * * @return FieldSet */ public function getCMSFields() { $fields = parent::getCMSFields(); // define tabs $fields->findOrMakeTab('Root.Form', _t('UserDefinedForm.FORM', 'Form')); $fields->findOrMakeTab('Root.Options', _t('UserDefinedForm.OPTIONS', 'Options')); $fields->findOrMakeTab('Root.EmailRecipients', _t('UserDefinedForm.EMAILRECIPIENTS', 'Email Recipients')); $fields->findOrMakeTab('Root.OnComplete', _t('UserDefinedForm.ONCOMPLETE', 'On Complete')); $fields->findOrMakeTab('Root.Submissions', _t('UserDefinedForm.SUBMISSIONS', 'Submissions')); // field editor $fields->addFieldToTab("Root.Form", new FieldEditor("Fields", 'Fields', "", $this)); // view the submissions $fields->addFieldToTab("Root.Submissions", new CheckboxField('DisableSaveSubmissions', _t('UserDefinedForm.SAVESUBMISSIONS', "Disable Saving Submissions to Server"))); $fields->addFieldToTab("Root.Submissions", new SubmittedFormReportField("Reports", _t('UserDefinedForm.RECEIVED', 'Received Submissions'), "", $this)); UserDefinedForm_EmailRecipient::$summary_fields = array('EmailAddress' => _t('UserDefinedForm.EMAILADDRESS', 'Email'), 'EmailSubject' => _t('UserDefinedForm.EMAILSUBJECT', 'Subject'), 'EmailFrom' => _t('UserDefinedForm.EMAILFROM', 'From')); // who do we email on submission $emailRecipients = new GridField("EmailRecipients", "EmailRecipients", $this->EmailRecipients(), GridFieldConfig_RecordEditor::create(10)); $fields->addFieldToTab("Root.EmailRecipients", $emailRecipients); // text to show on complete $onCompleteFieldSet = new FieldList($editor = new HtmlEditorField("OnCompleteMessage", _t('UserDefinedForm.ONCOMPLETELABEL', 'Show on completion'), _t('UserDefinedForm.ONCOMPLETEMESSAGE', $this->OnCompleteMessage))); $editor->setRows(3); $fields->addFieldsToTab("Root.OnComplete", $onCompleteFieldSet); $fields->addFieldsToTab("Root.Options", $this->getFormOptions()); return $fields; }
/** * Returns a FieldList with which to create the main editing form. * * @return FieldList The fields to be displayed in the CMS. */ public function getCMSFields() { // Get the CMS fields $fields = parent::getCMSFields(); // Update the existing fields with labels $nameField = $fields->dataFieldByName("Title"); if ($nameField) { $nameField->setRightTitle("Staff members name (John Smith etc)"); } // Add the fields to the CMS $fields->addFieldToTab("Root.Main", TextField::create("Position", _t("StaffProfilePage.PositionTitle", "Position")), "Content"); $fields->addFieldToTab("Root.Main", EmailField::create("Email", _t("StaffProfilePage.EmailTitle", "Email address")), "Content"); $fields->addFieldToTab("Root.Main", TextField::create("Phone", _t("StaffProfilePage.PhoneTitle", "Phone")), "Content"); $fields->addFieldToTab("Root.Categories", GridField::create("Categories", _t("StaffProfilePage.CategoriesTitle", "Categories"), $this->Categories(), StaffProfilePage_Category::getGridFieldConfig())); // Add the thumbnail field $uploadField = UploadField::create("Thumbnail", _t("StaffProfilePage.ThumbnailTitle", "Thumbnail")); $uploadField->setFolderName('Staff'); $uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); $sizeMB = 0.3; // MB $size = $sizeMB * 1024 * 1024; // Bytes $uploadField->getValidator()->setAllowedMaxFileSize($size); $fields->addFieldToTab("Root.Main", $uploadField, "Content"); $this->extend('updateCMSFields', $fields); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); if ($this->ID) { // Summit Images $summitImageField = singleton('SummitImage')->getCMSFields(); $config = GridFieldConfig_RelationEditor::create(); $config->getComponentByType('GridFieldDetailForm')->setFields($summitImageField); $gridField = new GridField('SummitImage', 'SummitImage', SummitImage::get(), $config); $fields->addFieldToTab('Root.SummitPageImages', $gridField); // Summit Image has_one selector $dropdown = DropdownField::create('SummitImageID', 'Please choose an image for this page', SummitImage::get()->map("ID", "Title", "Please Select"))->setEmptyString('(None)'); $fields->addFieldToTab('Root.Main', $dropdown); $fields->addFieldsToTab('Root.Main', $ddl_summit = new DropdownField('SummitID', 'Summit', Summit::get()->map('ID', 'Name'))); $ddl_summit->setEmptyString('(None)'); } $fields->addFieldsToTab('Root.Main', new TextField('HeroCSSClass', 'Hero CSS Class')); //Google Conversion Tracking params $fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionId", "Conversion Id", "994798451")); $fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionLanguage", "Conversion Language", "en")); $fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionFormat", "Conversion Format", "3")); $fields->addFieldToTab("Root.GoogleConversionTracking", new ColorField("GAConversionColor", "Conversion Color", "ffffff")); $fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionLabel", "Conversion Label", "IuM5CK3OzQYQ89at2gM")); $fields->addFieldToTab("Root.GoogleConversionTracking", new TextField("GAConversionValue", "Conversion Value", "0")); $fields->addFieldToTab("Root.GoogleConversionTracking", new CheckboxField("GARemarketingOnly", "Remarketing Only")); //Facebook Conversion Params $fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBPixelId", "Pixel Id", "6013247449963")); $fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBValue", "Value", "0.00")); $fields->addFieldToTab("Root.FacebookConversionTracking", new TextField("FBCurrency", "Currency", "USD")); //Twitter $fields->addFieldToTab("Root.TwitterConversionTracking", new TextField("TwitterPixelId", "Pixel Id", "l5lav")); return $fields; }
function getCMSFields() { $fields = parent::getCMSFields(); $signInsTable = new GridField('EventSignIns', 'Events SignIn', $this->EventSignIns()); $fields->addFieldToTab('Root.SignIns', $signInsTable); return $fields; }
public function getCMSFields() { $f = parent::getCMSFields(); $member = TeamMember::get(); $f->addFieldToTab('Root.Team', new GridField('TeamGrid', 'Team', $member, GridFieldConfig_RelationEditor::create())); return $f; }
function getCMSFields() { $fields = parent::getCMSFields(); // Summit Video Stream $VideoLiveField = new OptionSetField('VideoCurrentlyPlaying', 'Is the video live streaming at the moment?', array('Yes' => 'Video is being streamed.', 'No' => 'No video playing.')); $fields->addFieldToTab("Root.Main", new TextField('LiveStreamURL', 'URL of Live Stream Feed')); $SummitModeField = new OptionSetField('SummitMode', 'Homepage mode:', array(0 => 'Normal Mode', 1 => 'Summit Mode')); $fields->addFieldToTab("Root.Main", new TextField('NextPresentationStartTime', 'Next Presentation Start Time')); $fields->addFieldToTab("Root.Main", new TextField('NextPresentationStartDate', 'Next Presentation Start Date')); $fields->addFieldToTab("Root.Main", $VideoLiveField, 'Content'); $fields->addFieldToTab("Root.Main", $SummitModeField, 'Content'); // Countdown Date $EventStartDate = new DateField('EventDate', 'First Day of Event (for counting down)'); $EventStartDate->setConfig('showcalendar', true); $EventStartDate->setConfig('showdropdown', true); $fields->addFieldToTab('Root.Main', $EventStartDate, 'Content'); // remove unneeded fields $fields->removeFieldFromTab("Root.Main", "Content"); $promo_hero_image = new CustomUploadField('PromoImage', 'Promo Hero Image'); $promo_hero_image->setFolderName('homepage'); $promo_hero_image->setAllowedFileCategories('image'); $fields->addFieldToTab("Root.IntroHeader", $promo_hero_image); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoIntroMessage', 'Promo Intro Message')); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoButtonText', 'Promo Button Text')); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoButtonUrl', 'Promo Button Url')); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoDatesText', 'Promo Dates Text')); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoHeroCredit', 'Hero Credit')); $fields->addFieldToTab("Root.IntroHeader", new TextareaField('PromoHeroCreditUrl', 'Hero Credit Url')); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); // Add the sermon audio member ID $fields->addFieldToTab('Root.Main', new TextField('SermonAudioMemberId', 'SermonAudio.com Member ID'), 'Content'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextField('CurrencySymbol'), 'Content'); $fields->addFieldToTab('Root.Main', new CurrencyField('Balance'), 'Content'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Image', new UploadField('MainImage')); $fields->addFieldToTab('Root.Layout', new CheckboxField('LinkToIndividualStaffPages', 'If biographies are short, leave this as false to only show a single page of staff')); return $fields; }
function getCMSFields() { $fields = parent::getCMSFields(); // Create a default configuration for the new GridField, allowing record deletion $config = GridFieldConfig_RecordEditor::create(); // Set the names and data for our gridfield columns $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title' => 'Title', 'StartTime' => 'Start Time', 'EndTime' => 'End Time')); // Create a gridfield to hold the calendar event relationship $calendarEventsGridField = new GridField('CalendarEvents', 'Calendar Events', $this->CalendarEvents(), $config); // Create a tab named "Calendar" and add our field to it $fields->addFieldToTab('Root.Calendar', $calendarEventsGridField); // Create a default configuration for the location GridField, allowing record deletion $locationsConfig = GridFieldConfig::create(); $locationsConfig->addComponent(new GridFieldButtonRow('before')); $locationsConfig->addComponent(new GridFieldToolbarHeader()); $locationsConfig->addComponent(new GridFieldTitleHeader()); $locationsConfig->addComponent(new GridFieldEditableColumns()); $locationsConfig->addComponent(new GridFieldDeleteAction()); $locationsConfig->addComponent(new GridFieldAddNewInlineButton()); // Create a gridfield to hold the locations $locationsGridField = new GridField('CalendarLocations', 'Calendar Locations', $this->CalendarLocations(), $locationsConfig); // Create a tab named "Locations" and add our field to it $fields->addFieldToTab('Root.Locations', $locationsGridField); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'Content'); $fields->addFieldToTab('Root.Main', new ExternalTreeDropdownField('ExternalContentRoot', _t('ExternalContentPage.CONTENT_SOURCE', 'External Content Source'), 'ExternalContentSource')); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $badge = new UploadField('Badge', _t('ScoutGroup.BADGE', 'Badge')); $badge->setFolderName('group/badge'); $badge->setRightTitle(_t('ScoutGroup.BADGE_HELP', 'The badge/logo/emblem of the Group'))->addExtraClass('help'); $fields->addFieldToTab('Root.Info', $badge); $necker = new UploadField('Necker', _t('ScoutGroup.NECKER', 'Necker')); $necker->setFolderName('group/necker'); $necker->setRightTitle(_t('ScoutGroup.NECKER_HELP', 'The neckerchief the Group'))->addExtraClass('help'); $fields->addFieldToTab('Root.Info', $necker); $fields->addFieldToTab('Root.Info', new TextField('NeckerDescription', _t('ScoutGroup.NECKERDESCRIPTION', 'Neckerchief Description'))); $fields->addFieldToTab('Root.Social', new TextField('TwitterUser', _t('ScoutGroup.TWITTERUSER', 'Twitter User'))); $fields->addFieldToTab('Root.Social', new TextField('FacebookPage', _t('ScoutGroup.FACEBOOKPAGE', 'Facebook Page'))); $fields->addFieldToTab('Root.Social', new TextField('GooglePage', _t('ScoutGroup.GOOGLEPAGE', 'Google Page'))); $fields->addFieldToTab('Root.Contact', new TextField('Address1', _t('ScoutGroup.ADDRESS1', 'Address 1'))); $fields->addFieldToTab('Root.Contact', new TextField('Address2', _t('ScoutGroup.ADDRESS2', 'Address 2'))); $fields->addFieldToTab('Root.Contact', new TextField('Address3', _t('ScoutGroup.ADDRESS3', 'Address 3'))); $fields->addFieldToTab('Root.Contact', new TextField('Town', _t('ScoutGroup.TOWN', 'Town'))); $fields->addFieldToTab('Root.Contact', new TextField('Postcode', _t('ScoutGroup.POSTCODE', 'Post Code'))); $fields->addFieldToTab('Root.Contact', new TextField('Phone', _t('ScoutGroup.PHONE', 'Phone #'))); $fields->addFieldToTab('Root.Contact', new TextField('Email', _t('ScoutGroup.EMAIL', 'Email Address'))); $fields->addFieldToTab('Root.Contact', new TextField('CharityNumber', _t('ScoutGroup.CHARITYNUMBER', 'CharityNumber'))); $sectionGridConfig = new GridFieldConfig_RecordEditor(); $sectionGridConfig->addComponent(new GridFieldSortableRows('SortOrder')); $sectionGrid = new GridField('Sections', 'Sections', $this->Sections(), $sectionGridConfig); $fields->addFieldToTab('Root.Sections', $sectionGrid); $this->extend('updateCMSFields', $fields); return $fields; }
function getCMSFields() { Requirements::javascript('blog/javascript/bbcodehelp.js'); Requirements::themedCSS('bbcodehelp'); $firstName = Member::currentUser() ? Member::currentUser()->FirstName : ''; $codeparser = new BBCodeParser(); $fields = parent::getCMSFields(); if(!self::$allow_wysiwyg_editing) { $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Main", new TextareaField("Content", _t("BlogEntry.CN", "Content"), 20)); } $fields->addFieldToTab("Root.Content.Main", new PopupDateTimeField("Date", _t("BlogEntry.DT", "Date")),"Content"); $fields->addFieldToTab("Root.Content.Main", new TextField("Author", _t("BlogEntry.AU", "Author"), $firstName),"Content"); if(!self::$allow_wysiwyg_editing) { $fields->addFieldToTab("Root.Content.Main", new LiteralField("BBCodeHelper", "<div id='BBCode' class='field'>" . "<a id=\"BBCodeHint\" target='new'>" . _t("BlogEntry.BBH", "BBCode help") . "</a>" . "<div id='BBTagsHolder' style='display:none;'>".$codeparser->useable_tagsHTML()."</div></div>")); } $fields->addFieldToTab("Root.Content.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content"); return $fields; }
function getCMSFields() { $fields = parent::getCMSFields(); // this is what shows int he tab with the table in it /* $tablefield = new HasOneComplexTableField( $this, 'FlickrSetForPage', 'FlickrSet', array( 'Title' => 'Title' ), 'getCMSFields_forPopup' ); $tablefield->setParentClass('FLickrSetPage'); */ $gridConfig = GridFieldConfig_RelationEditor::create()->addComponent(new GridFieldSortableRows('SortOrder')); $gridConfig->getComponentByType('GridFieldAddExistingAutocompleter')->setSearchFields(array('URL', 'Title', 'Description')); //$gridField = new GridField( "Links", "List of Links:", $this->Links()->sort( 'SortOrder' ), $gridConfig ); //$fields->addFieldToTab( "Root.Links", $gridField ); $fields->addFieldToTab('Root.Main', new HTMLEditorField('Description', 'Description'), 'Content'); //fields->addFieldToTab( 'Root.FlickrSet', $tablefield ); //$dropdown = new DropdownField('FlickrSetFolderID', 'Flickr Set Folder', FlickrSetFolder::get()->map('ID','Title'); /* $dropdown->setEmptyString('-- Please Select One --'); $fields->addFieldToTab('Root.ParentGallery', $dropdown ); */ return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Profiles', GridField::create('Profiles', 'Profiles on this page', $this->Profiles(), GridFieldConfig_RecordEditor::create())); $fields->addFieldToTab('Root.Main', TextField::create('Subheading', 'Page Subheading'), 'Content'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', new TextAreaField('TransactionsCSV'), 'Content'); $fields->addFieldToTab('Root.Transactions', new GridField('Transactions', 'Transactions', GnuCashTransactionObject::get())); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab("Root", $subscriptionTab = new Tab(_t('Newsletter.SUBSCRIPTIONFORM', 'SubscriptionForm'))); Requirements::javascript('newsletter/javascript/SubscriptionPage.js'); Requirements::css('newsletter/css/SubscriptionPage.css'); $subscriptionTab->push(new HeaderField("SubscriptionFormConfig", _t('Newsletter.SUBSCRIPTIONFORMCONFIGURATION', "Subscription Form Configuration"))); $subscriptionTab->push(new TextField('CustomisedHeading', 'Heading at the top of the form')); //Fields selction $frontFields = singleton('Recipient')->getFrontEndFields()->dataFields(); $fieldCandidates = array(); if (count($frontFields)) { foreach ($frontFields as $fieldName => $dataField) { $fieldCandidates[$fieldName] = $dataField->Title() ? $dataField->Title() : $dataField->Name(); } } //Since Email field is the Recipient's identifier, //and newsletters subscription is non-sence if no email is given by the user, //we should force that email to be checked and required. //FisrtName should be checked as default, though it might not be required $defaults = array("Email", "FirstName"); $extra = array('CustomLabel' => "Varchar", "ValidationMessage" => "Varchar", "Required" => "Boolean"); $extraValue = array('CustomLabel' => $this->CustomLabel, "ValidationMessage" => $this->ValidationMessage, "Required" => $this->Required); $subscriptionTab->push($fieldsSelection = new CheckboxSetWithExtraField("Fields", _t('Newsletter.SelectFields', "Select the fields to display on the subscription form"), $fieldCandidates, $extra, $defaults, $extraValue)); $fieldsSelection->setCellDisabled(array("Email" => array("Value", "Required"))); //Mailing Lists selection $mailinglists = MailingList::get(); $newsletterSelection = $mailinglists && $mailinglists->count() ? new CheckboxSetField("MailingLists", _t("Newsletter.SubscribeTo", "Newsletters to subscribe to"), $mailinglists->map('ID', 'FullTitle'), $mailinglists) : new LiteralField("NoMailingList", sprintf('<p>%s</p>', sprintf('You haven\'t defined any mailing list yet, please go to ' . '<a href=\\"%s\\">the newsletter administration area</a> ' . 'to define a mailing list.', singleton('NewsletterAdmin')->Link()))); $subscriptionTab->push($newsletterSelection); $subscriptionTab->push(new TextField("SubmissionButtonText", "Submit Button Text")); $subscriptionTab->push(new LiteralField('BottomTaskSelection', sprintf('<div id="SendNotificationControlls" class="field actions">' . '<label class="left">%s</label>' . '<ul><li class="ss-ui-button no" data-panel="no">%s</li>' . '<li class="ss-ui-button yes" data-panel="yes">%s</li>' . '</ul></div>', _t('Newsletter.SendNotif', 'Send notification email to the subscriber'), _t('Newsletter.No', 'No'), _t('Newsletter.Yes', 'Yes')))); $subscriptionTab->push(CompositeField::create(new HiddenField("SendNotification", "Send Notification"), new TextField("NotificationEmailSubject", _t('Newsletter.NotifSubject', "Notification Email Subject Line")), new TextField("NotificationEmailFrom", _t('Newsletter.FromNotif', "From Email Address for Notification Email")))->addExtraClass('SendNotificationControlledPanel')); $subscriptionTab->push(new HtmlEditorField('OnCompleteMessage', _t('Newsletter.OnCompletion', 'Message shown on subscription completion'))); return $fields; }