Beispiel #1
0
 /**
  * Visit a hidden input node.
  *
  * @param T_Form_Hidden $node
  */
 function visitFormHidden(T_Form_Hidden $node)
 {
     $xhtml = $this->indent . '<div class="hidden">' . EOL;
     // render value
     $attributes = $node->getAllAttributes();
     $attributes += array('type' => 'hidden', 'name' => $node->getFieldname(), 'value' => $node->getFieldValue());
     $xhtml .= $this->indent . '<input ';
     foreach ($attributes as $key => $value) {
         $xhtml .= $key . '="' . $this->escape($value) . '"' . EOL . $this->indent . '       ';
     }
     $xhtml = rtrim($xhtml) . ' /> ' . EOL;
     // render checksum
     $attributes = array('type' => 'hidden', 'name' => $node->getChecksumFieldname(), 'value' => $node->getChecksumFieldValue());
     $xhtml .= $this->indent . '<input ';
     foreach ($attributes as $key => $value) {
         $xhtml .= $key . '="' . $this->escape($value) . '"' . EOL . $this->indent . '       ';
     }
     $xhtml = rtrim($xhtml) . ' /> ' . EOL;
     $xhtml .= $this->indent . '</div>' . EOL;
     $this->addXhtml($xhtml);
 }
Beispiel #2
0
 /**
  * Visit a hidden input.
  *
  * @param T_Form_Hidden
  */
 function visitFormHidden(T_Form_Hidden $node)
 {
     $this->data[$node->getFieldname()] = $node->getFieldValue();
     $this->data[$node->getChecksumFieldname()] = $node->getChecksumFieldValue();
 }
Beispiel #3
0
 function testValidatationClearsAnyPreviousError()
 {
     $hidden = new T_Form_Hidden('alias', 'value');
     $hidden->validate(new T_Cage_Array(array()));
     // error
     $src = array($hidden->getFieldname() => $hidden->getFieldValue(), $hidden->getChecksumFieldname() => $hidden->getChecksumFieldValue());
     $cage = new T_Cage_Array($src);
     $hidden->validate($cage);
     $this->assertTrue($hidden->isValid());
 }