<commit_before><?php

class Ml_Form_SignUp extends Twitter_Bootstrap_Form_Horizontal
{
    public function init()
    {
        $url = $this->getView()->url(array(), "join");
        $this->setAction($url);
        $this->setMethod('post');

        $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', 
        Zend_Form_Element::VALIDATE);
        $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', 
        Zend_Form_Element::FILTER);
        
        $this->addElement('text', 'name', array(
            'label'      => 'Nome:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(1, 50))
                )
        ));
        
        $email = $this->addElement('text', 'email', array(
            'label'      => 'Endereço de email:',
            'required'   => true,
            'description' =>
                '<small>Leia a <a href="/privacy" rel="external">'.
                'Política de privacidade</a> antes de continuar</small>',
            'filters'    => array('StringTrim', 'StringToLower'),
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(1, 60)),
                array('validator' => 'emailNewUser'),//stringlenght there also
                array('validator' => 'EmailAddress')
                )
        ));
        
        $this->addElement(Ml_Model_AntiAttack::captchaElement());
        
        $this->addElement('submit', 'submit', array(
            'label'    => 'Cadastrar',
            'class'    => 'btn btn-primary btn-large',
        ));

        $this->addDisplayGroup(
            array('submit', 'reset'),
            'actions',
            array(
                'disableLoadDefaultDecorators' => true,
                'decorators' => array('Actions')
            )<commit_msg>refactor the sign up form<commit_after><?php

class Ml_Form_SignUp extends Twitter_Bootstrap_Form_Horizontal
{
    protected $_config = null;

    /**
     * @param null $options
     * @param Zend_Config array $config
     */
    public function __construct($options = null, array $config)
    {
        $this->_config = $config;

        return parent::__construct($options);
    }

    public function init()
    {
        $this->setMethod('post');

        if ($this->_config['ssl']) {
            $url = 'https://' . $this->_config['webhostssl'];
        } else {
            $url = '';
        }

        $url .= $this->getView()->url(array(), "join");
        $this->setAction($url);

        $this->setMethod('post');

        $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', 
        Zend_Form_Element::VALIDATE);
        $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', 
        Zend_Form_Element::FILTER);
        
        $this->addElement('text', 'name', array(
            'label'      => 'Nome:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(1, 50))
                ),
            'prepend' => '<i class="icon-user"></i>',
        ));
        
        $email = $this->addElement('text', 'email', array(
            'label'      => 'Endereço de email:',
            'required'   => true,
            'description' =>
                '<small>Leia a <a href="/privacy" rel="external">'.
                'Política de privacidade</a> antes de continuar</small>',
            'filters'    => array('StringTrim', 'StringToLower'),
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(1, 60)),
                array('validator' => 'emailNewUser'),//stringlenght there also
                array('validator' => 'EmailAddress')
                ),
            'prepend' => '<i class="icon-envelope"></i>',
        ));
        
        $this->addElement(Ml_Model_AntiAttack::captchaElement());
        
        $this->addElement('submit', 'submit', array(
            'label'    => 'Cadastrar',
            'class'    => 'btn btn-primary btn-large',
        ));

        $this->addDisplayGroup(
            array('submit', 'reset'),
            'actions',
            array(
                'disableLoadDefaultDecorators' => true,
                'decorators' => array('Actions')
            )
{'fraction_non_alphanumeric': 0.16527621195039457, 'fraction_numerical': 0.002705749718151071, 'mean_word_length': 1.8345047923322684, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 81, 'https://': 1, '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': '4304565', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1251, 'n_words': 222}