private function render_options_page() { $option = new WCAM_Option(); if (isset($_POST['wcam_general_options'])) { $option->save_options($_POST['wcam_general_options']); } $options = $option->get_option(); //get_option( 'wcam_general_options'); //wcam_var_dump(get_option( 'wcam_general_options')); wp_enqueue_style('wcam-options-page', plugin_dir_url(__FILE__) . 'css/wcam-backend-options.css'); $default_width = get_option('thumbnail' . '_size_w'); $default_height = get_option('thumbnail' . '_size_h'); $wpml = new WCAM_Wpml(); $curr_lang = $wpml->get_current_language(); ?> <div class="wrap"> <h2><?php _e('Options page', 'woocommerce-customers-manager'); ?> </h2> <!--<form method="post" action="options.php">--> <form method="post" action=""> <?php //settings_fields('wcam_general_options_group'); ?> <div id="options-container"> <h3><?php _e('General', 'woocommerce-customers-manager'); ?> </h3> <p> <label><?php _e('Folder name (use only alphanumeric characters, NO special characters allowed). Previous attachments will not be moved to the new folder', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[folder_name]" value="<?php if (isset($options['folder_name'])) { echo $options['folder_name']; } else { echo "wcam"; } ?> " required></input><br/> <small><?php _e('Upload folder is located in wp-content/uploads/ folder.', 'woocommerce-customers-manager'); ?> </small> </p> <label><?php _e('Chose which options are "on" by default', 'woocommerce-customers-manager'); ?> </label> <input type="checkbox" <?php if (isset($options['approve_checkbox_default_value']) && $options['approve_checkbox_default_value'] == 'yes') { echo 'checked="checked"'; } ?> name="wcam_general_options[approve_checkbox_default_value]" class="wcam-customer-approve-checkbox" value="yes"><?php _e('Let customer approves? ', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['reapprove_checkbox_default_value']) && $options['reapprove_checkbox_default_value'] == 'yes') { echo 'checked="checked"'; } ?> name="wcam_general_options[reapprove_checkbox_default_value]" class="wcam-customer-reapprove-checkbox" value="yes"><?php _e('Can customer change approval value after submit?', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['feedback_checkbox_default_value']) && $options['feedback_checkbox_default_value'] == 'yes') { echo 'checked="checked"'; } ?> name="wcam_general_options[feedback_checkbox_default_value]" class="wcam-customer-feedback-checkbox" value="yes"><?php _e('Let customer leave a text feedback?', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['customer_admin_notification_checkbox_default_value']) && $options['customer_admin_notification_checkbox_default_value'] == 'yes') { echo 'checked="checked"'; } ?> name="wcam_general_options[customer_admin_notification_checkbox_default_value]" class="wcam-customer-admin-notification-checkbox" value="yes"><?php _e('Receive an email when the customer approve or leaves a feedback? ', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['attach_file_to_processing_order_email_default_value']) && $options['attach_file_to_processing_order_email_default_value'] == 'yes') { echo 'checked="checked"'; } ?> class="wcam-attach-file-to-complete-order-email" name="wcam_general_options[attach_file_to_processing_order_email_default_value]" value="yes"><?php _e('Attach file to the Processing order email', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['attach_file_to_complete_order_email_default_value']) && $options['attach_file_to_complete_order_email_default_value'] == 'yes') { echo 'checked="checked"'; } ?> class="wcam-attach-file-to-complete-order-email" name="wcam_general_options[attach_file_to_complete_order_email_default_value]" value="yes"><?php _e('Attach file to the Complete order email', 'woocommerce-attach-me'); ?> </input> <br/> <input type="checkbox" <?php if (isset($options['attach_file_to_customer_invoice_email_default_value']) && $options['attach_file_to_customer_invoice_email_default_value'] == 'yes') { echo 'checked="checked"'; } ?> class="wcam-attach-file-to-complete-order-email" name="wcam_general_options[attach_file_to_customer_invoice_email_default_value]" value="yes"><?php _e('Attach file to the Customer Invoice email', 'woocommerce-attach-me'); ?> </input> <br/> <h3><?php _e('Texts', 'woocommerce-customers-manager'); ?> </h3> <?php if ($wpml->is_wpml_active()) { ?> <small><strong><?php _e('NOTE:', 'woocommerce-customers-manager'); ?> </strong> <?php _e('WPML Detected! to translate following texts simply select the language you desire from the upper WPML language selector, edit texts and save!', 'woocommerce-customers-manager'); ?> </small> <?php } ?> <h4><?php _e('Order details page', 'woocommerce-customers-manager'); ?> </h4> <p> <label><?php _e('Attachments section title', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[title_box][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['title_box'][$curr_lang])) { echo $options['title_box'][$curr_lang]; } else { _e('Attachments', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('Download / View button', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[download_view_button_text][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['download_view_button_text'][$curr_lang])) { echo $options['download_view_button_text'][$curr_lang]; } else { _e('Download / View', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('Approval box title', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[approve_box_title][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['approve_box_title'][$curr_lang])) { echo $options['approve_box_title'][$curr_lang]; } else { _e('Do you approve?', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('Approval already sent message', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[approve_already_sent_message][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['approve_already_sent_message'][$curr_lang])) { echo $options['approve_already_sent_message'][$curr_lang]; } else { _e('Approvation already sent. Selected value was:', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('Approval options', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[approve_not_yet_text][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['approve_not_yet_text'][$curr_lang])) { echo $options['approve_not_yet_text'][$curr_lang]; } else { _e('Not yet', 'woocommerce-attach-me'); } ?> " required></input><br/> <input type="text" name="wcam_general_options[approve_yes_text][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['approve_yes_text'][$curr_lang])) { echo $options['approve_yes_text'][$curr_lang]; } else { _e('Yes', 'woocommerce-attach-me'); } ?> " required></input><br/> <input type="text" name="wcam_general_options[approve_no_text][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['approve_no_text'][$curr_lang])) { echo $options['approve_no_text'][$curr_lang]; } else { _e('No', 'woocommerce-attach-me'); } ?> " required></input><br/> </p> <p> <label><?php _e('Feedback section title', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[feedback_box_title][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['feedback_box_title'][$curr_lang])) { echo $options['feedback_box_title'][$curr_lang]; } else { _e('Please enter a feedback', 'woocommerce-attach-me'); } ?> "></input> </p> <h4><?php _e('Emails', 'woocommerce-customers-manager'); ?> </h4> <p> <label><?php _e('Customer approval section title', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[email_approve_box_title][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['email_approve_box_title'][$curr_lang])) { echo $options['email_approve_box_title'][$curr_lang]; } else { _e('Customer has approved?', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('Customer feedback section title', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[email_feedback_box_title][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['email_feedback_box_title'][$curr_lang])) { echo $options['email_feedback_box_title'][$curr_lang]; } else { _e('Customer feedback', 'woocommerce-attach-me'); } ?> "></input> </p> <p> <label><?php _e('No customer feedback message', 'woocommerce-customers-manager'); ?> </label> <input type="text" name="wcam_general_options[email_no_customer_feedback_message][<?php echo $curr_lang; ?> ]" value="<?php if (isset($options['email_no_customer_feedback_message'][$curr_lang])) { echo $options['email_no_customer_feedback_message'][$curr_lang]; } else { _e('No customer feedback', 'woocommerce-attach-me'); } ?> "></input> </p> <h3><?php _e('Style', 'woocommerce-customers-manager'); ?> </h3> <p> <label><?php _e('Approval option list style (You can select to display approval options using a select box or a radio buttons)', 'woocommerce-customers-manager'); ?> </label> <select name="wcam_general_options[approval_box_style]"> <option value="select" <?php if (!isset($options['approval_box_style']) || $options['approval_box_style'] == 'select') { echo 'selected'; } ?> >Select</option> <option value="radio" <?php if (isset($options['approval_box_style']) && $options['approval_box_style'] == 'radio') { echo 'selected'; } ?> >Radio</option> </select> </p> <p> <label><?php _e('Display image preview (only if attachment is an image)', 'woocommerce-customers-manager'); ?> </label> <select name="wcam_general_options[dispaly_image_preview]"> <option value="no" <?php if (!isset($options['dispaly_image_preview']) || $options['dispaly_image_preview'] == 'no') { echo 'selected'; } ?> ><?php _e('No', 'woocommerce-customers-manager'); ?> </option> <option value="yes" <?php if (isset($options['dispaly_image_preview']) && $options['dispaly_image_preview'] == 'yes') { echo 'selected'; } ?> ><?php _e('Yes', 'woocommerce-customers-manager'); ?> </option> </select> </p> <p> <label><?php _e('Thumb width (by default is used the one setted in "Settings" -> "Media" option)', 'woocommerce-customers-manager'); ?> </label> <input type="number" min="0" name="wcam_general_options[thumb_width]"value="<?php if (isset($options['thumb_width'])) { echo $options['thumb_width']; } else { echo $default_width; } ?> " ></input> </p> <label><?php _e('Thumb heigth (by default is used the one setted in "Settings" -> "Media" option)', 'woocommerce-customers-manager'); ?> </label> <input type="number" min="0" name="wcam_general_options[thumb_height]"value="<?php if (isset($options['thumb_height'])) { echo $options['thumb_height']; } else { echo $default_height; } ?> " ></input> </p> <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes', 'woocommerce-customers-manager'); ?> " /> </p> </div> </form> </div> <?php }