本文整理汇总了PHP中HTMLEditorField::create方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLEditorField::create方法的具体用法?PHP HTMLEditorField::create怎么用?PHP HTMLEditorField::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLEditorField
的用法示例。
在下文中一共展示了HTMLEditorField::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab("Root.Orders", GridField::create("OrderNotifications", "Order status notifications", $this->owner->OrderNotifications(), GridFieldConfig_RecordEditor::create()));
$fields->addFieldToTab("Root.Orders", HTMLEditorField::create("OrdersHeader", _t("Orders.QuoteInvoiceHeader", "Quote and Invoice Header")));
$fields->addFieldToTab("Root.Orders", HTMLEditorField::create("QuoteFooter"));
$fields->addFieldToTab("Root.Orders", HTMLEditorField::create("InvoiceFooter"));
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Remove fields
$fields->removeByName(array('Unique', 'Permanent', 'CanClose', 'CloseColor', 'LinkID'));
// Add fields
// Main tab
$fields->addFieldToTab("Root.Main", $test = TextField::create("ButtonText")->setTitle(_t("SiteMessage.LABELBUTTONTEXT", "Button Text")));
$fields->addFieldToTab("Root.Main", TreeDropdownField::create("PageID")->setTitle(_t("SiteMessage.LABELLINKTO", "Link to"))->setSourceObject("SiteTree"));
$fields->addFieldToTab("Root.Main", HTMLEditorField::create("Content")->setTitle(_t("SiteMessage.LABELCONTENT", "Message content"))->setRows(15));
// Design tab
$fields->addFieldToTab("Root.Design", HeaderField::create("ColorSettings")->setTitle(_t("SiteMessage.HEADERCOLORSETTINGS", "Color settings")));
$fields->addFieldToTab("Root.Design", ColorField::create("BackgroundColor")->setTitle(_t("SiteMessage.LABELBACKGROUNDCOLOR", "Background Color")));
$fields->addFieldToTab("Root.Design", ColorField::create("TextColor")->setTitle(_t("SiteMessage.LABELTEXTCOLOR", "Text Color")));
$fields->addFieldToTab("Root.Design", ColorField::create("ButtonColor")->setTitle(_t("SiteMessage.LABELBUTTONCOLOR", "Button Color")));
$fields->addFieldToTab("Root.Design", ColorField::create("ButtonTextColor")->setTitle(_t("SiteMessage.LABELBUTTONTEXTCOLOR", "Button Text Color")));
$fields->addFieldToTab("Root.Design", HeaderField::create("CloseSettings")->setTitle(_t("SiteMessage.HEADERCLOSESETTINGS", "Close button settings")));
$fields->addFieldToTab("Root.Design", FieldGroup::create(_t("SiteMessage.LABELCANCLOSE", "Show close button?"), Checkboxfield::create("CanClose", "")));
$fields->addFieldToTab("Root.Design", ColorField::create("CloseColor")->setTitle(_t("SiteMessage.LABELCLOSECOLOR", "Close button color")));
// Schedule tab
$fields->addFieldToTab("Root.Schedule", FieldGroup::create(_t("SiteMessage.LABELPERMANENT", "Is this message permanent?"), CheckboxField::create("Permanent", "")));
$fields->addFieldToTab("Root.Schedule", $Start = new DatetimeField("Start"));
$fields->addFieldToTab("Root.Schedule", $End = new DatetimeField("End"));
$Start->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "Start Date"))->getDateField('Start')->setConfig('showcalendar', TRUE);
$End->setConfig('datavalueformat', 'YYYY-MM-dd HH:mm')->setTitle(_t("SiteMessage.LABELSTART", "End Date"))->getDateField('End')->setConfig('showcalendar', TRUE);
return $fields;
}
示例3: getCMSFields
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;
}
示例4: getCMSFields
public function getCMSFields()
{
$datetimeField = DatetimeField::create("Date")->setTitle($this->fieldLabel("Date"));
$datetimeField->getDateField()->setConfig("dmyfields", true);
// Check if NewsImage should be saved in a seperate folder
if (self::config()->save_image_in_seperate_folder == false) {
$UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news");
} else {
if ($this->ID == "0") {
$UploadField = FieldGroup::create(LiteralField::create("Save", $this->fieldLabel("SaveHelp")))->setTitle($this->fieldLabel("NewsImage"));
} else {
$UploadField = UploadField::create("NewsImage")->setTitle($this->fieldLabel("NewsImage"))->setFolderName("news/" . $this->URLSegment);
}
}
// Create direct link to NewsArticle
if ($this->ID == "0") {
// Little hack to hide $urlsegment when article isn't saved yet.
$urlsegment = LiteralField::create("NoURLSegmentYet", "");
} else {
if ($NewsHolder = $this->NewsHolder()) {
$baseLink = Controller::join_links(Director::absoluteBaseURL(), $NewsHolder->Link(), $this->URLSegment);
}
$urlsegment = Fieldgroup::create(LiteralField::create("URLSegment", "URLSegment")->setContent('<a href="' . $baseLink . '" target="_blank">' . $baseLink . '</a>'))->setTitle("URLSegment");
}
$fields = FieldList::create(new TabSet("Root", new Tab("Main", $urlsegment, TextField::create("Title")->setTitle($this->fieldLabel("Title")), $datetimeField, HTMLEditorField::create("Content")->setTitle($this->fieldLabel("Content")), $UploadField)));
$this->extend("updateCMSFields", $fields);
return $fields;
}
示例5: getCMSFields
/**
* @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;
}
示例6: getCMSFields
/**
* CMS Fields
* @var FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Main", array(TextareaField::create('Title')->setRows(1), HTMLEditorField::create('Content')));
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例7: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($this->owner->ID) {
// Relation handler for Blocks
$SConfig = GridFieldConfig_RelationEditor::create(25);
$SConfig->addComponent(new GridFieldOrderableRows('SortOrder'));
$SConfig->addComponent(new GridFieldDeleteAction());
// If the copy button module is installed, add copy as option
if (class_exists('GridFieldCopyButton')) {
$SConfig->addComponent(new GridFieldCopyButton(), 'GridFieldDeleteAction');
}
$gridField = new GridField("Blocks", "Content blocks", $this->owner->Blocks(), $SConfig);
$classes = array_values(ClassInfo::subclassesFor($gridField->getModelClass()));
if (count($classes) > 1 && class_exists('GridFieldAddNewMultiClass')) {
$SConfig->removeComponentsByType('GridFieldAddNewButton');
$SConfig->addComponent(new GridFieldAddNewMultiClass());
}
if (self::$create_block_tab) {
$fields->addFieldToTab("Root.Blocks", $gridField);
} else {
// Downsize the content field
$fields->removeByName('Content');
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('Content')->setRows(self::$contentarea_rows), 'Metadata');
$fields->addFieldToTab("Root.Main", $gridField, 'Metadata');
}
}
return $fields;
}
示例8: getCMSFields
/**
* CMS Fields
* @return array
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Main", array(UploadField::create('Image')->setFolderName('Person'), TextField::create('Name'), TextField::create('Title'), TextField::create('Email'), TextField::create('Phone'), TextField::create('Mobile'), HTMLEditorField::create('Description')));
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例9: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.EnquiryForm', HeaderField::create('Enquiry Form Setup', 2));
$gridFieldConfig = GridFieldConfig_RecordEditor::create(100);
$gridFieldConfig->addComponent(new GridFieldSortableRows('SortOrder'));
/* Unset field-sorting hack */
$gridFieldConfig->getComponentByType('GridFieldSortableHeader')->setFieldSorting(array('FieldName' => 'FieldNameNoSorting', 'FieldType' => 'FieldTypeNoSorting'));
$gridField = GridField::create('EnquiryFormFields', false, $this->EnquiryFormFields(), $gridFieldConfig);
$fields->addFieldToTab('Root.EnquiryForm', $gridField);
$email_settings = array(EmailField::create('EmailTo', 'Send email to'), EmailField::create('EmailFrom', 'Send email from')->setRightTitle('For example website@yourdomain.com'), TextField::create('EmailSubject', 'Email subject'), HeaderField::create('Message on website once completed', 5), HTMLEditorField::create('EmailSubmitCompletion', '')->setRows(10), EmailField::create('EmailBcc', 'Send BCC copy to (optional)')->setRightTitle('If you would like a copy of the enquiry to be sent elsewhere, fill that in here.'), TextField::create('EmailSubmitButtonText', 'Submit button text'));
$toggleSettings = ToggleCompositeField::create('FormSettings', 'Enquiry Form Settings', $email_settings);
$fields->addFieldsToTab('Root.EnquiryForm', $toggleSettings);
$spam_settings = array();
array_push($spam_settings, DropdownField::create('AddCaptcha', 'Add captcha image (optional)', array(0 => 'No', 1 => 'Yes'))->setRightTitle('You can optionally enable an anti-spam "captcha" image.
This adds a small image with 4 random numbers which needs to be filled in correctly.'));
if (!$this->CaptchaText) {
$this->CaptchaText = 'Verification Image';
}
array_push($spam_settings, TextField::create('CaptchaText', 'Field name'));
array_push($spam_settings, TextField::create('CaptchaHelp', 'Captcha help (optional)')->setRightTitle('If you would like to explain what the captcha is, please explain briefly what it is.
This is only used if you have selected to add the captcha image.'));
$toggleSpam = ToggleCompositeField::create('SpamSettings', 'Anti-Spam Settings', $spam_settings);
$fields->addFieldsToTab('Root.EnquiryForm', $toggleSpam);
return $fields;
}
示例10: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
$fields->insertBefore(DropdownField::create('Type', 'Type', $this->dbObject('Type')->enumValues()), 'Intro');
return $fields;
}
示例11: getCMSFields
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;
}
示例12: getCMSFields
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;
}
示例13: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertBefore(TextareaField::create('Intro', 'Intro'), 'Content');
$fields->insertAfter(ColorPaletteField::create("Colour", "Colour", array('night' => '#333333', 'air' => '#009EE2', 'earth' => ' #79c608', 'passion' => '#b02635', 'people' => '#de347f', 'inspiration' => '#783980')), "Intro");
$fields->insertBefore($image = UploadField::create('SplashImage', 'Splash Image'), 'Content');
$image->setFolderName('Uploads/Splash-Images');
if ($this->ClassName === "Page" || $this->ClassName === "HomePage") {
$fields->insertAfter(HTMLEditorField::create('ExtraContent'), 'Content');
$gridField = new GridField('FeatureItems', 'FeatureItems', $this->FeatureItems()->sort(array('Sort' => 'ASC', 'Archived' => 'ASC')), $config = GridFieldConfig_RelationEditor::create());
$gridField->setModelClass('FeatureItem');
$fields->addFieldToTab('Root.Features', $gridField);
$config->addComponent(new GridFieldOrderableRows());
} else {
if ($this->ClassName === "CalendarPage") {
$content = $fields->dataFieldByName('Content');
$content->addExtraClass('no-pagebreak');
$events = Event::get()->sort(array('StartDateTime' => 'Desc'))->filterByCallback(function ($record) {
return !$record->getIsPastEvent();
});
$gridField = new GridField('Event', 'Upcoming Events', $events, $config = GridFieldConfig_RecordEditor::create());
$gridField->setModelClass('Event');
$dataColumns = $config->getComponentByType('GridFieldDataColumns');
$dataColumns->setDisplayFields(array('Title' => 'Title', 'StartDateTime' => 'Date and Time', 'DatesAndTimeframe' => 'Presentation String'));
$fields->addFieldToTab('Root.UpcomingEvents', $gridField);
}
}
return $fields;
}
示例14: updateCMSFields
/**
* Update CMS fields
*
* @param FieldList $fields
* @return FieldList
*/
public function updateCMSFields(FieldList $fields)
{
$fields = $this->getContactfields($fields);
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('CopyrightText', 'Copyright')->setRows(20));
$fields->addFieldToTab('Root.Main', UploadField::create('Logo', 'Logo'));
$fields->addFieldToTab('Root.FooterMenus', GridField::create('FooterMenus', 'Footer Menus', $this->owner->FooterMenus(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
$fields->addFieldToTab('Root.SocialMediaServices', GridField::create('SocialMediaServices', 'Social Icons', $this->owner->SocialMediaServices(), GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldSortableRows('SortOrder'))));
}
示例15: updateCMSFields
/**
* @todo fix sortorder
*
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
/** Setup new Root Fieldlist */
$fields->removeByName('Main');
$owner = $this->owner;
/** Add the fields */
$fields->addFieldsToTab('Root', Tab::create('Main', _t('Tag.MAIN', 'Main'), $text = TextField::create('Title', $owner->fieldLabel('Title')), $html = HTMLEditorField::create('Description', $owner->fieldLabel('Description')), $uplo = UploadField::create('Impression', $owner->fieldLabel('Impression'))));
}