Exemplo n.º 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 function testChecksumFieldnameDependsOnSalt()
 {
     $hidden1 = new T_Form_Hidden('alias', 'value');
     $hidden1->setFieldnameSalt('salt1', new T_Filter_RepeatableHash());
     $hidden2 = new T_Form_Hidden('alias', 'value');
     $hidden2->setFieldnameSalt('salt2', new T_Filter_RepeatableHash());
     $this->assertNotEquals($hidden1->getFieldname(), $hidden1->getChecksumFieldname());
     $this->assertNotEquals($hidden2->getChecksumFieldname(), $hidden1->getChecksumFieldname());
 }