init_constants(); } private function init_constants(){ $this->field_props = $this->get_field_form_props(); //$this->field_props_display = $this->get_field_form_props_display(); } // private function get_field_types(){ // return array( // 'text' => 'Text', 'hidden' => 'Hidden', 'password' => 'Password', // 'tel' => 'Telephone', 'email' => 'Email', 'number' => 'Number', // 'textarea' => 'Textarea', 'select' => 'Select', 'multiselect' => 'Multiselect', // 'radio' => 'Radio', 'checkbox' => 'Checkbox', 'checkboxgroup' => 'Checkbox Group', // 'datepicker' => 'Date Picker', 'timepicker' => 'Time Picker', // 'file' => 'File Upload', // 'heading' => 'Heading', 'label' => 'Label' // ); // } public function get_field_types(){ return array( 'text' => __('Text', 'woo-checkout-field-editor-pro'), 'password' => __('Password', 'woo-checkout-field-editor-pro'), 'email' => __('Email', 'woo-checkout-field-editor-pro'), 'tel' => __('Phone', 'woo-checkout-field-editor-pro'), 'select' => __('Select', 'woo-checkout-field-editor-pro'), 'textarea' => __('Textarea', 'woo-checkout-field-editor-pro'), 'radio' => __('Radio', 'woo-checkout-field-editor-pro'), ); } public function get_field_form_props(){ $field_types = $this->get_field_types(); $validations = array( 'email' => 'Email', 'phone' => 'Phone', 'postcode' => 'Postcode', 'state' => 'State', 'number' => 'Number', ); $display_style = array( 'full' => 'Full width', 'half_left' => 'Half width left', 'ha;lf_right' => 'Half width right', ); return array( 'type' => array('type'=>'select', 'name'=>'type', 'label'=>'Type', 'required'=>1, 'options'=>$field_types, 'onchange'=>'thwcfdFieldTypeChangeListner(this)'), 'name' => array('type'=>'text', 'name'=>'name', 'label'=>'Name', 'required'=>1), 'label' => array('type'=>'text', 'name'=>'label', 'label'=>'Label'), 'default' => array('type'=>'text', 'name'=>'default', 'label'=>'Default Value'), 'placeholder' => array('type'=>'text', 'name'=>'placeholder', 'label'=>'Placeholder'), //'options' => array('type'=>'text', 'name'=>'options', 'label'=>'Options', 'placeholder'=>'Seperate options with pipe(|)'), 'class' => array('type'=>'text', 'name'=>'class', 'label'=>'Class', 'placeholder'=>'Separate classes with comma'), 'validate' => array('type'=>'multiselect', 'name'=>'validate', 'label'=>'Validation', 'placeholder'=>'Select validations', 'options'=>$validations, 'multiple'=>1), 'disp_style' => array('type'=>'select', 'name'=>'disp_style', 'label'=>'Field Display', 'options'=>$display_style), 'required' => array('type'=>'checkbox', 'name'=>'required', 'label'=>'Required', 'value'=>'1', 'checked'=>1), //'clear' => array('type'=>'checkbox', 'name'=>'clear', 'label'=>'Clear Row', 'value'=>'1', 'checked'=>1), 'enabled' => array('type'=>'checkbox', 'name'=>'enabled', 'label'=>'Enabled', 'value'=>'1', 'checked'=>1), 'show_in_email' => array('type'=>'checkbox', 'name'=>'show_in_email', 'label'=>'Display in Emails', 'value'=>'1', 'checked'=>1), 'show_in_order' => array('type'=>'checkbox', 'name'=>'show_in_order', 'label'=>'Display in Order Detail Pages', 'value'=>'1', 'checked'=>1), ); } /*public function get_field_form_props_display(){ return array( 'name' => array('name'=>'name', 'type'=>'text'), 'type' => array('name'=>'type', 'type'=>'select'), 'title' => array('name'=>'title', 'type'=>'text', 'len'=>40), 'placeholder' => array('name'=>'placeholder', 'type'=>'text', 'len'=>30), 'validate' => array('name'=>'validate', 'type'=>'text'), 'required' => array('name'=>'required', 'type'=>'checkbox', 'status'=>1), 'enabled' => array('name'=>'enabled', 'type'=>'checkbox', 'status'=>1), ); }*/ public function output_field_forms(){ $this->output_field_form_pp(); $this->output_form_fragments(); } private function output_field_form_pp(){ ?>
+x |