You are here

function cas_library_version_check in CAS 7

Same name and namespace in other branches
  1. 6.3 cas.admin.inc \cas_library_version_check()

Checks that the library is installed in the location specified by loading the class and extracting the version.

Parameters

$element: The form element containing the "library" fieldset.

$form_state: An array containing the form's state information.

Return value

The modified form element containing the "library" fieldset.

1 string reference to 'cas_library_version_check'
cas_admin_settings in ./cas.admin.inc
Provides settings pages.

File

./cas.admin.inc, line 385
CAS module settings UI.

Code

function cas_library_version_check($element, &$form_state) {
  $path = module_exists('libraries') ? NULL : $element['#value'];

  // Suppress errors if phpCAS cannot be loaded.
  if ($version = @cas_phpcas_load($path)) {
    $element['#suffix'] = '<div class="ok messages">' . t('phpCAS version %version successfully loaded.', array(
      '%version' => $version,
    )) . '</div>';
  }
  else {
    $element['#suffix'] = '<div class="error messages">' . t('The phpCAS library was not found or could not be loaded.') . '</div>';
  }
  return $element;
}