]> dev.renevier.net Git - syj.git/blobdiff - application/forms/Geom.php
raw mode for termsofuse
[syj.git] / application / forms / Geom.php
index 751d7982b08e164fad2d99476446dea58797ad9a..61dde0ca1fb8af572470e0dce31ee20849eb2730 100644 (file)
@@ -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');