2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_Form_Login extends Syj_Form_TableAbstract
8 public function init() {
9 $user = array('Text', 'login_user', array( 'label' => __("user"), 'required' => true));
10 $pass = array('Password', 'login_password', array( 'label' => __("password")));
13 $this->setMainElements(array($user, $pass))
14 ->addElement('Hidden', 'login_geom_id', array( 'decorators' => array('ViewHelper')));
16 $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
17 if (strpos($currentUri, '?') !== false) {
18 $currentUri = strstr($currentUri, '?', true);
20 $href = $this->getView()->addParamToUrl('newpwd', 'redirect', $currentUri, true);
22 $anchor = $this->getView()->Anchor($href,
23 $this->getTranslator()->translate("I forgot my password"),
24 array('id' => 'newpwd_control_anchor'));
26 $this->addElement('Submit', 'login_submit', array('label' => __("login"), 'description' => $anchor));
27 $decorator = $this->login_submit->getDecorator('Description');
28 $decorator->setOption('escape', false);