<commit_before><?php
/**
 * EditableTextField
 *
 * This control represents a user-defined text field in a user defined form
 *
 * @package userforms
 */

class EditableTextField extends EditableFormField {

	static $singular_name = 'Text field';
	
	static $plural_name = 'Text fields';
	
	function getFieldConfiguration() {
		$fields = parent::getFieldConfiguration();
		
		// eventually replace hard-coded "Fields"?
		$baseName = "Fields[$this->ID]";
		
		$minLength = ($this->getSetting('MinLength')) ? $this->getSetting('MinLength') : '';
		$maxLength = ($this->getSetting('MaxLength')) ? $this->getSetting('MaxLength') : '';
		$rows = ($this->getSetting('Rows')) ? $this->getSetting('Rows') : '1';
		
		$extraFields = new FieldSet(
			new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'),
				new TextField($baseName . "[CustomSettings][MinLength]", "", $minLength),
				new TextField($baseName . "[CustomSettings][MaxLength]", " - ", $maxLength)
			),
			new TextField($baseName . "[CustomSettings][Rows]", _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows)
		);
		
		$fields->merge($extraFields);
		return $fields;		
	}

	/**
	 * @return TextareaField|TextField
	 */
	function getFormField() {
		if($this->getSetting('Rows') && $this->getSetting('Rows') > 1) {
			return new TextareaField($this->Name, $this->Title, $this->getSetting('Rows'));
		}
		else {<commit_msg>MINOR: use title case for EditableTextField. Fixes http://open.silverstripe.org/ticket/5799<commit_after><?php
/**
 * EditableTextField
 *
 * This control represents a user-defined text field in a user defined form
 *
 * @package userforms
 */

class EditableTextField extends EditableFormField {

	static $singular_name = 'Text Field';
	
	static $plural_name = 'Text Fields';
	
	function getFieldConfiguration() {
		$fields = parent::getFieldConfiguration();
		
		// eventually replace hard-coded "Fields"?
		$baseName = "Fields[$this->ID]";
		
		$minLength = ($this->getSetting('MinLength')) ? $this->getSetting('MinLength') : '';
		$maxLength = ($this->getSetting('MaxLength')) ? $this->getSetting('MaxLength') : '';
		$rows = ($this->getSetting('Rows')) ? $this->getSetting('Rows') : '1';
		
		$extraFields = new FieldSet(
			new FieldGroup(_t('EditableTextField.TEXTLENGTH', 'Text length'),
				new TextField($baseName . "[CustomSettings][MinLength]", "", $minLength),
				new TextField($baseName . "[CustomSettings][MaxLength]", " - ", $maxLength)
			),
			new TextField($baseName . "[CustomSettings][Rows]", _t('EditableTextField.NUMBERROWS', 'Number of rows'), $rows)
		);
		
		$fields->merge($extraFields);
		return $fields;		
	}

	/**
	 * @return TextareaField|TextField
	 */
	function getFormField() {
		if($this->getSetting('Rows') && $this->getSetting('Rows') > 1) {
			return new TextareaField($this->Name, $this->Title, $this->getSetting('Rows'));
		}
		else {
{'fraction_non_alphanumeric': 0.18001392757660167, 'fraction_numerical': 0.002785515320334262, 'mean_word_length': 4.780684104627767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '225789', 'n_tokens_mistral': 966, 'n_tokens_neox': 863, 'n_words': 181}