Ejemplo n.º 1
0
 function visitCheckbox(\cmu\html\form\products\Input $component)
 {
     $html = "<span ";
     $html .= $component->getHtmlClass();
     $html .= ">";
     $html .= $component->getCheckedValue();
     $html .= "</span>";
     return $html;
 }
Ejemplo n.º 2
0
 protected function accept(\cmu\html\form\visitors\input\AbstractInputVisitor $visitor, \cmu\html\form\products\Input $component)
 {
     //get TYPE converted to upper case
     $type = ucfirst($component->getType());
     //build method   visit + type (from above)
     $method = "visit" . $type;
     //return the values from the new object function
     return $visitor->{$method}($component);
 }
Ejemplo n.º 3
0
 function visitInput(\cmu\html\form\products\Input $component)
 {
     $html = "<input ";
     $html .= $component->getAttributes();
     $html .= ">";
     $html .= "</input>";
     $html .= $component->getCaption();
     //labels for RADIO and CHECKBOX
     $html .= $component->returnHint();
     $html .= $component->returnErrorMessage();
     return $html;
 }
Ejemplo n.º 4
0
 function visitInput(\cmu\html\form\products\Input $component)
 {
     //if we have a value , type is TEXT and sanitize is set
     //we can only validate TEXT input
     if ($component->getType() == "text" && null !== $component->getSanitize() && null != $component->getValue()) {
         $sanitize = new \cmu\html\form\sanitize\SanitizeContext($component->getSanitize());
         $component->setValue($sanitize->sanitizeText($component->getValue()));
     }
 }
Ejemplo n.º 5
0
 function visitPassword(\cmu\html\form\products\Input $component)
 {
     return $this->returnKeyValue($component->getValue(), $component->getName(), $component->getValue());
 }
Ejemplo n.º 6
0
 function visitPassword(\cmu\html\form\products\Input $component)
 {
     if (null != $component->getValue()) {
         return true;
     }
 }