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


PHP HtmlEditorField::setRows方法代码示例

本文整理汇总了PHP中HtmlEditorField::setRows方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlEditorField::setRows方法的具体用法?PHP HtmlEditorField::setRows怎么用?PHP HtmlEditorField::setRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlEditorField的用法示例。


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

示例1: FieldList

 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);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:28,代码来源:SpeakerContactForm.php

示例2: getCMSFields

 /**
  * 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;
 }
开发者ID:nzjoel,项目名称:silverstripe-userforms,代码行数:30,代码来源:UserDefinedForm.php

示例3: getCMSFields

 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;
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:25,代码来源:MenuItem.php

示例4: getCMSFields

 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;
 }
开发者ID:hamaka,项目名称:hamaka-widgets,代码行数:27,代码来源:TextWidget.php

示例5: updateCMSFields

 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);
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:34,代码来源:BoilerplateConfig.php

示例6: getCMSFields

 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;
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:8,代码来源:SliderItem.php

示例7: updateCMSFields

 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);
 }
开发者ID:helpfulrobot,项目名称:nimeso-silverstripe-page-resources,代码行数:9,代码来源:ResourseDecorator.php

示例8: getCMSFields

 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;
 }
开发者ID:helpfulrobot,项目名称:adrexia-gamesevent,代码行数:10,代码来源:SubmitGamePage.php

示例9: getCMSFields

 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;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:11,代码来源:MarketingImage.php

示例10: updateCMSFields

 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);
         }
     }
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-googlemapbasic,代码行数:17,代码来源:GoogleMapBasic.php

示例11: getCMSFields

 function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'));
     /* -----------------------------------------
         * Color Picker
        ------------------------------------------*/
     Requirements::css('boilerplate/css/colorpicker.css');
     Requirements::javascript('boilerplate/javascript/colorpicker.min.js');
     Requirements::javascript('boilerplate/javascript/colorpicker.init.js');
     $fields->addFieldToTab('Root.Main', new TabSet($name = "WidgetTabs", new Tab($title = 'Page Item', new HeaderField(_t('PageItem.PageItemTabText', 'Title')), $titleField = new TextField('Title', _t('PageItem.TitleLabel', 'Page Item Title')), new HtmlEditorField('Content', _t('PageItem.ContentLabel', 'Content'))), new Tab($title = 'Columns', new HeaderField(_t('PageItem.ColumnsTabText', 'Columns')), $columnType = new DropdownField('ColumnType', 'Column Type', array(0 => 'Default', 1 => '1/3, 2/3', 2 => '2/3, 1/3')), $columnOne = new HtmlEditorField('ColumnOne', _t('PageItem.ColumnOneLabel', 'Column One')), $columnTwo = new HtmlEditorField('ColumnTwo', _t('PageItem.ColumnTwoLabel', 'Column Two')), $columnThree = new HtmlEditorField('ColumnThree', _t('PageItem.ColumnThreeLabel', 'Column Three')), $columnFour = new HtmlEditorField('ColumnFour', _t('PageItem.ColumnFourLabel', 'Column Four'))), new Tab($title = 'Settings', new HeaderField(_t('PageItem.SettingsTabText', 'Settings (Optional)')), new CheckboxField('Padding', _t('PageItem.PaddingLabel', 'Remove Padding')), new UploadField('BackgroundImage', _t('PageItem.BackgroundImageLabel', 'Background Image')), new DropdownField('BackgroundType', _t('PageItem.BackgroundTypeLabel', 'Background Type'), array('' => 'Default', 'fixed' => 'Fixed')), new ColorField('BackgroundColor', _t('PageItem.BackgroundColorLabel', 'Background Color')))));
     $rowHeight = 20;
     $titleField->setRightTitle(_t('PageItem.WidgetTitleDescriptionText', 'Name your page item to be easily recognisable in the page item list e.g "Pricing columns"'));
     $columnOne->setRows($rowHeight);
     $columnTwo->setRows($rowHeight);
     $columnThree->setRows($rowHeight);
     $columnFour->setRows($rowHeight);
     return $fields;
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:18,代码来源:PageItem.php

