You are here

function wf_crm_tokeninput_path in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/contact_component.inc \wf_crm_tokeninput_path()
  2. 7.3 contact_component.inc \wf_crm_tokeninput_path()

Get the path to the jquery.tokeninput plugin

Return value

string

2 calls to wf_crm_tokeninput_path()
_webform_edit_civicrm_contact in includes/contact_component.inc
Implements _webform_edit_component().
_webform_render_civicrm_contact in includes/contact_component.inc
Implements _webform_render_component().

File

includes/contact_component.inc, line 1166

Code

function wf_crm_tokeninput_path() {
  static $ret;
  if (!$ret) {

    // First see if the library is installed in Drupal
    $path = function_exists('libraries_get_path') ? libraries_get_path('tokeninput') : NULL;
    if ($path && is_file(DRUPAL_ROOT . '/' . $path . '/src/jquery.tokeninput.js')) {
      $ret = $path . '/src/jquery.tokeninput.js';
    }
    else {
      $ret = drupal_get_path('module', 'civicrm') . '/../packages/jquery/plugins/jquery.tokeninput.js';
    }
  }
  return $ret;
}