You are here

function salesforce_api_update_wsdl_form in Salesforce Suite 7.2

Same name and namespace in other branches
  1. 6.2 salesforce_api/ \salesforce_api_update_wsdl_form()

Show form for admin to upload a new WSDL file

1 string reference to 'salesforce_api_update_wsdl_form'
salesforce_api_menu in salesforce_api/salesforce_api.module
Implements hook_menu().


salesforce_api/, line 1094
Contains the admin page callbacks for the Salesforce module, including forms for general settings and fieldmap administration.


function salesforce_api_update_wsdl_form($form, &$form_state) {
  $form = array();

  // Need to set the form type so file upload will work
  $form['#attributes']['enctype'] = 'multipart/form-data';
  $form['salesforce_api_wsdl_file'] = array(
    '#type' => 'file',
    '#title' => t('WSDL File'),
    '#description' => t('Upload the new WSDL definition file. The name of the file is irrelevent, but it must end with an XML or WSDL extension.'),

  // WSDL file should be outside of webroot. The admin should specify a path
  // outside the webroot, then upload a WSDL file to it.
  $wsdl_dir = variable_get('salesforce_api_dir_wsdl', FALSE);
  $form['wsdl'] = array(
    '#type' => 'textfield',
    '#title' => t('WSDL Directory'),
    '#description' => t('Your organization\'s WSDL file can expose potentially sensitive information. It is highly recommended that your WSDL file be stored outside your webroot. Please enter either a path relative to your webroot (e.g. ../wsdl) or a fully qualified path (e.g. /home/username/wsdl) in which to store your WSDL.'),
    '#default_value' => $wsdl_dir,
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Upload WSDL'),
  return $form;