plugin_meta = get_plugin_meta_wooconvo(); $this -> title = __ ( 'File Input', 'nm-webcontact' ); $this -> desc = __ ( 'regular file input', 'nm-webcontact' ); $this -> settings = self::get_settings(); $this -> input_scripts = array( 'shipped' => array('plupload'), 'custom' => array() ); add_action ( 'wp_enqueue_scripts', array ($this, 'load_input_scripts')); } private function get_settings(){ return array ( 'title' => array ( 'type' => 'text', 'title' => __ ( 'Title', 'nm-webcontact' ), 'desc' => __ ( 'It will be shown as field label', 'nm-webcontact' ) ), 'data_name' => array ( 'type' => 'text', 'title' => __ ( 'Data name', 'nm-webcontact' ), 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', 'nm-webcontact' ) ), 'description' => array ( 'type' => 'text', 'title' => __ ( 'Description', 'nm-webcontact' ), 'desc' => __ ( 'Small description, it will be diplay near name title.', 'nm-webcontact' ) ), 'error_message' => array ( 'type' => 'text', 'title' => __ ( 'Error message', 'nm-webcontact' ), 'desc' => __ ( 'Insert the error message for validation.', 'nm-webcontact' ) ), 'required' => array ( 'type' => 'checkbox', 'title' => __ ( 'Required', 'nm-webcontact' ), 'desc' => __ ( 'Select this if it must be required.', 'nm-webcontact' ) ), 'class' => array ( 'type' => 'text', 'title' => __ ( 'Class', 'nm-webcontact' ), 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', 'nm-webcontact' ) ), 'width' => array ( 'type' => 'text', 'title' => __ ( 'Width', 'nm-webcontact' ), 'desc' => __ ( 'Type field width in % e.g: 50%', 'nm-webcontact' ) ), 'dragdrop' => array ( 'type' => 'checkbox', 'title' => __ ( 'Drag & Drop', 'nm-personalizedproduct' ), 'desc' => __ ( 'Turn drag & drop on/eff.', 'nm-personalizedproduct' ) ), 'popup_width' => array ( 'type' => 'text', 'title' => __ ( 'Popup width', 'nm-personalizedproduct' ), 'desc' => __ ( '(if image) Popup window width in px e.g: 750', 'nm-personalizedproduct' ) ), 'popup_height' => array ( 'type' => 'text', 'title' => __ ( 'Popup height', 'nm-personalizedproduct' ), 'desc' => __ ( '(if image) Popup window height in px e.g: 550', 'nm-personalizedproduct' ) ), 'button_label_select' => array ( 'type' => 'text', 'title' => __ ( 'Button label (select files)', 'nm-personalizedproduct' ), 'desc' => __ ( 'Type button label e.g: Select Photos', 'nm-personalizedproduct' ) ), 'button_class' => array ( 'type' => 'text', 'title' => __ ( 'Button class', 'nm-webcontact' ), 'desc' => __ ( 'Type class for both (select, upload) buttons', 'nm-webcontact' ) ), 'files_allowed' => array ( 'type' => 'text', 'title' => __ ( 'Files allowed', 'nm-webcontact' ), 'desc' => __ ( 'Type number of files allowed per upload by user, e.g: 3', 'nm-webcontact' ) ), 'file_types' => array ( 'type' => 'text', 'title' => __ ( 'File types', 'nm-webcontact' ), 'desc' => __ ( 'File types allowed seperated by comma, e.g: jpg,pdf,zip', 'nm-webcontact' ) ), 'file_size' => array ( 'type' => 'text', 'title' => __ ( 'File size', 'nm-webcontact' ), 'desc' => __ ( 'Type size with units in kb|mb per file uploaded by user, e.g: 3mb', 'nm-webcontact' ) ), 'chunk_size' => array ( 'type' => 'text', 'title' => __ ( 'chunk size', 'nm-webcontact' ), 'desc' => __ ( 'Enables you to chunk the large file into smaller pieces, e.g: 1mb', 'nm-webcontact' ) ), 'photo_editing' => array ( 'type' => 'checkbox', 'title' => __ ( 'Enable photo editing', 'nm-webcontact' ), 'desc' => __ ( 'Allow users to edit photos by Aviary API, make sure that Aviary API Key is set in previous tab.', 'nm-webcontact' ) ), 'editing_tools' => array ( 'type' => 'checkbox', 'title' => __ ( 'Editing Options', 'nm-webcontact' ), 'desc' => __ ( 'Select editing options', 'nm-webcontact' ), 'options' => array ( 'enhance' => 'Enhancements', 'effects' => 'Filters', 'frames' => 'Frames', 'stickers' => 'Stickers', 'orientation' => 'Orientation', 'focus' => 'Focus', 'resize' => 'Resize', 'crop' => 'Crop', 'warmth' => 'Warmth', 'brightness' => 'Brightness', 'contrast' => 'Contrast', 'saturation' => 'Saturation', 'sharpness' => 'Sharpness', 'colorsplash' => 'Colorsplash', 'draw' => 'Draw', 'text' => 'Text', 'redeye' => 'Red-Eye', 'whiten' => 'Whiten teeth', 'blemish' => 'Remove skin blemishes' ) ), 'logic' => array ( 'type' => 'checkbox', 'title' => __ ( 'Enable conditional logic', 'nm-webcontact' ), 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'nm-webcontact' ) ), 'conditions' => array ( 'type' => 'html-conditions', 'title' => __ ( 'Conditions', 'nm-webcontact' ), 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'nm-webcontact' ) ), ); } /* * @params: args */ function render_input($args, $content=""){ $_html = '
'; $_html .= '
'; $btn_class = (isset($args['button-class'])) ? $args['button-class'] : '' ; $_html .= '' . $args['button-label-select']; $_html .= ''; $_html .= '
'; $_html .= '
'; //container_buttons if(isset($args['dragdrop'])) { $_html .= '
'; if($this -> if_browser_is_ie()) $_html .= __('Drag file(s) in this box', 'nm-personalizedproduct'); else $_html .= __('Drag file(s) or directory in this box', 'nm-personalizedproduct'); $_html .= '
'; } $_html .= '
'; echo $_html; $this -> get_input_js($args); } /* * following function is rendering JS needed for input */ function get_input_js($args){ // webcontact_pa($args); if($this -> if_browser_is_ie()) $runtimes = 'flash'; else $runtimes = 'html5,flash,silverlight,html4,browserplus,gear'; $chunk_size = ($args['chunk-size'] == '') ? $args['file-size'] : $args['chunk-size']; $popup_width = (isset($args['popup-width']) && $args['popup-width'] != '') ? $args['popup-width'] : 600 ; $popup_height = (isset($args['popup-height']) && $args['popup-height'] != '') ? $args['popup-height'] : 450 ; ?> '; echo ''; } } }