/** * 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; }
function __construct($controller, $name, $speakerID, $use_actions = true) { $fields = new FieldList(); //point of contact $speakerIDfield = new HiddenField('speaker_id'); $speakerIDfield->setValue($speakerID); $fields->push($speakerIDfield); $fields->push(new TextField('org_name', 'Name of Organizer')); $fields->push(new EmailField('org_email', 'Email')); $fields->push(new TextField('event_name', 'Event')); $fields->push(new TextField('event_format', 'Format/Length')); $fields->push(new TextField('event_attendance', 'Expected Attendance (number)')); $fields->push(new TextField('event_date', 'Date of Event')); $fields->push(new TextField('event_location', 'Location')); $fields->push(new TextField('event_topic', 'Topic(s)')); $request = new HtmlEditorField('general_request', 'General Request'); $request->setRows(10); $fields->push($request); $sec_field = new TextField('field_98438688', 'field_98438688'); $sec_field->addExtraClass('honey'); $fields->push($sec_field); // Create action $actions = new FieldList(); if ($use_actions) { $actions->push(new FormAction('sendSpeakerEmail', 'Send')); } parent::__construct($controller, $name, $fields, $actions); }
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() { $oFieldExternalLink = new TextField('LinkExternalUrl', 'Externe link (opent in nieuw venster, begin met http://)', $this->LinkExternalUrl); $name = $oFieldExternalLink->getName(); $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name); $oFieldExternalLink->setName($name); $oFieldInternalLink = new SimpleTreeDropdownField('InternalUrlID', 'Interne link', 'SiteTree', $this->InternalUrlID, null, 'Kies een pagina'); $name = $oFieldInternalLink->getName(); $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name); $oFieldInternalLink->setName($name); $aSelectionGroupItems = array(new SelectionGroup_Item('none', new LiteralField('nolink', ''), 'Geen link'), new SelectionGroup_Item('internal', $oFieldInternalLink, 'Interne link'), new SelectionGroup_Item('external', $oFieldExternalLink, 'Externe link')); $fldSelectionGroup = new SelectionGroup('LinkType', $aSelectionGroupItems); // config htmleditor // make a new TinyMCE config called "footer" by copying the default ("cms") config /* $footerConfig = CustomHtmlEditorConfig::copy('simpletoolbar', 'cms'); $footerConfig->setButtonsForLine(3, array()); $footerConfig->setButtonsForLine(2, array()); */ $oFields = new FieldList(new TextField('Header', 'Titel'), $fldBody = new HtmlEditorField('Body', 'Inhoud'), new HeaderField('hdrLink', 'Link', 3), new TextField('LinkTxt', 'Tekst link'), $fldSelectionGroup); $fldBody->setRows(6); // assign the "footer" TinyMCE config to this field $fldBody->setEditorConfig('simpletoolbar'); // set the editor's body class. This will make it class="typography footer-content" $fldBody->setBodyClass('widget_text typograhy'); return $oFields; }
function __construct($controller, $name, $company) { // Define fields ////////////////////////////////////// if ($company->canEditProfile()) { $fields = new FieldList(new TextField('Name', 'Company Name'), new TextField('URL', 'Company Web Address (URL)'), new LiteralField('Break', '<p></p>'), new LiteralField('Break', '<hr/>'), $big_logo = new FileAttachmentField('BigLogo', 'Large Company Logo'), $small_logo = new FileAttachmentField('Logo', 'Small Company Logo'), new LiteralField('Break', '<p></p>'), new LiteralField('Break', '<hr/>'), new TextField('Industry', 'Industry (less than 4 Words)'), $desc = new HtmlEditorField('Description', 'Company Description'), new LiteralField('Break', '<p></p>'), $contrib = new HtmlEditorField('Contributions', 'How you are contributing to OpenStack (less than 150 words)'), new LiteralField('Break', '<p></p>'), $products = new HtmlEditorField('Products', 'Products/Services Related to OpenStack (less than 100 words)'), new LiteralField('Break', '<p></p>'), new LiteralField('Break', '<p></p>'), new ColorField("Color", "Company Color"), new LiteralField('Break', '<p></p>'), new LiteralField('Break', '<hr/>'), new TextField('ContactEmail', 'Best Contact email address (optional)'), new LiteralField('Break', '<p>This email address will be displayed on your profile and may be different than your own address.')); $desc->addExtraClass("company-description"); $contrib->addExtraClass("company-contributions"); $products->addExtraClass("company-products"); $big_logo_validator = new Upload_Image_Validator(); $big_logo_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg')); $big_logo_validator->setAllowedMaxImageWidth(500); $big_logo->setAcceptedFiles(array('jpg', 'png', 'jpeg')); $big_logo->setView('grid'); $big_logo->setFolderName('companies/main_logo'); $big_logo->setValidator($big_logo_validator); $small_logo_validator = new Upload_Image_Validator(); $small_logo_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg')); $small_logo_validator->setAllowedMaxImageWidth(200); $small_logo->setAcceptedFiles(array('jpg', 'png', 'jpeg')); $small_logo->setView('grid'); $small_logo->setFolderName('companies/main_logo'); $small_logo->setValidator($small_logo_validator); } else { if ($company->canEditLogo()) { $fields = new FieldList(new ReadonlyField('Name', 'Company Name'), new ReadonlyField('URL', 'Company Web Address (URL)'), new LiteralField('Break', '<p></p>'), new LiteralField('Break', '<hr/>'), new CustomUploadField('BigLogo', 'Large Company Logo'), new CustomUploadField('Logo', 'Small Company Logo')); } } $actionButton = new FormAction('save', 'Save Changes'); //$actionButton->addExtraClass('btn green-btn'); $actions = new FieldList($actionButton); parent::__construct($controller, $name, $fields, $actions); }
public function updateCMSFields(FieldList $fields) { /* ----------------------------------------- * Color Picker ------------------------------------------*/ Requirements::css('boilerplate/css/colorpicker.css'); Requirements::javascript('boilerplate/javascript/colorpicker.min.js'); Requirements::javascript('boilerplate/javascript/colorpicker.init.js'); /* ========================================= * Settings =========================================*/ if (!$fields->fieldByName('Root.Settings')) { $fields->addFieldToTab('Root', new TabSet('Settings')); } /* ----------------------------------------- * Images ------------------------------------------*/ $fields->findOrMakeTab('Root.Settings.Images', 'Images'); $fields->addFieldsToTab('Root.Settings.Images', array($logo = new UploadField('LogoImage', _t('BoilerplateConfig.LogoImageLabel', 'Logo')), $favicon = new UploadField('Favicon', _t('BoilerplateConfig.FaviconLabel', 'Favicon')))); $logo->setRightTitle('Choose an Image For Your Logo'); $favicon->setRightTitle('Choose an Image For Your Favicon (16x16)'); /* ----------------------------------------- * Company Details ------------------------------------------*/ $fields->findOrMakeTab('Root.Settings.Details', 'Details'); $fields->addFieldsToTab('Root.Settings.Details', array(new Textfield('Phone', _t('BoilerplateConfig.PhoneLabel', 'Phone Number')), new Textfield('Email', _t('BoilerplateConfig.EmailLabel', 'Public Email Address')), $PhysicalAddress = new HtmlEditorField('PhysicalAddress', _t('BoilerplateConfig.PhysicalAddressLabel', 'Physical Address')))); $PhysicalAddress->setRows(3); /* ----------------------------------------- * Tracking Code ------------------------------------------*/ $fields->findOrMakeTab('Root.Settings.TrackingCode', 'Tracking Code'); $fields->addFieldsToTab('Root.Settings.TrackingCode', array($trackingCode = new TextareaField('TrackingCode', _t('BoilerplateConfig.TrackingCodeLabel', 'Tracking Code')))); $trackingCode->setRows(20); }
public function testSavingLinksWithoutHref() { $obj = $this->objFromFixture('HtmlEditorFieldTest_Object', 'home'); $editor = new HtmlEditorField('Content'); $editor->setValue('<p><a name="example-anchor"></a></p>'); $editor->saveInto($obj); $this->assertEquals('<p><a name="example-anchor"></a></p>', $obj->Content, 'Saving a link without a href attribute works'); }
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; }
function updateCMSFields(FieldList $fields) { $fields->addFieldToTab('Root.Resourses', $he = new HtmlEditorField("ResoursesContent", "Content")); $he->setRows(7); $options = $this->owner->Resourses(); $gridFieldConfig = GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), new GridFieldAddNewButton('toolbar-header-right'), new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(10), new GridFieldEditButton(), new GridFieldDeleteAction(), new GridFieldDetailForm(), new GridFieldSortableRows('SortOrder')); $itemsTable = new GridField("Resourses", "Resourses", $options, $gridFieldConfig); $fields->addFieldToTab('Root.Resourses', $itemsTable); }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->insertAfter($submitted = new HtmlEditorField('AfterSubmissionContent'), 'Content'); $submitted->setRows(20); $submitted->setRightTitle('Displayed after a user submits a game for approval'); $fields->insertAfter($loggedOut = new HtmlEditorField('LoggedOutMessage'), 'Content'); $loggedOut->setRows(20); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('Name'); $fields->removeByName('OwnerID'); $fields->removeByName('ParentID'); $fields->addFieldToTab('Root.Main', $caption = new HtmlEditorField('Caption')); $caption->setRows(5); $fields->addFieldToTab('Root.Main', new TextField('SortOrder')); return $fields; }
public function testBrokenLinkHighlighting() { $sitetree = new SiteTree(); $editor = new HtmlEditorField('Content'); $editor->setValue('<a href="[sitetree_link id=0]">Broken Link</a>'); $element = new SimpleXMLElement(html_entity_decode((string) new SimpleXMLElement($editor->Field()))); $this->assertContains('ss-broken', (string) $element['class'], 'A broken link class is added to broken links'); $editor->setValue(sprintf('<a href="[sitetree_link id=%d]">Working Link</a>', $this->idFromFixture('SiteTree', 'home'))); $element = new SimpleXMLElement(html_entity_decode((string) new SimpleXMLElement($editor->Field()))); $this->assertNotContains('ss-broken', (string) $element['class']); }
function __construct($controller, $name, $use_actions = true) { $fields = new FieldList(); //point of contact $fields->push($point_of_contact_name = new TextField('point_of_contact_name', 'Name')); $fields->push($point_of_contact_email = new EmailField('point_of_contact_email', 'Email')); //main info $fields->push($title = new TextField('title', 'Title')); $fields->push($url = new TextField('url', 'Url')); $fields->push(new CheckboxField('is_coa_needed', 'Is COA needed?')); $fields->push($ddl_type = new DropdownField('job_type', 'Job Type', JobType::get()->sort("Type")->map("ID", "Type"))); $ddl_type->setEmptyString("--SELECT A JOB TYPE --"); $fields->push($description = new HtmlEditorField('description', 'Description')); $fields->push($instructions = new HtmlEditorField('instructions', 'Instructions To Apply')); $fields->push($expiration_date = new TextField('expiration_date', 'Expiration Date')); $fields->push($company = new CompanyField('company', 'Company')); $point_of_contact_name->addExtraClass('job_control'); $point_of_contact_email->addExtraClass('job_control'); $title->addExtraClass('job_control'); $url->addExtraClass('job_control'); $description->addExtraClass('job_control'); $instructions->addExtraClass('job_control'); $expiration_date->addExtraClass('job_control'); $company->addExtraClass('job_control'); //location $ddl_locations = new DropdownField('location_type', 'Location Type', array('N/A' => 'N/A', 'Remote' => 'Remote', 'Various' => 'Add a Location')); $ddl_locations->addExtraClass('location_type'); $ddl_locations->addExtraClass('job_control'); $fields->push($ddl_locations); $fields->push($city = new TextField('city', 'City')); $fields->push($state = new TextField('state', 'State')); $fields->push($country = new CountryDropdownField('country', 'Country')); $city->addExtraClass('physical_location'); $state->addExtraClass('physical_location'); $country->addExtraClass('physical_location'); // Guard against automated spam registrations by optionally adding a field // that is supposed to stay blank (and is hidden from most humans). // The label and field name are intentionally common ("username"), // as most spam bots won't resist filling it out. The actual username field // on the forum is called "Nickname". $fields->push(new TextField('user_name', 'UserName')); // Create action $actions = new FieldList(); if ($use_actions) { $actions->push(new FormAction('saveJobRegistrationRequest', 'Save')); } // Create validators $validator = new ConditionalAndValidationRule([new HtmlPurifierRequiredValidator('title', 'instructions', 'description'), new RequiredFields('job_type', 'point_of_contact_name', 'point_of_contact_email')]); $this->addExtraClass('job-registration-form'); $this->addExtraClass('input-form'); parent::__construct($controller, $name, $fields, $actions, $validator); }
/** * @return FieldList */ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->push(TextField::create("Title")); $fields->push(HtmlEditorField::create("HTML", "Content")); return $fields; }
public function getCMSFields() { Requirements::css('widgetify/css/widgetify_cms.css'); Requirements::javascript('framework/thirdparty/jquery/jquery.js'); Requirements::javascript('widgetify/scripts/widgetify_page.js'); $fields = parent::getCMSFields(); $fields->push(HiddenField::create('WidgetifyContent', 'WidgetifyContent')); $fields->push(HiddenField::create('ThisID', 'ThisID', $this->ID)); $tab = $fields->findOrMakeTab('Root.Main'); $tab->insertAfter(HeaderField::create('WidgetifyTitle', 'Widgetify Template', 3), 'Metadata'); if (!$this->WidgetifyTemplateID) { $this->WidgetifyTemplateID = 0; } $templatesMap = DataList::create('WidgetifyTemplate')->map(); $tab->insertAfter(DropdownField::create('WidgetifyTemplateID', 'Select Template', $templatesMap)->setEmptyString('- Select -'), 'WidgetifyTitle'); $tab->insertAfter(CheckboxField::create('CSSFrontend', 'Apply template Stylesheet to front-end page'), 'WidgetifyTemplateID'); $tab->insertAfter(CheckboxField::create('JSFrontend', 'Apply template Javascript to front-end page'), 'CSSFrontend'); $tab->insertAfter(HeaderField::create('WidgetifyPreviewTitle', 'Widgetify Content', 3), 'JSFrontend'); $tab->insertAfter(LiteralField::create('WidgetifyPreview', '<div id="widgetifyPreview" class="widgetifyTemplate"></div>'), 'WidgetifyPreviewTitle'); $htmlField = HtmlEditorField::create('WidgetDynamicContent', false); $editorFieldContents = ' <div id="WidgetDynamicContentHolder" class="WidgetDynamicContentHolder"> <p id="edit-widget-title">Edit content</p>' . $htmlField->forTemplate() . ' <p class="widget-edit-actions"> <a href="javascript:;" id="save-widget-content" class="ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary">Update</a> <a href="javascript:;" id="cancel-widget-content" class="ss-ui-action-destructive ui-button ui-widget ui-state-default ui-button-text-icon-primary ui-corner-left ss-ui-button">Cancel</a> </p> </div>'; $tab->insertAfter(LiteralField::create('WidgetDynamicContentPlaceHolder', $editorFieldContents), 'WidgetifyPreview'); $fields->removeFieldFromTab('Root.Main', 'Content'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.Main", array(OptionsetField::create('Status', 'Status', array("1" => "Active", "0" => "Disabled"), 1), TextField::create('AdminTitle')->setDescription('This field is for adminisration use only and will not display on the site.'), TextareaField::create('Title', 'Title')->setRows(2), HtmlEditorField::create('Content', 'Content'))); $this->extend('updateCMSFields', $fields); return $fields; }
public function getCMSFields() { $return = parent::getCMSFields(); $return->addFieldsToTab('Root.Main', [new ColorPaletteField('BackgroundColor', $this->fieldLabel('BackgroundColor'), ['grey-light' => '#F6F6F6', 'white' => '#FFF', 'blue-dark' => '#015790'])], 'Content'); $return->addFieldToTab('Root.Main', HtmlEditorField::create('AfterContent', 'Text to appear after the sponsors')); return $return; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Title', 'Content', 'URLSegment', 'MenuTitle')); $fields->addFieldsToTab('Root.Main', array(HtmlEditorField::create('Content', 'Content'), HtmlEditorField::create('Content_cn', 'Content_cn'), UploadField::create('Images', 'Images', $this->Images())->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'))->setAllowedMaxFileNumber(5)->setFolderName('AboutImages')), 'Metadata'); return $fields; }
public function getCMSFields() { $fields = FieldList::create(TextField::create('Title'), HtmlEditorField::create('Description'), $uploader = UploadField::create('Photo')); $uploader->setFolderName('region-photos'); $uploader->getValidator()->setAllowedExtensions(array('png', 'gif', 'jpeg', 'jpg')); return $fields; }
public function Field($properties = array()) { // Load TinyMCE if needed if (isset(self::$scenarios[$this->scenario]['fields'])) { $fields = self::$scenarios[$this->scenario]['fields']; foreach ($fields as $field) { if (isset($field['type']) && $field['type'] == 'htmleditor') { HtmlEditorField::include_js(); break; } } } // Assets Requirements::css(SimpleListFieldDir . '/forms/SimpleListField/css/SimpleListField.css'); Requirements::javascript(SimpleListFieldDir . '/forms/SimpleListField/js/jquery.serializejson.min.js'); Requirements::javascript(SimpleListFieldDir . '/forms/SimpleListField/js/SimpleListField.js'); // Set attributes $this->setAttribute('type', 'hidden'); $this->addExtraClass('hide'); if ($this->scenario) { $this->setAttribute('data-scenario', (string) $this->scenario); // heading if (isset(self::$scenarios[$this->scenario]['heading']) && !self::$scenarios[$this->scenario]['heading']) { $this->setAttribute('data-heading', 0); } else { $this->setAttribute('data-heading', 1); } // fields if (isset(self::$scenarios[$this->scenario]['fields']) && self::$scenarios[$this->scenario]['fields'] && is_array(self::$scenarios[$this->scenario]['fields'])) { $this->setAttribute('data-fields', json_encode(self::$scenarios[$this->scenario]['fields'])); } } // Render the fields return $this->customise($properties)->renderWith($this->getTemplates()); }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName(array('SortOrder', 'Pic', 'UID')); $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('Visible', _t('FacebookPost.VISIBLE', 'Is visible?')), DatetimeField_Readonly::create('Date', _t('FacebookPost.DATE', 'Posted on')), NumericField_Readonly::create('Likes', _t('FacebookPost.LIKES', 'Likes')), HtmlEditorField::create('Message', _t('FacebookPost.MESSAGE', 'Text'))->setRows(10))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Title', 'Content', 'MenuTitle')); $fields->addFieldsToTab('Root.Main', array(TextField::create('Title', 'Title'), TextField::create('Title_cn', 'Title_cn'), HtmlEditorField::create('Content', 'Content'), HtmlEditorField::create('Content_cn', 'Content_cn'), DateField::create('Date', 'Date')->setConfig('showcalendar', true)), 'URLSegment'); return $fields; }
/** * @param FieldList $fields * @return FieldList */ public function updateCMSFields(FieldList $fields) { $fields->removeByName('Content'); /** @var HtmlEditorField $content */ $fields->addFieldToTab('Root.Main', $content = HtmlEditorField::create('Content', _t('BoilerplatePageExtension.Content', 'Content')), 'Metadata'); $content->setRows(20); }
public function __construct($name, $title = null, $value = '') { parent::__construct($name, $title, $value); $this->rows = 5; // The .htmleditor class enables TinyMCE $this->addExtraClass('htmleditor'); }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldsFromTab('Root.Main', array('Content')); $fields->addFieldsToTab('Root.Main', array(TextField::create('PolicySummary', 'Policy Summary'), HtmlEditorField::create('PolicyDetail', 'Policy Detail'), UploadField::create('PolicyImages', 'Policy Images', $this->PolicyImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage'), TextField::create('RecipeSummary', 'Recipe Summary'), HtmlEditorField::create('RecipeDetail', 'Recipe Detail'), UploadField::create('RecipeImages', 'Recipe Images', $this->RecipeImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage'), TextField::create('ReputationSummary', 'Reputation Summary'), HtmlEditorField::create('ReputationDetail', 'Reputation Detail'), UploadField::create('ReputationImages', 'Reputation Images', $this->ReputationImages())->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'))->setAllowedMaxFileNumber(6)->setFolderName('AboutPage')), 'Title'); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('OwnerID'); $fields->removeByName('ParentID'); $fields->addFieldsToTab('Root.Main', array(CheckboxField::create('Visible', _t('FacebookTimelinePic.VISIBLE', 'Is visible?')), HtmlEditorField::create('Caption', _t('FacebookTimelinePic.CAPTION', 'Message'))->setRows(10))); return $fields; }
public function getCMSFields() { $fields = parent::getCMSFields(); $tinyMce = HtmlEditorField::create('Content', _t('TextBlock.CONTENT', 'Content')); $fields->addFieldToTab('Root.Main', $tinyMce); $this->extend('updateCMSFields', $fields); return $fields; }
function updateCMSFields(FieldList $fields) { if ($this->canHaveMap()) { $reloadMessage = " "; if (!$this->owner->ShowMap) { $reloadMessage = " (save (and publish) to see additional options)"; } $fields->addFieldToTab("Root.Map", new CheckboxField("ShowMap", "Show map {$reloadMessage}")); if ($this->owner->ShowMap) { $fields->addFieldToTab("Root.Map", new CheckboxField("StaticMap", "Show map as picture only")); $fields->addFieldToTab("Root.Map", new TextField("Address")); $fields->addFieldToTab("Root.Map", new NumericField("ZoomLevel", "Zoom (1 = world, 20 = too close)")); $fields->addFieldToTab("Root.Map", $htmlEditorField = new HtmlEditorField("InfoWindowContent", "Info Window Content")); $htmlEditorField->setRows(5); } } }
public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab("Root", new Tab('CookiePolicy')); $fields->addFieldToTab('Root.CookiePolicy', CheckboxField::create("CookiePolicyIsActive")->setTitle(_t('CookiePolicy.ISACTIVE', "Is Active"))); $fields->addFieldToTab('Root.CookiePolicy', TextField::create("CookiePolicyButtonTitle")->setTitle(_t('CookiePolicy.BUTTONTITLE', "Button Title"))); $fields->addFieldToTab('Root.CookiePolicy', HtmlEditorField::create("CookiePolicyDescription")->setTitle(_t('CookiePolicy.DESCRIPTION', "Description"))); $fields->addFieldToTab('Root.CookiePolicy', DropdownField::create("CookiePolicyPosition")->setSource(singleton('SiteConfig')->dbObject('CookiePolicyPosition')->enumValues())->setTitle(_t('CookiePolicy.POSITION', "Position"))); }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->push(TextField::create("WidgetLabel", "Widget Label")); $fields->push(TextField::create("WidgetTitle", "Widget Title")); $fields->push(HtmlEditorField::create("WidgetContent", "Content")); return $fields; }