You are here

function opigno_skills_system_requirements in Opigno module 8

Implements hook_requirements().

File

modules/opigno_skills_system/opigno_skills_system.install, line 48
Install, update and uninstall functions for the Opigno skills system module.

Code

function opigno_skills_system_requirements($phase) {
  $requirements = [];
  $message = t('"almende/vis" library is not installed. Please install it from <a href="@library">here</a> and place in <em>libraries/</em> folder', [
    '@library' => 'https://github.com/almende/vis.git',
  ]);
  $library_exists = file_exists('libraries/vis/dist/vis.js') && file_exists('libraries/vis/dist/vis.css');
  if ($phase == 'runtime' && !$library_exists) {
    $requirements += [
      'opigno_skills_system' => [
        'title' => t('Skills system library'),
        'value' => $message,
        'severity' => REQUIREMENT_ERROR,
      ],
    ];
  }
  return $requirements;
}