X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fforms%2FGeom.php;h=61dde0ca1fb8af572470e0dce31ee20849eb2730;hb=e0467a21e9d0f5237e0c3505933c625ef7c02be0;hp=751d7982b08e164fad2d99476446dea58797ad9a;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/application/forms/Geom.php b/application/forms/Geom.php index 751d798..61dde0c 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,25 @@ 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, + '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');