Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
tao_actions_form_PasswordRecovery
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 initForm
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 initElements
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2015 (original work) Open Assessment Technologies SA;
19 *
20 */
21
22use oat\tao\helpers\Layout;
23
24/**
25 * This container initialize the password recovery form.
26 *
27 * @author Aleh Hutnikau <hutnikau@1pt.com>
28 * @package tao
29 */
30class tao_actions_form_PasswordRecovery extends tao_helpers_form_FormContainer
31{
32    /**
33     * Initialize password recovery form
34     *
35     * @access public
36     * @author Aleh Hutnikau <hutnikau@1pt.com>
37     */
38    public function initForm()
39    {
40        $this->form = tao_helpers_form_FormFactory::getForm('passwordRecoveryForm');
41
42        $connectElt = tao_helpers_form_FormFactory::getElement('recovery', 'Submit');
43        $connectElt->setValue(__('Email'));
44        $connectElt->setAttribute('class', 'btn-success small');
45        $this->form->setActions([$connectElt], 'bottom');
46    }
47
48    /**
49     * Initialiaze recovery form elements
50     *
51     * @access public
52     * @author Aleh Hutnikau <hutnikau@1pt.com>
53     */
54    public function initElements()
55    {
56        $mailElement = tao_helpers_form_FormFactory::getElement('userMail', 'Textbox');
57        $mailElement->setDescription(__('Your mail') . '*');
58        $mailElement->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty'));
59        $mailElement->addValidator(tao_helpers_form_FormFactory::getValidator('Email'));
60        $mailElement->setAttributes(['autofocus' => 'autofocus']);
61
62        $this->form->addElement($mailElement);
63    }
64}