示例12: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     $themes = MandrillEmail::getAvailableThemes();
     $fields->addFieldToTab('Root.Email', $html = new HtmlEditorField('EmailFooter', _t('MandrillSiteConfig.EmailFooter', 'Email Footer')));
     $html->setRows(5);
     $fields->addFieldToTab('Root.Email', $emailTheme = new DropdownField('EmailTheme', _t('MandrillSiteConfig.EmailTheme', 'Email Theme'), array_combine($themes, $themes)));
     $emailTheme->setEmptyString('');
     $fields->addFieldToTab('Root.Email', new TextField('DefaultFromEmail', _t('MandrillSiteConfig.DefaultFromEmail', 'Default From Email')));
     $fields->addFieldToTab('Root.Email', new TextField('DefaultToEmail', _t('MandrillSiteConfig.DefaultToEmail', 'Default To Email')));
     // form-extras integration
     $uploadClass = 'UploadField';
     if (class_exists('ImageUploadField')) {
         $uploadClass = 'ImageUploadField';
     }
     $fields->addFieldToTab('Root.Email', $emailLogo = new $uploadClass('EmailLogo', _t('MandrillSiteConfig.EmailLogo', 'Email Logo')));
     $emailLogo->setDescription(_t('MandrillSiteConfig.EmailLogoDesc', 'Will default to Logo if none defined'));
     return $fields;
 }
开发者ID:zarocknz,项目名称:silverstripe-mandrill,代码行数:18,代码来源:MandrillSiteConfig.php

