Example #1
0
 static function set_defaults()
 {
     // Set up default values
     // Default global options array
     self::$global_defaults = array('fscf_version' => FSCF_VERSION, 'donated' => 'false', 'vcita_auto_install' => 'false', 'vcita_dismiss' => 'false', 'vcita_initialized' => 'false', 'vcita_show_disable_msg' => 'false', 'vcita_site' => 'www.vcita.com', 'enable_php_sessions' => 'false', 'num_standard_fields' => '4', 'max_form_num' => '2', 'form_list' => array('1' => 'Form 1', '2' => 'Form 2'));
     // Default style settings
     $style_defaults = self::set_style_defaults();
     // Default options for a single contact form
     self::$form_defaults = array('form_name' => __('New Form', 'si-contact-form'), 'welcome' => __('<p>Comments or questions are welcome.</p>', 'si-contact-form'), 'after_form_note' => '', 'email_to' => __('Webmaster', 'si-contact-form') . ',' . get_option('admin_email'), 'php_mailer_enable' => 'wordpress', 'email_from' => '', 'email_from_enforced' => 'false', 'email_reply_to' => '', 'email_bcc' => '', 'email_subject' => get_option('blogname') . ' ' . __('Contact:', 'si-contact-form'), 'email_subject_list' => '', 'name_format' => 'name', 'preserve_space_enable' => 'false', 'double_email' => 'false', 'name_case_enable' => 'false', 'sender_info_enable' => 'true', 'domain_protect' => 'true', 'domain_protect_names' => '', 'anchor_enable' => 'true', 'email_check_dns' => 'false', 'email_html' => 'false', 'email_inline_label' => 'false', 'email_hide_empty' => 'false', 'print_form_enable' => 'false', 'email_keep_attachments' => 'false', 'akismet_disable' => 'false', 'akismet_send_anyway' => 'true', 'captcha_enable' => 'true', 'captcha_small' => 'false', 'captcha_perm' => 'false', 'captcha_perm_level' => 'read', 'honeypot_enable' => 'false', 'redirect_enable' => 'true', 'redirect_seconds' => '3', 'redirect_url' => get_option('home'), 'redirect_query' => 'false', 'redirect_ignore' => '', 'redirect_rename' => '', 'redirect_add' => '', 'redirect_email_off' => 'false', 'silent_send' => 'off', 'silent_url' => '', 'silent_ignore' => '', 'silent_rename' => '', 'silent_add' => '', 'silent_email_off' => 'false', 'export_ignore' => '', 'export_rename' => '', 'export_add' => '', 'export_email_off' => 'false', 'date_format' => 'mm/dd/yyyy', 'cal_start_day' => '0', 'time_format' => '12', 'attach_types' => 'doc,docx,pdf,txt,gif,jpg,jpeg,png', 'attach_size' => '1mb', 'textarea_html_allow' => 'false', 'enable_areyousure' => 'false', 'auto_respond_enable' => 'false', 'auto_respond_html' => 'false', 'auto_respond_from_name' => get_option('blogname'), 'auto_respond_from_email' => get_option('admin_email'), 'auto_respond_reply_to' => get_option('admin_email'), 'auto_respond_subject' => '', 'auto_respond_message' => '', 'req_field_indicator_enable' => 'true', 'req_field_label_enable' => 'true', 'req_field_indicator' => ' *', 'border_enable' => 'false', 'external_style' => 'false', 'aria_required' => 'false', 'auto_fill_enable' => 'true', 'form_attributes' => '', 'submit_attributes' => '', 'title_border' => __('Contact Form', 'si-contact-form'), 'title_dept' => '', 'title_select' => '', 'title_name' => '', 'title_fname' => '', 'title_mname' => '', 'title_miname' => '', 'title_lname' => '', 'title_email' => '', 'title_email2' => '', 'title_subj' => '', 'title_mess' => '', 'title_capt' => '', 'title_submit' => '', 'title_reset' => '', 'title_areyousure' => '', 'text_message_sent' => '', 'text_print_button' => '', 'tooltip_required' => '', 'tooltip_captcha' => '', 'tooltip_refresh' => '', 'tooltip_filetypes' => '', 'tooltip_filesize' => '', 'enable_reset' => 'false', 'enable_credit_link' => 'false', 'error_contact_select' => '', 'error_name' => '', 'error_email' => '', 'error_email_check' => '', 'error_email2' => '', 'error_url' => '', 'error_date' => '', 'error_time' => '', 'error_maxlen' => '', 'error_field' => '', 'error_subject' => '', 'error_select' => '', 'error_input' => '', 'error_captcha_blank' => '', 'error_captcha_wrong' => '', 'error_correct' => '', 'error_spambot' => '', 'fields' => array(), 'vcita_scheduling_button' => 'false', 'vcita_scheduling_button_label' => '', 'vcita_approved' => 'false', 'vcita_uid' => '', 'vcita_email' => '', 'vcita_email_new' => get_option('admin_email') == '*****@*****.**' ? '' : get_option('admin_email'), 'vcita_confirm_token' => '', 'vcita_confirm_tokens' => '', 'vcita_initialized' => 'false', 'vcita_link' => 'false', 'vcita_first_name' => '', 'vcita_last_name' => '', 'vcita_scheduling_button_label' => 'Schedule an Appointment', 'vcita_scheduling_link_text' => 'Click above to schedule an appointment using vCita Online Scheduling');
     // Merge in the style settings
     // Do it this way so we also have the style settings in a separate array to make validation easier
     self::$form_defaults = array_merge(self::$form_defaults, $style_defaults);
     self::get_field_defaults();
     // Add the standard fields (Name, Email, Subject, Message)
     // The main plugin file defines constants to refer to the standard field codes
     $name = array('standard' => '1', 'req' => 'true', 'label' => __('Name:', 'si-contact-form'), 'slug' => 'full_name', 'type' => 'text');
     $email = array('standard' => '2', 'req' => 'true', 'label' => __('Email:', 'si-contact-form'), 'slug' => 'email', 'type' => 'text');
     $subject = array('standard' => '3', 'req' => 'true', 'label' => __('Subject:', 'si-contact-form'), 'slug' => 'subject', 'type' => 'text');
     $message = array('standard' => '4', 'req' => 'true', 'label' => __('Message:', 'si-contact-form'), 'slug' => 'message', 'type' => 'textarea');
     // Add the standard fields to the form fields array
     self::$form_defaults['fields'][] = array_merge(self::$field_defaults, $name);
     self::$form_defaults['fields'][] = array_merge(self::$field_defaults, $email);
     self::$form_defaults['fields'][] = array_merge(self::$field_defaults, $subject);
     self::$form_defaults['fields'][] = array_merge(self::$field_defaults, $message);
     return self::$form_defaults;
 }