You are here

function _magnific_popup_check_status in Magnific Popup 7

Internal utility function to check required library status.

1 call to _magnific_popup_check_status()
magnific_popup_field_formatter_view in includes/magnific_popup.formatters.inc
Implements hook_field_formatter_view().

File

./magnific_popup.module, line 71
magnific_popup/magnific_popup.module

Code

function _magnific_popup_check_status() {
  $jquery = drupal_get_library('system', 'jquery');
  if (empty($jquery) || empty($jquery['version'])) {

    // jQuery not available?  Totally an error condition.
    // @todo We should watchdog this, and/or report it on site status screen.
    return FALSE;
  }

  // Check if the available jQuery version is 1.7.2+.
  // @see http://dimsemenov.com/plugins/magnific-popup/documentation.html
  if (version_compare($jquery['version'], '1.7.2') < 0) {

    // $jquery['version'] is lower than 1.7.2.
    // @todo We should watchdog this, and/or report it on site status screen.
    return FALSE;
  }
  return TRUE;
}