示例13: getCMSFields

 function getCMSFields()
 {
     $fields = new FieldList();
     $fields->push(new TextField('Title', 'Title'));
     $fields->push($description = new HtmlEditorField('Description'));
     $description->setRows(5);
     $fields->push(new TextField('ButtonLink', 'Button Link'));
     $fields->push(new TextField('ButtonLabel', 'Button Label'));
     $fields->push(new TextField('SortOrder', 'Sort Order'));
     $image = new CustomUploadField('Image', 'Image');
     $image->setFolderName('marketing');
     $image->setAllowedFileCategories('image');
     $image_validator = new Upload_Validator();
     $image_validator->setAllowedExtensions(array('jpg', 'png', 'jpeg'));
     $image->setValidator($image_validator);
     $fields->push($image);
     $fields->push(new HiddenField('ParentPageID', 'ParentPageID'));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:19,代码来源:MarketingEvent.php

示例14: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertBefore(new Tab('About'), 'Settings');
     $fields->insertBefore(new Tab('Host'), 'Settings');
     // header
     $fields->removeByName('Content');
     $fields->addFieldToTab('Root.Main', $uploadField = new UploadField('HeaderPics', 'Header Pictures'));
     $uploadField->setAllowedMaxFileNumber(10);
     $uploadField->setFolderName('openstackdays');
     // About
     $fields->addFieldToTab('Root.About', $about_desc = new HtmlEditorField('AboutDescription', 'Intro Text', $this->AboutDescription));
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.About', new GridField('AboutVideos', 'Videos', $this->AboutVideos(), $config));
     // Host
     $fields->addFieldToTab('Root.Host', $host_intro = new HtmlEditorField('HostIntro', 'Intro Text', $this->HostIntro));
     $fields->addFieldToTab('Root.Host', $host_faq = new HtmlEditorField('HostFAQs', 'FAQs', $this->HostFAQs));
     $fields->addFieldToTab('Root.Host', $toolkit_text = new HtmlEditorField('ToolkitDesc', 'Toolkit Text', $this->ToolkitDesc));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('OfficialGuidelines', 'Official Guidelines', $this->OfficialGuidelines(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('PlanningTools', 'Planning Tools', $this->PlanningTools(), $config));
     $fields->addFieldToTab('Root.Host', $artwork_intro = new HtmlEditorField('ArtworkIntro', 'Artwork intro text', $this->ArtworkIntro));
     $artwork_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Artwork', 'Artwork', $this->Artwork(), $config));
     $fields->addFieldToTab('Root.Host', $collateral_intro = new HtmlEditorField('CollateralIntro', 'Collateral intro text', $this->CollateralIntro));
     $collateral_intro->setRows(4);
     $config = new GridFieldConfig_RecordEditor(10);
     $config->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('YoutubeID' => 'YoutubeID', 'Caption' => 'Caption', 'Active' => 'Active'));
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Collaterals', 'Video / Presentations / Collateral', $this->Collaterals(), $config));
     $config = new GridFieldConfig_RecordEditor(3);
     $config->addComponent(new GridFieldSortableRows('SortOrder'));
     $fields->addFieldToTab('Root.Host', new GridField('Media', 'PR / Media', $this->Media(), $config));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:42,代码来源:OpenStackDaysPage.php

示例15: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root', new TabSet('Profile', _t('MemberProfiles.PROFILE', 'Profile')));
     $fields->addFieldToTab('Root', new Tab('ContentBlocks', _t('MemberProfiles.CONTENTBLOCKS', 'Content Blocks')));
     $fields->addFieldToTab('Root', new Tab('Email', _t('MemberProfiles.Email', 'Email')));
     $fields->fieldByName('Root.Main')->setTitle(_t('MemberProfiles.MAIN', 'Main'));
     $fields->addFieldsToTab('Root.Profile', array(new Tab('Fields', _t('MemberProfiles.FIELDS', 'Fields'), new GridField('Fields', _t('MemberProfiles.PROFILEFIELDS', 'Profile Fields'), $this->Fields(), $grid = GridFieldConfig_RecordEditor::create()->removeComponentsByType('GridFieldDeleteAction')->removeComponentsByType('GridFieldAddNewButton'))), new Tab('Groups', _t('MemberProfiles.GROUPS', 'Groups'), $groups = new TreeMultiselectField('Groups', _t('MemberProfiles.GROUPS', 'Groups'), 'Group'), $selectable = new TreeMultiselectField('SelectableGroups', _t('MemberProfiles.SELECTABLEGROUPS', 'Selectable Groups'), 'Group')), new Tab('PublicProfile', _t('MemberProfiles.PUBLICPROFILE', 'Public Profile'), new GridField('Sections', _t('MemberProfiles.PROFILESECTIONS', 'Profile Sections'), $this->Sections(), GridFieldConfig_RecordEditor::create()->removeComponentsByType('GridFieldAddNewButton')->addComponent(new MemberProfilesAddSectionAction())))));
     $grid->getComponentByType('GridFieldDataColumns')->setFieldFormatting(array('Unique' => function ($val, $obj) {
         return $obj->dbObject('Unique')->Nice();
     }, 'Required' => function ($val, $obj) {
         return $obj->dbObject('Required')->Nice();
     }));
     if (class_exists('GridFieldOrderableRows')) {
         $grid->addComponent(new GridFieldOrderableRows('Sort'));
     } elseif (class_exists('GridFieldSortableRows')) {
         $grid->addComponent(new GridFieldSortableRows('Sort'));
     }
     if (!$this->AllowProfileViewing) {
         $disabledNote = new LiteralField('PublisProfileDisabledNote', sprintf('<p class="message notice">%s</p>', _t('MemberProfiles.PUBLICPROFILEDISABLED', 'Public profiles are currently disabled, you can enable them ' . 'in the "Settings" tab.')));
         $fields->insertBefore($disabledNote, 'Sections');
     }
     $groups->setDescription(_t('MemberProfiles.GROUPSNOTE', 'Any users registering via this page will always be added to ' . 'these groups (if registration is enabled). Conversely, a member ' . 'must belong to these groups in order to edit their profile on ' . 'this page.'));
     $selectable->setDescription(_t('MemberProfiles.SELECTABLENOTE', 'Users can choose to belong to these groups, if the  "Groups" field ' . 'is enabled in the "Fields" tab.'));
     $fields->removeByName('Content', true);
     $contentFields = array();
     if ($this->AllowRegistration) {
         $contentFields[] = 'Registration';
         $contentFields[] = 'AfterRegistration';
     }
     if ($this->AllowProfileEditing) {
         $contentFields[] = 'Profile';
     }
     foreach ($contentFields as $type) {
         $fields->addFieldToTab("Root.ContentBlocks", new ToggleCompositeField("{$type}Toggle", _t('MemberProfiles.' . strtoupper($type), FormField::name_to_label($type)), array(new TextField("{$type}Title", _t('MemberProfiles.TITLE', 'Title')), $content = new HtmlEditorField("{$type}Content", _t('MemberProfiles.CONTENT', 'Content')))));
         $content->setRows(15);
     }
     $fields->addFieldsToTab('Root.Email', array(new OptionsetField('EmailType', _t('MemberProfiles.EMAILSETTINGS', 'Email Settings'), array('Validation' => _t('MemberProfiles.EMAILVALIDATION', 'Require email validation'), 'Confirmation' => _t('MemberProfiles.EMAILCONFIRMATION', 'Send a confirmation email'), 'None' => _t('MemberProfiles.NONE', 'None'))), new ToggleCompositeField('EmailContentToggle', _t('MemberProfiles.EMAILCONTENT', 'Email Content'), array(new TextField('EmailSubject', _t('MemberProfiles.EMAILSUBJECT', 'Email subject')), new TextField('EmailFrom', _t('MemberProfiles.EMAILFROM', 'Email from')), new TextareaField('EmailTemplate', _t('MemberProfiles.EMAILTEMPLATE', 'Email template')), new LiteralField('TemplateNote', sprintf('<div class="field">%s</div>', MemberConfirmationEmail::TEMPLATE_NOTE)))), new ToggleCompositeField('ConfirmationContentToggle', _t('MemberProfiles.CONFIRMCONTENT', 'Confirmation Content'), array(new TextField('ConfirmationTitle', _t('MemberProfiles.TITLE', 'Title')), $confContent = new HtmlEditorField('ConfirmationContent', _t('MemberProfiles.CONTENT', 'Content'))))));
     $confContent->setRows(15);
     return $fields;
 }
开发者ID:SilbinaryWolf,项目名称:silverstripe-memberprofiles,代码行数:41,代码来源:MemberProfilePage.php


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