]> dev.renevier.net Git - syj.git/blob - application/forms/Login.php
update copyright headers
[syj.git] / application / forms / Login.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 class Syj_Form_Login extends Syj_Form_TableAbstract
6 {
7
8     public function init() {
9         $user = array('Text', 'login_user', array( 'label' => __("user"), 'required' => true));
10         $pass = array('Password', 'login_password', array( 'label' => __("password")));
11
12
13         $this->setMainElements(array($user, $pass))
14              ->addElement('Hidden', 'login_geom_id', array( 'decorators' => array('ViewHelper')));
15
16         $currentUri = $this->getView()->UriPath(true);
17         $href = $this->getView()->addParamToUrl('newpwd', 'redirect', $currentUri, true);
18
19         $anchor = $this->getView()->Anchor($href,
20                                     $this->getTranslator()->translate("I forgot my password"),
21                                     array('id' => 'newpwd_control_anchor'));
22
23         $this->addElement('Submit', 'login_submit', array('label' => __("login"), 'description' => $anchor));
24         $decorator = $this->login_submit->getDecorator('Description');
25         $decorator->setOption('escape', false);
26     }
27
28 }