本文整理汇总了PHP中TextareaField::setRows方法的典型用法代码示例。如果您正苦于以下问题:PHP TextareaField::setRows方法的具体用法?PHP TextareaField::setRows怎么用?PHP TextareaField::setRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextareaField
的用法示例。
在下文中一共展示了TextareaField::setRows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fieldBody = new TextareaField('Body', 'Inhoud');
$fieldBody->setRows(5);
$oFields = new FieldList(new TextField('Header', 'Title'), $fieldBody, new TextField('FieldLabelName', 'Dummy text in name field'), new TextField('FieldLabelEmail', 'Dummy text in email field'), new TextField('BtnLabel', 'Button label'));
if (Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys) == NewsLetterWidget_Storage_Sys_Mailchimp) {
$fldTextFieldListId = new TextField('MailChimpListID', 'Mailchimp lijst id');
$sApiKey = Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys_Mailchimp_APIKey);
if ($sApiKey == null || trim($sApiKey) == '') {
$oFields->push($fldTextFieldListId);
} else {
// fetch lists
$api = new MCAPI($sApiKey);
$retval = $api->lists();
if ($api->errorCode) {
//echo "Unable to load lists()!";
//echo "\n\tCode=".$api->errorCode;
//echo "\n\tMsg=".$api->errorMessage."\n";
} else {
//echo "Lists that matched:".$retval['total']."\n";
//echo "Lists returned:".sizeof($retval['data'])."\n";
$aOptions = array();
foreach ($retval['data'] as $list) {
//echo "Id = ".$list['id']." - ".$list['name']."\n";
//echo "Web_id = ".$list['web_id']."\n";
$aOptions[$list['id']] = $list['name'];
}
$oFields->push(new DropdownField('MailChimpListID', 'Mailchimp lijst id', $aOptions));
}
}
}
return $oFields;
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = new FieldList();
$fields->push(new TabSet('Root', new Tab('Main', _t('SiteTree.TABMAIN', 'Main'), new TextField('Title', _t('UniadsObject.db_Title', 'Title')))));
if ($this->ID) {
$previewLink = Director::absoluteBaseURL() . 'admin/' . UniadsAdmin::config()->url_segment . '/UniadsObject/preview/' . $this->ID;
$fields->addFieldToTab('Root.Main', new ReadonlyField('Impressions', _t('UniadsObject.db_Impressions', 'Impressions')), 'Title');
$fields->addFieldToTab('Root.Main', new ReadonlyField('Clicks', _t('UniadsObject.db_Clicks', 'Clicks')), 'Title');
$fields->addFieldsToTab('Root.Main', array(DropdownField::create('CampaignID', _t('UniadsObject.has_one_Campaign', 'Campaign'), DataList::create('UniadsCampaign')->map())->setEmptyString(_t('UniadsObject.Campaign_none', 'none')), DropdownField::create('ZoneID', _t('UniadsObject.has_one_Zone', 'Zone'), DataList::create('UniadsZone')->map())->setEmptyString(_t('UniadsObject.Zone_select', 'select one')), new NumericField('Weight', _t('UniadsObject.db_Weight', 'Weight (controls how often it will be shown relative to others)')), new TextField('TargetURL', _t('UniadsObject.db_TargetURL', 'Target URL')), new Treedropdownfield('InternalPageID', _t('UniadsObject.has_one_InternalPage', 'Internal Page Link'), 'Page'), new CheckboxField('NewWindow', _t('UniadsObject.db_NewWindow', 'Open in a new Window')), $file = new UploadField('File', _t('UniadsObject.has_one_File', 'Advertisement File')), $AdContent = new TextareaField('AdContent', _t('UniadsObject.db_AdContent', 'Advertisement Content')), $Starts = new DateField('Starts', _t('UniadsObject.db_Starts', 'Starts')), $Expires = new DateField('Expires', _t('UniadsObject.db_Expires', 'Expires')), new NumericField('ImpressionLimit', _t('UniadsObject.db_ImpressionLimit', 'Impression Limit')), new CheckboxField('Active', _t('UniadsObject.db_Active', 'Active')), new LiteralField('Preview', '<a href="' . $previewLink . '" target="_blank">' . _t('UniadsObject.Preview', 'Preview this advertisement') . "</a>")));
$app_categories = File::config()->app_categories;
$file->setFolderName($this->config()->files_dir);
$file->getValidator()->setAllowedMaxFileSize(array('*' => $this->config()->max_file_size));
$file->getValidator()->setAllowedExtensions(array_merge($app_categories['image'], $app_categories['flash']));
$AdContent->setRows(10);
$AdContent->setColumns(20);
$Starts->setConfig('showcalendar', true);
$Starts->setConfig('dateformat', i18n::get_date_format());
$Starts->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('showcalendar', true);
$Expires->setConfig('dateformat', i18n::get_date_format());
$Expires->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('min', date('Y-m-d', strtotime($this->Starts ? $this->Starts : '+1 days')));
}
$this->extend('updateCMSFields', $fields);
return $fields;
}
示例3: getFieldConfiguration
public function getFieldConfiguration()
{
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML");
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
}
示例4: 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);
}
示例5: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->replaceField('ItemTemplate', $ta = new TextareaField('ItemTemplate', _t('ListingTemplate.ITEM_TEMPLATE', 'Item Template (use the Items variable to iterate over)')));
$ta->setRows(20);
$ta->setColumns(120);
return $fields;
}
示例6: getFieldConfiguration
public function getFieldConfiguration()
{
$customSettings = unserialize($this->CustomSettings);
$content = isset($customSettings['Content']) ? $customSettings['Content'] : '';
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML", $content);
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
}
示例7: getFieldConfiguration
public function getFieldConfiguration()
{
$customSettings = unserialize($this->CustomSettings);
$content = isset($customSettings['Content']) ? $customSettings['Content'] : '';
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML", $content);
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField);
}
示例8: getFormField
/**
* @return TextareaField|TextField
*/
public function getFormField()
{
if ($this->getSetting('Rows') && $this->getSetting('Rows') > 1) {
$taf = new TextareaField($this->Name, $this->Title);
$taf->setRows($this->getSetting('Rows'));
return $taf;
} else {
return new TextField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
}
}
示例9: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($this->owner->MediaType != __CLASS__) {
return;
}
$thumbField = $this->owner->getUploadField('ThumbnailImage', 'Thumbnail (optional - will grab from YouTube)', SitePhoto::$allowed_file_types, 'images');
$posterField = $this->owner->getUploadField('PosterImage', 'Poster Image (optional - will grab from YouTube)', SitePhoto::$allowed_file_types, 'images');
$fields->addFieldsToTab('Root.Main', array(new TextField('YouTubeVideoID', 'YouTube Video ID'), $caption = new TextareaField('Caption'), $thumbField, $posterField));
$caption->setRows(1);
}
示例10: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
if ($this->disableEditor) {
$tfa = new TextareaField('HTML');
$tfa->setRows(30);
$tfa->setColumns(150);
$fields->addFieldToTab('Root.Main', $tfa);
}
return $fields;
}
示例11: getCMSFields
/**
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', $dateTimeField = new DatetimeField('Date', $this->fieldLabel('Date')), 'Content');
$dateTimeField->getDateField()->setConfig('showcalendar', true);
$fields->addfieldToTab('Root.Main', $abstractField = new TextareaField('Abstract', $this->fieldLabel('Abstract')), 'Content');
$abstractField->setAttribute('maxlength', '160');
$abstractField->setRightTitle(_t('DateUpdatePage.AbstractDesc', 'The abstract is used as a summary on the listing pages. It is limited to 160 characters.'));
$abstractField->setRows(6);
return $fields;
}
示例12: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab('Root.Main.Metadata', $keywordsField = new TextareaField('MetaKeywords', 'Meta Keywords'), "ExtraMeta");
$fields->addFieldToTab('Root.Main.Metadata', new TextField('MetaTitle', 'Meta Title'), 'MetaDescription');
foreach (array('MetaTitle', 'MetaDescription', 'MetaKeywords') as $MetaFieldName) {
$oldField = $fields->dataFieldByName($MetaFieldName);
$oldField->setTitle($oldField->Title() . '<span class="field_count">' . strlen($this->owner->{$MetaFieldName}) . '</span>');
}
$keywordsField->setRows(1);
if (permission::check('ADMIN')) {
$fields->addFieldToTab("Root.Main", new CheckboxField("NoFollow", "Set nav link to no-follow?"), "MetaDescription");
$fields->addFieldToTab('Root.Main.Metadata', new TextareaField('URLRedirects', '301 Redirects'));
}
return $fields;
}
示例13: Form
function Form()
{
if ($this->request->requestVar('_REDIRECT_BACK_URL')) {
$url = $this->request->requestVar('_REDIRECT_BACK_URL');
} else {
if ($this->request->getHeader('Referer')) {
$url = $this->request->getHeader('Referer');
} else {
$url = Director::baseURL();
}
}
$folder = Folder::find_or_make("ErrorScreenshots");
$whatDidYouTryDoField = new TextareaField('WhatDidYouTryToDo', 'What did you try to do');
$whatDidYouTryDoField->setRows(3);
$whatWentWrongField = new TextareaField('WhatWentWrong', 'What went wrong');
$whatWentWrongField->setRows(3);
$screenshotField = new FileField('Screenshot', 'To take a screenshot press the PRT SCR button on your keyboard, then open MS Word or MS Paint and paste the screenshot. Save the file and then attach (upload) the file here.');
$screenshotField->setFolderName($folder->Name);
$form = new Form($this, 'Form', new FieldList(new TextField('Name'), new TextField('Email'), new TextField('URL', 'What is the URL of the page the error occured (this is the address shown in the address bar (e.g. http://www.mysite.com/mypage/with/errors/)', $url), $whatDidYouTryDoField, $whatWentWrongField, $screenshotField), new FieldList(new FormAction('senderror', 'Submit Error')), new RequiredFields(array("Email", "Name")));
return $form;
}
示例14: LinkedFileViewForm
/**
* Return the linked file view form, which shows a readonly form that contains the
* source text of the file being viewed.
* @throws Exception
* @return Form
*/
public function LinkedFileViewForm()
{
// grab the parameters
if (isset($_REQUEST['ID'])) {
$id = addslashes($_REQUEST['ID']);
} else {
throw new Exception("invalid ID");
}
// Extract parameters from this ID. It's base 64 of
// templateID:path
$id = base64_decode($id);
$params = explode(':', $id);
if (count($params) != 2) {
throw Exception("Invalid params, expected 2 components");
}
$dynamicTemplateId = $params[0];
$path = $params[1];
$form = new Form($this, "LinkedFileViewForm", new FieldList(new LabelField("Filename", "File: " . $path), $sourceTextField = new TextareaField("SourceText", ""), new HiddenField('ID', 'ID'), new HiddenField('BackURL', 'BackURL', $this->Link())), new FieldList(new FormAction('cancelFileEdit', _t('DynamicTemplate.CANCELFILEEDIT', 'Cancel'))));
$form->setTemplate('FilesEditorForm');
// Get the contents of the file
$contents = file_get_contents(BASE_PATH . $path);
$sourceTextField->setRows(20);
$sourceTextField->setColumns(150);
$sourceTextField->setValue($contents);
$form->HelpType = null;
return $form;
}
示例15: setDeployConfigurationFields
/**
*
* @param FieldList $fields
*/
protected function setDeployConfigurationFields(&$fields)
{
if (!$this->config()->get('allow_web_editing')) {
return;
}
if ($this->envFileExists()) {
$deployConfig = new TextareaField('DeployConfig', 'Deploy config', $this->getEnvironmentConfig());
$deployConfig->setRows(40);
$fields->insertAfter($deployConfig, 'ArchiveDownloaders');
return;
}
$noDeployConfig = new LabelField('noDeployConfig', 'Warning: This environment don\'t have deployment configuration.');
$noDeployConfig->addExtraClass('message warning');
$fields->insertAfter($noDeployConfig, 'Filename');
$createConfigField = new CheckboxField('CreateEnvConfig', 'Create Config');
$createConfigField->setDescription('Would you like to create the capistrano deploy configuration?');
$fields->insertAfter($createConfigField, 'noDeployConfig');
}