You are here

function popup_message_get_jquerycookie_path in Popup message 6

Return the path to the jquery.cookie.js plugin.

2 calls to popup_message_get_jquerycookie_path()
popup_message_requirements in ./popup_message.install
Implementation of hook_requirements().
popup_message_show_message in ./popup_message.module
Show popup message.

File

./popup_message.module, line 113
Main module file.

Code

function popup_message_get_jquerycookie_path() {
  static $library_path = NULL;

  // Try to locate the library path in any possible setup.
  if ($library_path == NULL) {

    // First check the default location.
    $path = variable_get('popup_message_jquerycookie_path', POPUP_MESSAGE_JQUERYCOOKIE_PATH);
    if (is_dir($path . '/jquery.cookie')) {
      $library_path = $path;
    }
    elseif ($library_path == NULL && module_exists('libraries')) {
      if ($path = libraries_get_path('jquery.cookie')) {
        $library_path = $path;
        variable_set('popup_message_jquerycookie_path', $library_path);
      }
    }
    elseif ($library_path == NULL) {
      $library_path = POPUP_MESSAGE_JQUERYCOOKIE_PATH;
    }
  }
  return $library_path;
}