Ejemplo n.º 1
0
 public function __toString()
 {
     return \plainview\sdk_broadcast\form2\form::unfilter_text($this->get_value());
 }
Ejemplo n.º 2
0
 /**
 		@brief		Display the input itself.
 		@return		string		The input as HTML.
 		@since		20130524
 	**/
 public function display_input()
 {
     $input = clone $this;
     $input->set_attribute('id', $input->make_id());
     $name = $input->make_name();
     $input->set_attribute('name', $name);
     if ($input->has_description) {
         if ($this->description->label->content != '') {
             $input->set_attribute('aria-describedby', $input->description->get_attribute('id'));
         }
     }
     $input->css_class(isset($this->type) ? $this->type : $this->tag);
     if ($input->is_required()) {
         $input->css_class('required');
     }
     if ($this->requires_validation() && $this->form()->is_posting()) {
         if (!$this->validates()) {
             $input->css_class('does_not_validate');
         } else {
             $input->css_class('validates');
         }
     }
     // Is the POST variable set?
     if ($input->form()->post_is_set()) {
         // Retrieve the post value.
         $value = $input->get_value();
         if ($value != '') {
             $value = \plainview\sdk_broadcast\form2\form::unfilter_text($value);
             $input->value($value);
         } else {
             $this->clear_attribute('value');
         }
     }
     // Allow subclasses the chance to modify themselves in case displaying isn't straightforward.
     $input->prepare_to_display();
     return $input->open_tag() . $input->display_value() . $input->close_tag();
 }