当前位置: 首页>>代码示例>>PHP>>正文


PHP HTMLEditorField类代码示例

本文整理汇总了PHP中HTMLEditorField的典型用法代码示例。如果您正苦于以下问题:PHP HTMLEditorField类的具体用法?PHP HTMLEditorField怎么用?PHP HTMLEditorField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HTMLEditorField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", $editor = new HTMLEditorField('Content', 'Intro Text'), "Metadata");
     $editor->setRows(20);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:purplespider-section-overview,代码行数:7,代码来源:SectionOverviewPage.php

示例2: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab("Root.PageElements", $editor = new HTMLEditorField($name = "CopyrightNotice", $title = "Copyright notice."));
     $fields->addFieldToTab("Root.PageElements", new UploadField($name = "BackgroundImage", $title = "Background Image"));
     $editor->setRows(10);
     return $fields;
 }
开发者ID:sunnysideup,项目名称:mysite_ssu_flava,代码行数:7,代码来源:SiteConfigExtras.php

示例3: getFieldConfiguration

 public function getFieldConfiguration()
 {
     $textAreaField = new HTMLEditorField($this->getSettingName('Content'), "HTML", $this->getContent());
     $textAreaField->setRows(4);
     $textAreaField->setColumns(20);
     return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
 }
开发者ID:sekjal,项目名称:silverstripe-userforms,代码行数:7,代码来源:EditableLiteralField.php

示例4: updateCMSFields

 function updateCMSFields(FieldList $fields)
 {
     $footerTabName = 'Root.' . _t('SiteConfig.FOOTER', 'Footer');
     $fields->addFieldToTab($footerTabName, $h1 = new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));
     $options1 = singleton('SiteConfig')->dbObject('ColumnStart')->EnumValues();
     $options2 = singleton('SiteConfig')->dbObject('ColumnWidth')->EnumValues();
     $columnStartField = new DropdownField('ColumnStart', _t('SiteConfig.FOOTER_TEXT_START_COLUMN', 'Which column (of four) should the footer text start in', $options1));
     $columnWidthField = new DropdownField('ColumnStart', _t('SiteConfig.FOOTER_TEXT_WIDTH_COLUMN', 'How many, of four columns, should the footer text take up', $options2));
     //$fields->addFieldToTab("Root.Footer", $columnStartField);
     //$fields->addFieldToTab("Root.Footer", $h1=new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));
     $h1->setRows(6);
 }
开发者ID:gordonbanderson,项目名称:footer-text,代码行数:12,代码来源:FooterTextSiteConfig.php

示例5: 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;
 }
开发者ID:adrexia,项目名称:nzlarps,代码行数:7,代码来源:ProjectListingPage.php

示例6: 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;
 }
开发者ID:andrewhoule,项目名称:silverstripe-listpage,代码行数:26,代码来源:ListItem.php

示例7: 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;
 }
开发者ID:helpfulrobot,项目名称:sheadawson-silverstripe-notifications,代码行数:35,代码来源:SystemNotification.php

示例8: 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;
 }
开发者ID:helpfulrobot,项目名称:arnhoe-silverstripe-simplenews,代码行数:28,代码来源:NewsArticle.php

示例9: 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;
 }
开发者ID:tcaiger,项目名称:mSupplyNZ,代码行数:7,代码来源:Download.php

示例10: 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"));
 }
开发者ID:helpfulrobot,项目名称:i-lateral-silverstripe-orders,代码行数:7,代码来源:OrdersSiteConfigExtension.php

示例11: 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;
    }
开发者ID:axllent,项目名称:silverstripe-enquiry-page,代码行数:26,代码来源:EnquiryPage.php

示例12: 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;
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-payme,代码行数:7,代码来源:PayMePage.php

示例13: 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;
 }
开发者ID:helpfulrobot,项目名称:christohill-silverstripe-sitemessages,代码行数:27,代码来源:SiteMessage.php

示例14: 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;
 }
开发者ID:Design-Collective,项目名称:Silverstripe-Content-Blocks,代码行数:28,代码来源:ContentBlocksModule.php

示例15: 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;
 }
开发者ID:adrexia,项目名称:nzlarps,代码行数:29,代码来源:Page.php


注:本文中的HTMLEditorField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。