You are here

function yoast_seo_library_path in Real-time SEO for Drupal 7

Generates the path to the Yoast SEO JavaScript library files.

Parameters

string $mode: (optional) Mode the path should be generated as.

Return value

string Generated path to the library in the mode that was requested.

1 call to yoast_seo_library_path()
yoast_seo_configuration_form_after_build in ./yoast_seo.module
In this afterbuild function we add the configuration to the JavaScript.

File

./yoast_seo.module, line 1005
Primary hook implementations for Yoast SEO for Drupal module.

Code

function yoast_seo_library_path($library = 'js-text-analysis', $mode = 'relative') {
  $lib_path = drupal_get_path('module', 'yoast_seo') . '/js';
  if ($mode == 'local') {
    return './' . $lib_path . '/' . $library;
  }
  else {
    return base_path() . $lib_path . '/' . $library;
  }
}