ctf_notes_style = $this->si_contact_convert_css($si_contact_opt['notes_style']); $this->ctf_form_style = $this->si_contact_convert_css($si_contact_opt['form_style']); $this->ctf_border_style = $this->si_contact_convert_css($si_contact_opt['border_style']); $this->ctf_select_style = $this->si_contact_convert_css($si_contact_opt['select_style']); $this->ctf_title_style = $this->si_contact_convert_css($si_contact_opt['title_style']); $this->ctf_field_style = $this->si_contact_convert_css($si_contact_opt['field_style']); $this->ctf_field_div_style = $this->si_contact_convert_css($si_contact_opt['field_div_style']); $this->ctf_error_style = $this->si_contact_convert_css($si_contact_opt['error_style']); $this->ctf_required_style = $this->si_contact_convert_css($si_contact_opt['required_style']); $ctf_field_size = absint($si_contact_opt['field_size']); $this->ctf_aria_required = ($si_contact_opt['aria_required'] == 'true') ? ' aria-required="true" ' : ''; if ($this->si_contact_error) $this->ctf_form_style = str_replace('display: none;','',$this->ctf_form_style); $string .= '
ctf_form_style.'>'; if ($si_contact_opt['vcita_enabled'] == 'true') { $string .= "\n
\n"; } if ($si_contact_opt['border_enable'] == 'true') { $string .= '
ctf_border_style.'> '; $string .= ($si_contact_opt['title_border'] != '') ? $si_contact_opt['title_border'] : __('Contact Form', 'si-contact-form'); $string .= ''; } else { $string .= ' '; } // check attachment directory $attach_dir_error = 0; if ($have_attach){ $attach_dir = WP_PLUGIN_DIR . '/si-contact-form/attachments/'; $this->si_contact_init_temp_dir($attach_dir); if ($si_contact_opt['php_mailer_enable'] == 'php'){ $this->si_contact_error = 1; $attach_dir_error = __( 'This contact form has file attachment fields. Attachments are only supported when the Send E-Mail function is set to WordPress or geekMail. You can find this setting on the contact form settings page.', 'si-contact-form' ); } if ( !is_dir($attach_dir) ) { $this->si_contact_error = 1; $attach_dir_error = sprintf( __( 'This contact form has file attachment fields, but the temporary folder for the files (%s) does not exist. Create the folder manually and (fix permissions)', 'si-contact-form' ), $attach_dir ); } else if(!is_writable($attach_dir)) { $this->si_contact_error = 1; $attach_dir_error = sprintf( __( 'This contact form has file attachment fields, but the temporary folder for the files (%s) is not writable. (fix permissions)', 'si-contact-form' ), $attach_dir ); } else { // delete files over 3 minutes old in the attachment directory $this->si_contact_clean_temp_dir($attach_dir, 3); } } // print any input errors if ($this->si_contact_error) { $string .= '
ctf_required_style.'>
ctf_error_style.'>'."\n"; $string .= ($si_contact_opt['error_correct'] != '') ? $si_contact_opt['error_correct'] : __('Please make corrections below and try again.', 'si-contact-form'); $string .= '
'."\n"; if($have_attach && $attach_dir_error) { $string .= '
ctf_required_style.'>
ctf_error_style.'>'."\n"; $string .= $attach_dir_error; $string .= '
'."\n"; } } if (empty($ctf_contacts)) { $string .= '
ctf_required_style.'>
ctf_error_style.'>'.__('ERROR: Misconfigured E-mail address in options.', 'si-contact-form').'
'."\n"; } if ($si_contact_opt['req_field_label_enable'] == 'true' && $si_contact_opt['req_field_indicator_enable'] == 'true' ) { $string .= '
ctf_required_style.'>'."\n"; $string .= ($si_contact_opt['tooltip_required'] != '') ? ''.$si_contact_opt['req_field_indicator'].'' .$si_contact_opt['tooltip_required'] : ''.$si_contact_opt['req_field_indicator'].'' . __('(denotes required field)', 'si-contact-form'); $string .= '
'; } // allow shortcode hidden fields if ( $shortcode_hidden != '') { $hidden_fields_test = explode(",",$shortcode_hidden); if ( !empty($hidden_fields_test) ) { foreach($hidden_fields_test as $line) { if(preg_match("/=/", $line) ) { list($key, $value) = explode("=",$line); $key = trim($key); $value = trim($value); if ($key != '' && $value != '') { $string .= '
'; } } } } } if (count($contacts) > 1) { $string .= '
ctf_title_style.'>
ctf_field_div_style.'> '.$this->ctf_echo_if_error($si_contact_error_contact).'
' . "\n"; } else { $string .= '
'; } // find logged in user's WP email address (auto form fill feature): // http://codex.wordpress.org/Function_Reference/get_currentuserinfo if ($email == '') { if ( $user_ID != '' && $current_user->user_login != 'admin' && !current_user_can('level_10') && $si_contact_opt['auto_fill_enable'] == 'true' ) { //user logged in (and not admin rights) (and auto_fill_enable set in options) $email = $current_user->user_email; $email2 = $current_user->user_email; if ($name == '') { $name = $current_user->user_login; } } } if($si_contact_opt['name_type'] != 'not_available' ) { $f_name_string = '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_f_name).' ctf_field_style.' type="text" id="si_contact_f_name'.$form_id_num.'" name="si_contact_f_name" value="' . $this->ctf_output_string($f_name) .'" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; $l_name_string = '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_l_name).' ctf_field_style.' type="text" id="si_contact_l_name'.$form_id_num.'" name="si_contact_l_name" value="' . $this->ctf_output_string($l_name) .'" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; switch ($si_contact_opt['name_format']) { case 'name': $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_name).' ctf_field_style.' type="text" id="si_contact_name'.$form_id_num.'" name="si_contact_name" value="' . $this->ctf_output_string($name) .'" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; break; case 'first_last': $string .= $f_name_string; $string .= $l_name_string; break; case 'first_middle_i_last': $string .= $f_name_string; $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_mi_name).' ctf_field_style.' type="text" id="si_contact_mi_name'.$form_id_num.'" name="si_contact_mi_name" value="' . $this->ctf_output_string($mi_name) .'" '.$this->ctf_aria_required.' size="2" />
'; $string .= $l_name_string; break; case 'first_middle_last': $string .= $f_name_string; $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_m_name).' ctf_field_style.' type="text" id="si_contact_m_name'.$form_id_num.'" name="si_contact_m_name" value="' . $this->ctf_output_string($m_name) .'" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; $string .= $l_name_string; break; } } if($si_contact_opt['email_type'] != 'not_available' ) { if ($ctf_enable_double_email == 'true') { $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_email).' '.$this->ctf_echo_if_error($si_contact_error_double_email).' ctf_field_style.' type="email" id="si_contact_email'.$form_id_num.'" name="si_contact_email" value="' . $this->ctf_output_string($email) . '" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_email2).' '; $string .= ($si_contact_opt['title_email2_help'] != '') ? $si_contact_opt['title_email2_help'] : __('Please enter your E-mail Address a second time.', 'si-contact-form'); $string .= '
ctf_field_style.' type="email" id="si_contact_email2_'.$form_id_num.'" name="si_contact_email2" value="' . $this->ctf_output_string($email2) . '" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; } else { $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_email).' ctf_field_style.' type="email" id="si_contact_email'.$form_id_num.'" name="si_contact_email" value="' . $this->ctf_output_string($email) . '" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />
'; } } if ($si_contact_opt['ex_fields_after_msg'] != 'true') { // are there any optional extra fields/ for ($i = 1; $i <= $si_contact_opt['max_fields']; $i++) { if ($si_contact_opt['ex_field'.$i.'_label'] != '') { // include the code to display extra fields include(WP_PLUGIN_DIR . '/si-contact-form/si-contact-form-ex-fields.php'); break; } } } if($si_contact_opt['subject_type'] != 'not_available' ) { if (count($subjects) > 0) { $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_subject).' '; } else { // text entry subject if ( $subject != '' ) { $subject = substr($subject,0,75); // shorten to 75 chars or less } $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_subject).' ctf_field_style.' type="text" id="si_contact_subject'.$form_id_num.'" name="si_contact_subject" value="' . $this->ctf_output_string($subject) . '" '.$this->ctf_aria_required.' size="'.$ctf_field_size.'" />'; } $string .= '
'; } if($si_contact_opt['message_type'] != 'not_available' ) { $string .= '
ctf_title_style.'>
ctf_field_div_style.'>'.$this->ctf_echo_if_error($si_contact_error_message).'
'; } if ($si_contact_opt['ex_fields_after_msg'] == 'true') { // are there any optional extra fields/ for ($i = 1; $i <= $si_contact_opt['max_fields']; $i++) { if ($si_contact_opt['ex_field'.$i.'_label'] != '') { // include the code to display extra fields include(WP_PLUGIN_DIR . '/si-contact-form/si-contact-form-ex-fields.php'); break; } } } $this->ctf_submit_div_style = $this->si_contact_convert_css($si_contact_opt['submit_div_style']); $this->ctf_submit_style = $this->si_contact_convert_css($si_contact_opt['button_style']); $this->ctf_reset_style = $this->si_contact_convert_css($si_contact_opt['reset_style']); // captcha is optional but recommended to prevent spam bots from spamming your contact form if ( $this->isCaptchaEnabled() ) { $string .= $this->si_contact_get_captcha_html($si_contact_error_captcha,$form_id_num)."\n"; } $string .= '
ctf_submit_div_style.'> ctf_submit_style.' value="'; $string .= ($si_contact_opt['title_submit'] != '') ? $this->ctf_output_string( $si_contact_opt['title_submit'] ) : $this->ctf_output_string( __('Submit', 'si-contact-form')); $string .= '" '; if($si_contact_opt['enable_areyousure'] == 'true') { $string .= ' onclick="return confirm(\''; $string .= ($si_contact_opt['title_areyousure'] != '') ? $this->ctf_output_string(addslashes($si_contact_opt['title_areyousure'] )) : $this->ctf_output_string(addslashes( __('Are you sure?', 'si-contact-form'))); $string .= '\')" '; } $string .= '/> '; if($si_contact_opt['enable_reset'] == 'true') { $string .= 'ctf_reset_style.' value="'; $string .= ($si_contact_opt['title_reset'] != '') ? $this->ctf_output_string( $si_contact_opt['title_reset'] ) : $this->ctf_output_string( __('Reset', 'si-contact-form')); $string .= '" onclick="return confirm(\''; $string .= addslashes(__('Do you really want to reset the form?', 'si-contact-form')); $string .= '\')" />'."\n"; } $string .= '
'; if ($si_contact_opt['border_enable'] == 'true') { $string .= '
'; } $string .= '
'; if ($si_contact_opt['enable_credit_link'] == 'true') { $this->ctf_powered_by_style = $this->si_contact_convert_css($si_contact_opt['powered_by_style']); $string .= '

ctf_powered_by_style.'>'.__('Powered by', 'si-contact-form'). ' '.__('Fast Secure Contact Form', 'si-contact-form'). '

'; } $string .= '
'; /* --- vCita Scheduler Display - Start --- */ if ($si_contact_opt['vcita_enabled'] == 'true') { $confirmation_token = $this->vcita_should_store_expert_confirmation_token($si_contact_opt); $string .= "\n
"; $string .= "\n
\n"; // "Reset" the float properties $string .= '
'; /* --- vCita Scheduler Display - End --- */ } $string .= ' '; ?>