You are here

function _salesforce_is_form in Salesforce Suite 5

check the settings to see if a form is allowed lead or event actions and return its message if needed

4 calls to _salesforce_is_form()
salesforce_form_alter in ./salesforce.module
Implementation of hook_form_alter().
salesforce_form_event_submit in ./salesforce.module
salesforce_form_lead_submit in ./salesforce.module
all forms set to use lead / event actions receive these submit functions separated right now just because.. TODO: should probably be reduced 1 one function but we're waiting..
salesforce_user in ./salesforce.module
Implementation of hook_user().

File

./salesforce.module, line 539
Original Creator, Maintainer & Developer: Steve McKenzie (http://drupal.org/user/45890) Drupal and Salesforce.com (mainly only working with contacts / leads but can be extended to do anything the salesforce API version 6 can do) Current…

Code

function _salesforce_is_form($type, $form_id, $message = false) {
  $ids = explode("\n", variable_get('salesforce_' . $type . '_create_forms', SALESFORCE_EVENTS_CREATE_FORMS));
  foreach ($ids as $id) {
    if (strchr($id, ' | ')) {
      $result = explode(' | ', $id);
      $id = $result[0];
      $msg = $result[1];
    }
    if (trim($id) == $form_id) {
      if ($msg && $message) {
        return $msg;
      }
      else {
        return true;
      }
    }
  }
}