/**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
     $this->_set_normalization_strategy(new EE_Float_Normalization(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
     $this->_add_validation_strategy(new EE_Float_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
     parent::__construct($input_settings);
 }
 /**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password'));
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     parent::__construct($input_settings);
     $this->set_html_class($this->html_class() . 'password');
 }
 /**
  * @param array $options
  */
 function __construct($options = array())
 {
     $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy());
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
     parent::__construct($options);
 }
 /**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('email'));
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     $this->_add_validation_strategy(new EE_Email_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
     parent::__construct($input_settings);
     $this->set_html_class($this->html_class() . ' email');
 }
 /**
  * @param array $options
  */
 function __construct($options = array())
 {
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     //by default we use the plaintext validation. If you want something else,
     //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy()
     $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
     parent::__construct($options);
 }
 /**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     $input_settings['required'] = isset($input_settings['required']) ? $input_settings['required'] : TRUE;
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
     $this->set_sensitive_data_removal_strategy(new EE_Credit_Card_Sensitive_Data_Removal());
     parent::__construct($input_settings);
 }
 /**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     //require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
     $this->_set_display_strategy(new EE_Hidden_Display_Strategy());
     if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
         $this->_set_normalization_strategy($input_settings['normalization_strategy']);
     } else {
         $this->_set_normalization_strategy(new EE_Text_Normalization());
     }
     parent::__construct($input_settings);
 }
 /**
  * Lays out the row for the input, including label and errors
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function layout_input($input)
 {
     $html = '';
     if ($input instanceof EE_Hidden_Input) {
         $html .= $input->get_html_for_input();
     } else {
         $html_for_input = $input->get_html_for_input();
         $html_for_input .= $input->get_html_for_errors() != '' ? EEH_HTML::nl() . $input->get_html_for_errors() : '';
         $html_for_input .= $input->get_html_for_help() != '' ? EEH_HTML::nl() . $input->get_html_for_help() : '';
         $html .= EEH_HTML::tr(EEH_HTML::th($input->get_html_for_label()) . EEH_HTML::td($html_for_input));
     }
     return $html;
 }
 /**
  * @param array $input_settings
  */
 function __construct($input_settings = array())
 {
     $this->_set_display_strategy(new EE_Text_Input_Display_Strategy('datepicker'));
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     //we could do better for validation, but at least verify its plaintext
     $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
     parent::__construct($input_settings);
     $this->set_html_class($this->html_class() . ' datepicker');
     // add some style and make it dance
     add_action('wp_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
     add_action('admin_enqueue_scripts', array('EE_Datepicker_Input', 'enqueue_styles_and_scripts'));
 }
 /**
  * @param array $options_array
  */
 public function __construct($options_array = array())
 {
     $this->_set_display_strategy(new EE_Text_Area_Display_Strategy());
     $this->_set_normalization_strategy(new EE_Text_Normalization());
     parent::__construct($options_array);
     //if the input hasn't specifically mentioned a more lenient validation strategy,
     //apply plaintext validation strategy
     if (!$this->has_validation_strategy(array('EE_Full_HTML_Validation_Strategy', 'EE_Simple_HTML_Validation_Strategy'))) {
         //by default we use the plaintext validation. If you want something else,
         //just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy()
         $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
     }
 }
 /**
  * @param array $answer_options
  * @param array $input_settings
  */
 public function __construct($answer_options = array(), $input_settings = array())
 {
     if (isset($input_settings['label_size'])) {
         $this->_set_label_size($input_settings['label_size']);
         if (isset($input_settings['enforce_label_size']) && $input_settings['enforce_label_size']) {
             $this->_enforce_label_size = TRUE;
         }
     }
     if (isset($input_settings['display_html_label_text'])) {
         $this->set_display_html_label_text($input_settings['display_html_label_text']);
     }
     $this->set_select_options($answer_options);
     parent::__construct($input_settings);
 }
 /**
  * Lays out the row for the input, including label and errors
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function layout_input($input)
 {
     $html = '';
     if ($input instanceof EE_Hidden_Input) {
         $html .= EEH_HTML::nl() . $input->get_html_for_input();
     } else {
         if ($input instanceof EE_Submit_Input) {
             $html .= EEH_HTML::div($input->get_html_for_input(), $input->html_id() . '-submit-dv', $input->html_class() . '-submit-dv');
         } else {
             if ($input instanceof EE_Select_Input) {
                 $html .= EEH_HTML::div(EEH_HTML::nl(1) . $input->get_html_for_label() . EEH_HTML::nl() . $input->get_html_for_errors() . EEH_HTML::nl() . $input->get_html_for_input() . EEH_HTML::nl() . $input->get_html_for_help(), $input->html_id() . '-input-dv', $input->html_class() . '-input-dv');
             } else {
                 if ($input instanceof EE_Form_Input_With_Options_Base) {
                     $html .= EEH_HTML::div(EEH_HTML::nl() . $this->_display_label_for_option_type_question($input) . EEH_HTML::nl() . $input->get_html_for_errors() . EEH_HTML::nl() . $input->get_html_for_input() . EEH_HTML::nl() . $input->get_html_for_help(), $input->html_id() . '-input-dv', $input->html_class() . '-input-dv');
                 } else {
                     $html .= EEH_HTML::div(EEH_HTML::nl(1) . $input->get_html_for_label() . EEH_HTML::nl() . $input->get_html_for_errors() . EEH_HTML::nl() . $input->get_html_for_input() . EEH_HTML::nl() . $input->get_html_for_help(), $input->html_id() . '-input-dv', $input->html_class() . '-input-dv');
                 }
             }
         }
     }
     return $html;
 }
 /**
  * Lays out the row for the input, including label and errors
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function layout_input($input)
 {
     $html = '';
     if ($input instanceof EE_Hidden_Input) {
         $html .= EEH_HTML::nl() . $input->get_html_for_input();
     } else {
         if ($input instanceof EE_Submit_Input) {
             $html .= EEH_HTML::br();
             $html .= $input->get_html_for_input();
         } else {
             if ($input instanceof EE_Select_Input) {
                 $html .= EEH_HTML::br();
                 $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
                 $html .= EEH_HTML::nl() . $input->get_html_for_errors();
                 $html .= EEH_HTML::nl() . $input->get_html_for_input();
                 $html .= EEH_HTML::nl() . $input->get_html_for_help();
                 $html .= EEH_HTML::br();
             } else {
                 if ($input instanceof EE_Form_Input_With_Options_Base) {
                     $html .= EEH_HTML::br();
                     $html .= EEH_HTML::nl() . $input->get_html_for_errors();
                     $html .= EEH_HTML::nl() . $input->get_html_for_input();
                     $html .= EEH_HTML::nl() . $input->get_html_for_help();
                 } else {
                     $html .= EEH_HTML::br();
                     $html .= EEH_HTML::nl(1) . $input->get_html_for_label();
                     $html .= EEH_HTML::nl() . $input->get_html_for_errors();
                     $html .= EEH_HTML::nl() . $input->get_html_for_input();
                     $html .= EEH_HTML::nl() . $input->get_html_for_help();
                 }
             }
         }
     }
     $html .= EEH_HTML::nl(-1);
     return $html;
 }
 /**
  * Displays the help span for the specified input
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function display_help_text($input)
 {
     if ($input->html_help_text() != '') {
         $tag = is_admin() ? 'p' : 'span';
         return '<' . $tag . ' id="' . $input->html_id() . '-help" class="' . $input->html_help_class() . '" style="' . $input->html_help_style() . '">' . $input->html_help_text() . '</' . $tag . '>';
     }
     return '';
 }
 /**
  * Lays out the row for the input, including label and errors
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function layout_input($input)
 {
     if ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy) {
         $input->set_html_class($input->html_class() . ' large-text');
     }
     if ($input instanceof EE_Text_Area_Input) {
         $input->set_rows(4);
         $input->set_cols(60);
     }
     $input_html = $input->get_html_for_input();
     // maybe add errors and help text ?
     $input_html .= $input->get_html_for_errors() != '' ? EEH_HTML::nl() . $input->get_html_for_errors() : '';
     $input_html .= $input->get_html_for_help() != '' ? EEH_HTML::nl() . $input->get_html_for_help() : '';
     //overriding parent to add wp admin specific things.
     $html = '';
     if ($input instanceof EE_Hidden_Input) {
         $html .= EEH_HTML::no_row($input->get_html_for_input(), 2);
     } else {
         $html .= EEH_HTML::tr(EEH_HTML::th($input->get_html_for_label(), '', '', '', 'scope="row"') . EEH_HTML::td($input_html));
     }
     return $html;
 }