2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_Form_Geom extends Zend_Form
7 protected $_elementDecorators = array( 'ViewHelper', 'Errors',);
9 protected $_decorators = array(
10 'FormElements' => array('decorator' => 'FormElements', 'options' => null),
11 'Form' => array('decorator' => 'Form', 'options' => null)
14 public function init() {
15 $id = array('Hidden', 'geom_id');
16 $data = array('Hidden', 'geom_data', array('required' => true));
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))
23 $submit = array('Submit', 'geom_submit', array('label' => __("save")));
25 $this->addElements(array($id, $data, $title, $submit));
27 // fieldset around title
28 //$this->addDisplayGroup(array('geom_title'), 'metadata', array('decorators' => array('FormElements', 'Fieldset')));
30 $this->geom_title->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true))->
31 addDecorator('label');
32 $this->geom_submit->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true));