]> dev.renevier.net Git - syj.git/blob - application/forms/Geom.php
my account link appears when logging from main page
[syj.git] / application / forms / Geom.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 class Syj_Form_Geom extends Zend_Form
6 {
7     protected $_elementDecorators = array( 'ViewHelper', 'Errors',);
8
9     protected $_decorators = array(
10                             'FormElements' => array('decorator' => 'FormElements', 'options' => null),
11                             'Form' => array('decorator' => 'Form', 'options' => null)
12                             );
13
14     public function init() {
15         $id = array('Hidden', 'geom_id');
16         $data = array('Hidden', 'geom_data', array('required' => true));
17
18         $title = array('Text', 'geom_title', array(
19             'label' => __("optional title for this journey"),
20             'attribs' => array('maxlength' => '40', 'size' => '20'),
21             'validators' => array(new Zend_Validate_StringLength(0, 40))
22             ));
23
24         $translator = $this->getTranslator();
25         $anchor = $this->getView()->Anchor("termsofuse", $translator->translate("terms of use"), array('id' => 'geom_termsofuse_anchor'));
26         $text = $translator->translate("I've read and accepted %s");
27         $text = vsprintf($text, $anchor);
28         $touaccept = array('Checkbox', 'geom_accept', array("label" => $text,
29                             'decorators' => array(
30                                   'ViewHelper',
31                                   'label',
32                                   array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container', 'class' => 'logged-hide')))));
33
34         $submit = array('Submit', 'geom_submit', array('label' => __("save")));
35
36         $this->addElements(array($id, $data, $title, $touaccept, $submit));
37
38         $decorator = $this->geom_accept->getDecorator('Zend_Form_Decorator_Label');
39         $decorator->setOption('escape', false);
40
41         $this->geom_title->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true))->
42             addDecorator('label');
43         $this->geom_submit->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true));
44
45     }
46 }