<commit_before><?php

App::uses('FormHelper', 'View/Helper');
App::uses('Set', 'Utility');

/**
 *
 * Helper CakePHP pour créer des éléments formulaires du Bootstrap Twitter version 3
 * @author Web&Cow - France
 *
 */
class BsFormHelper extends FormHelper {

/**
 * The name of the helper
 *
 * @var string
 */
	public $name = 'BsForm';

/**
 * Right settings to have 2 columns (label and inputs) with an horizontal form
 * Default value is :  3
 *
 * @var int
 */
	private $__left = 3;

/**
 * Left settings to have 2 columns (label and inputs) with an horizontal form
 * Default value is :  9
 *
 * @var int
 */
	private $__right = 9;

/**
 * Defines the type of form being created, horizontal form or inline form. Set by Bs3FormHelper::create()
 *
 * @var string
 */
	protected $_typeForm = 'horizontal';

/**
 * Defines the model of form being created. Set by Bs3FormHelper::create()
 *
 * @var string
 */
	protected $_modelForm = null;

/**
 * Return the current value of $_left
 * 
 * @return int
 */
	public function getLeft() {
		return $this->__left;
	}

/**
 * Set the value of $left
 *
 * @param int $val Left value
 * @return void
 */
	public function setLeft($val) {
		$this->__left = $val;
	}

/**
 * Return the current value of $_right
 * 
 * @return int
 */
	public function getRight() {
		return $this->__right;
	}

/**
 * Set the value of $right
 *
 * @param int $val Right value
 * @return void
 */
	public function setRight($val) {
		$this->__right = $val;
	}

/**
 * Return the current value of $_typeForm
 * 
 * @return string
 */
	protected function _getFormType() {
		return $this->_typeForm;
	}

/**
 * Set the value of $_typeForm
 *
 * @param string $val Type of the form
 * @return void
 */
	public function setFormType($val) {
		$this->_typeForm = $val;
	}

/**
 * Return the current value of $_modelForm
 * 
 * @return string
 */
	protected function _getModelForm() {
		return $this->_modelForm;
	}

/**
 * Set the value of $_typeForm
 *
 * @param string $val Model of the form
 * @return void
 */
	protected function _setModelForm($val) {
		$this->_modelForm = $val;
	}

/**
 * Returns an HTML FORM element.
 *
 * Extends of FormHelper::create() so get same options and params
 *
 * Initialize the value of $_typeForm, $_modelForm and give attribute 'role' to the form')`
 *
 * @param mixed $model The model name for which the form is being defined.
 *   If an array is passed and $options argument is empty, the array will be used as options.
 *   If `false` no model is used.
 * @param array $options An array of html attributes and options.
 * @return string An formatted opening FORM tag.
 */

	public function create($model = null, $options = array()) {
		if (!isset($options['role'])) {
			$options['role'] = 'form';
		}

		if (isset($options['class'])) {
			if (is_integer(strpos($options['class'], 'form-horizontal'))) {
				$this->setFormType('horizontal');
			} elseif (is_integer(strpos($options['class'], 'form-inline'))) {
				$this->setFormType('inline');
			}
		} else {
			$options['class'] = 'form-horizontal';
			$this->setFormType('horizontal');
		}

		$this->_setModelForm($model);

		return parent::create($model, $options);
	}<commit_msg>Ajout de l'attribut _actionForm Impact sur la fonction create<commit_after><?php

App::uses('FormHelper', 'View/Helper');
App::uses('Set', 'Utility');

/**
 *
 * Helper CakePHP pour créer des éléments formulaires du Bootstrap Twitter version 3
 * @author Web&Cow - France
 *
 */
class BsFormHelper extends FormHelper {

/**
 * The name of the helper
 *
 * @var string
 */
	public $name = 'BsForm';

/**
 * Right settings to have 2 columns (label and inputs) with an horizontal form
 * Default value is :  3
 *
 * @var int
 */
	private $__left = 3;

/**
 * Left settings to have 2 columns (label and inputs) with an horizontal form
 * Default value is :  9
 *
 * @var int
 */
	private $__right = 9;

/**
 * Defines the type of form being created, horizontal form or inline form. Set by BsFormHelper::create()
 *
 * @var string
 */
	protected $_typeForm = 'horizontal';

/**
 * Defines the model of form being created. Set by BsFormHelper::create()
 *
 * @var string
 */
	protected $_modelForm = null;

/**
 * Defines the action of form being created. Set by BsFormHelper::create()
 *
 * @var string
 */
	protected $_actionForm = null;

/**
 * Return the current value of $_left
 * 
 * @return int
 */
	public function getLeft() {
		return $this->__left;
	}

/**
 * Set the value of $left
 *
 * @param int $val Left value
 * @return void
 */
	public function setLeft($val) {
		$this->__left = $val;
	}

/**
 * Return the current value of $_right
 * 
 * @return int
 */
	public function getRight() {
		return $this->__right;
	}

/**
 * Set the value of $right
 *
 * @param int $val Right value
 * @return void
 */
	public function setRight($val) {
		$this->__right = $val;
	}

/**
 * Return the current value of $_typeForm
 * 
 * @return string
 */
	protected function _getFormType() {
		return $this->_typeForm;
	}

/**
 * Set the value of $_typeForm
 *
 * @param string $val Type of the form
 * @return void
 */
	public function setFormType($val) {
		$this->_typeForm = $val;
	}

/**
 * Return the current value of $_modelForm
 * 
 * @return string
 */
	protected function _getModelForm() {
		return $this->_modelForm;
	}

/**
 * Set the value of $_typeForm
 *
 * @param string $val Model of the form
 * @return void
 */
	protected function _setModelForm($val) {
		$this->_modelForm = $val;
	}

/**
 * Return the current value of $_actionForm
 * 
 * @return string
 */
	protected function _getActionForm() {
		return $this->_actionForm;
	}

/**
 * Set the value of $_actionForm
 *
 * @param string $val Action of the form
 * @return void
 */
	protected function _setActionForm($val) {
		$this->_actionForm = $val;
	}

/**
 * Returns an HTML FORM element.
 *
 * Extends of FormHelper::create() so get same options and params
 *
 * Initialize the value of $_typeForm, $_modelForm and give attribute 'role' to the form')`
 *
 * @param mixed $model The model name for which the form is being defined.
 *   If an array is passed and $options argument is empty, the array will be used as options.
 *   If `false` no model is used.
 * @param array $options An array of html attributes and options.
 * @return string An formatted opening FORM tag.
 */

	public function create($model = null, $options = array()) {
		if (!isset($options['role'])) {
			$options['role'] = 'form';
		}

		if (isset($options['class'])) {
			if (is_integer(strpos($options['class'], 'form-horizontal'))) {
				$this->setFormType('horizontal');
			} elseif (is_integer(strpos($options['class'], 'form-inline'))) {
				$this->setFormType('inline');
			}
		} else {
			$options['class'] = 'form-horizontal';
			$this->setFormType('horizontal');
		}

		$this->_setModelForm($model);

		if(isset($options['action'])) {
			$this->_setActionForm($options['action']);
		}

		return parent::create($model, $options);
	}
{'fraction_non_alphanumeric': 0.14404591104734576, 'fraction_numerical': 0.0022955523672883787, 'mean_word_length': 3.4628681177976954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '7432621', 'n_tokens_mistral': 2304, 'n_tokens_neox': 2200, 'n_words': 747}