X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fforms%2FGeom.php;h=3d99a87bd6014b7522b2bee84c7bef81439be960;hb=616108d95f68d4d0c7dec334b262939782f355dc;hp=751d7982b08e164fad2d99476446dea58797ad9a;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/application/forms/Geom.php b/application/forms/Geom.php index 751d798..3d99a87 100644 --- a/application/forms/Geom.php +++ b/application/forms/Geom.php @@ -12,7 +12,6 @@ class Syj_Form_Geom extends Zend_Form ); public function init() { - $id = array('Hidden', 'geom_id'); $data = array('Hidden', 'geom_data', array('required' => true)); $title = array('Text', 'geom_title', array( @@ -20,12 +19,26 @@ class Syj_Form_Geom extends Zend_Form 'attribs' => array('maxlength' => '40', 'size' => '20'), 'validators' => array(new Zend_Validate_StringLength(0, 40)) )); + + $translator = $this->getTranslator(); + $anchor = $this->getView()->Anchor("termsofuse?format=raw", + $translator->translate("terms of use"), + array('id' => 'geom_termsofuse_anchor')); + $text = $translator->translate("I've read and accepted %s"); + $text = vsprintf($text, $anchor); + $touaccept = array('Checkbox', 'geom_accept', array("label" => $text, + 'helper' => 'SyjFormCheckbox', // similar to FormCheckbox without a hidden input + 'decorators' => array( + 'ViewHelper', + 'label', + array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container', 'class' => 'logged-hide'))))); + $submit = array('Submit', 'geom_submit', array('label' => __("save"))); - $this->addElements(array($id, $data, $title, $submit)); + $this->addElements(array($data, $title, $touaccept, $submit)); - // fieldset around title - //$this->addDisplayGroup(array('geom_title'), 'metadata', array('decorators' => array('FormElements', 'Fieldset'))); + $decorator = $this->geom_accept->getDecorator('Zend_Form_Decorator_Label'); + $decorator->setOption('escape', false); $this->geom_title->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true))-> addDecorator('label');