Exemplo n.º 1
0
function salesforce_default_settings()
{
    $options = array();
    $options['version'] = '2.0';
    $options['successmsg'] = __('Success!', 'salesforce');
    $options['errormsg'] = __('This field is required.', 'salesforce');
    $options['emailerrormsg'] = __('The email address you entered is not valid.', 'salesforce');
    $options['captchaerrormsg'] = __('The text you entered did not match the image.', 'salesforce');
    $options['requiredfieldstext'] = __('These fields are required.', 'salesforce');
    $options['sferrormsg'] = __('Failed to connect to Salesforce.com.', 'salesforce');
    $options['submitbutton'] = __('Submit', 'salesforce');
    $options['subject'] = __('Thank you for contacting %BLOG_NAME%', 'salesforce');
    $options['showccuser'] = true;
    $options['ccusermsg'] = __('Send me a copy', 'salesforce');
    $options['email_sender'] = '';
    $options['ccadmin'] = false;
    $options['captcha'] = false;
    $options['da_token'] = '';
    $options['da_url'] = '';
    $options['da_site'] = '';
    $options['commentstoleads'] = false;
    $options['commentsnamefields'] = false;
    $options['usecss'] = true;
    $options['wpcf7css'] = false;
    //$options['hide_salesforce_link']= true;
    $options['forms'][1] = Salesforce_Admin::default_form();
    update_option('salesforce2', $options);
    return $options;
}
Exemplo n.º 2
0
function sfwtli_save_form($field_data)
{
    // data format
    // array( 'first_name' 	=> array('type' => 'text', 'label' => 'First name', 'show' => true, 'required' => true), )
    $Salesforce_Admin = new Salesforce_Admin();
    // get form option data
    $options = get_option($Salesforce_Admin->optionname);
    // get last id and increment
    end($options['forms']);
    $form_id = key($options['forms']) + 1;
    // get default form data
    $options['forms'][$form_id] = $Salesforce_Admin->default_form();
    $options['forms'][$form_id]['form_name'] = 'My Imported Lead Form ' . date('Y-m-d h:i:s');
    // overwrite defaults with import data
    $options['forms'][$form_id]['inputs'] = $field_data;
    update_option($Salesforce_Admin->optionname, $options);
    return $form_id;
}