You are here

function superfish_install in Superfish 8

Implements hook_enable().

File

./superfish.install, line 11
Install, update and uninstall functions for the Superfish module.

Code

function superfish_install() {
  $messenger = \Drupal::messenger();
  if (superfish_library_check()) {
    $messenger
      ->addMessage(t('In order to use Superfish, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', [
      '@block' => 'structure/block',
    ]));
  }
  else {
    $messenger
      ->addWarning(t('Superfish library is missing. Please refer to the <a href="@documentation">plugin documentation</a> for how you can fix this issue; Once done, go to the <a href="@block">Block layout</a> page and use any of the "Place block" buttons to create a Superfish block.', [
      '@documentation' => 'https://www.drupal.org/node/1125896',
      '@block' => 'structure/block',
    ]));
  }
  $messenger
    ->addMessage(t('If there was no Superfish block in the "Place block" form, go to the <a href="@performance">Performance</a> page and clear the cache once.', [
    '@performance' => 'config/development/performance',
  ]));
}